Skip to content

Commit

Permalink
[fix] restart DS if not the same version cf ICIJ/datashare#123
Browse files Browse the repository at this point in the history
  • Loading branch information
bamthomas committed May 22, 2019
1 parent 6e86bc6 commit b259b76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mac/datashare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ create_docker_compose_file
datashare_id=\$(docker-compose -f /tmp/datashare.yml -p datashare ps -q datashare)
if [[ -n "\${datashare_id}" ]]; then
datashare_status=\$(docker inspect \${datashare_id} -f "{{.State.Status}}")
datashare_running_version=\$(docker inspect datashare -f '{{.Config.Image}}' | awk -F ':' '{print $2}')
fi

if [[ "\${datashare_status}" == "running" ]]; then
if [[ "\${datashare_status}" == "running" && "\${datashare_running_version}" == "\${datashare_version}" ]]; then
echo "datashare is \${datashare_status}, restarting it"
docker-compose -f /tmp/datashare.yml -p datashare restart datashare
else
Expand Down

0 comments on commit b259b76

Please sign in to comment.