Commit 9618416f authored by Tommy Svendsen's avatar Tommy Svendsen
Browse files

DEICH-3487 add support to deploy debvoter node as well

parent c0399568
......@@ -163,6 +163,7 @@
- export APPLICATION_NAME=${APPLICATION_NAME}
script:
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" job_id=${CI_JOB_ID} deploy_tag=${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA:-latest}} CONTAINER=${APPLICATION_NAME}
- make remote-deploy-voting ssh_user=${SSH_USER} voting_node="${SSH_VOTING_SERVER}" deploy_tag=${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA:-latest}}
when: manual
#Deploy test
......@@ -336,6 +337,7 @@
SSH_KNOWN_HOSTS: $STAGING_HOSTS
SSH_SERVERS: "${STAGING_SERVERS}"
SSH_KEY: $DEPLOY_KEY
SSH_VOTING_SERVER: ${STAGING_VOTING_SERVER}
deploy-all-staging:
extends:
......
......@@ -120,9 +120,18 @@ remote-deploy: | check-ssh_user check-ssh_servers check-job_id check-deploy_tag
@for server in $(ssh_servers);\
do\
ssh $(ssh_user)@$$server "mkdir -p ./deployments/$(job_id)/deichman && cd ./deployments/$(job_id)/deichman && ln -fvs \$$DEPLOYMENT_CONFIG_LOCATION/docker-compose.yml docker-compose.override.yml && ln -fvs \$$DEPLOYMENT_CONFIG_LOCATION/.env"; \
scp docker-compose.yml $(ssh_user)@$$server:deployments/$(job_id)/deichman/; \
ssh $(ssh_user)@$$server "cd deployments/$(job_id)/deichman && TAG=$(deploy_tag) docker-compose pull $(CONTAINER) && TAG=$(deploy_tag) docker-compose up -d $(CONTAINER)"; \
scp docker-compose.yml $(ssh_user)@$$server:deployments/$(job_id)/deichman/; \
ssh $(ssh_user)@$$server "cd deployments/$(job_id)/deichman && TAG=$(deploy_tag) docker-compose pull $(CONTAINER) && TAG=$(deploy_tag) docker-compose up -d $(CONTAINER)"; \
done
ifdef voting_node
remote-deploy-voting: | check-ssh_user check-deploy_tag
ssh $(ssh_user)@$(voting_node) "cd \$$DEPLOYMENT_CONFIG_LOCATION/ && COMPOSE_PROJECT_NAME=deichman TAG=$(deploy_tag) docker-compose -f \$$DEPLOYMENT_CONFIG_LOCATION/../debvoter/docker-compose.yml up -d";
else
remote-deploy-voting:
endif
remote-deploy-voter:
ssh $(ssh_user)@$$server "cd \$$DEPLOYMENT_CONFIG_LOCATION/ && COMPOSE_PROJECT_NAME=deichman TAG=$(deploy_tag) docker-compose -f \$$DEPLOYMENT_CONFIG_LOCATION/debvoter/docker-compose.yml config"
remote-docker-command:
ssh $(ssh_user)@$(ssh_server) "cd ./deployments/$(job_id)/deichman && docker-compose exec -T $(CONTAINER) $(cmd)"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment