Created
April 23, 2018 14:15
-
-
Save hansamann/0b22b9ebad4186406f01022859cd9eed to your computer and use it in GitHub Desktop.
Deploy Stage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy: | |
stage: deploy | |
dependencies: [] | |
variables: | |
GIT_STRATEGY: none | |
tags: | |
- tablemaster | |
script: | |
- echo ${CI_REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY} | |
- TABLESERVICE=$(docker service ls --filter name=tableservice --quiet) | |
- | | |
if [ "$TABLESERVICE" == "" ] | |
then | |
docker service create \ | |
--name tableservice \ | |
--with-registry-auth \ | |
--constraint 'node.labels.type==table' \ | |
--publish mode=host,published=80,target=8080 \ | |
--mode=global \ | |
--mount type=bind,source=/sys,target=/sys \ | |
${CI_REGISTRY_IMAGE}:${DEPLOY_TAG} | |
else | |
docker service update \ | |
--with-registry-auth \ | |
--image ${CI_REGISTRY_IMAGE}:${DEPLOY_TAG} \ | |
--force tableservice\ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment