4 ms·
This is the easiest part, you just call: docker service update --image $image_name:$new_sha $service_name and Swarm handles the rest. You can even pass in r
by acejam 9y ago
This is the easiest part, you just call:
docker service update --image $image_name:$new_sha $service_name
and Swarm handles the rest. You can even pass in rolling update options, so the container updates are staggered. Put this into a simple bash script that only runs when the current branch is master. (Because your CI is building every branch to give you fast feedback, right?) In the case of CircleCI or TravisCI, that can be done with something like:
if [ "${CIRCLE_BRANCH}" == "master" ]; then