Commit 372ac828 authored by Tommy Svendsen's avatar Tommy Svendsen
Browse files

DEICH-3487 adjustments to deployment script handling

parent 551465c3
......@@ -196,9 +196,6 @@
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- export APPLICATION_NAME=${APPLICATION_NAME}
script:
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" CONTAINER=${APPLICATION_NAME}
- make remote-deploy-voting ssh_user=${SSH_USER} voting_node="${SSH_VOTING_SERVER}"
when: manual
#Deploy test
......@@ -210,13 +207,15 @@
SSH_SERVERS: $DEVTEST_SERVER
SSH_KNOWN_HOSTS: $DEVTEST_KNOWN_HOSTS
SSH_KEY: $DEPLOY_KEY
script:
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" CONTAINER=${APPLICATION_NAME}
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" CONTAINER=${APPLICATION_NAME}
deploy-scheduled-test:
extends:
- .devtest
- .deploy-scp
after_script:
- make remote-docker-command CONTAINER=koha ssh_user=$DEPLOY_USER ssh_server=$DEVTEST_SERVER cmd=/koha/start-cron.sh
- ./transitionIssues.sh test
- *after
only:
......@@ -229,7 +228,6 @@
- .devtest
- .deploy-scp
after_script:
- make remote-docker-command CONTAINER=koha ssh_user=$DEPLOY_USER ssh_server=$DEVTEST_SERVER cmd=/koha/start-cron.sh
- ./transitionIssues.sh test
- *after
when: manual
......@@ -383,6 +381,9 @@
SSH_SERVERS: "${STAGING_SERVERS}"
SSH_KEY: $DEPLOY_KEY
SSH_VOTING_SERVER: ${STAGING_VOTING_SERVER}
script:
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" CONTAINER=${APPLICATION_NAME}
- make remote-deploy-voting ssh_user=${SSH_USER} voting_node="${SSH_VOTING_SERVER}"
deploy-all-staging:
extends:
......
......@@ -122,13 +122,13 @@ remote-deploy: | check-ssh_user check-ssh_servers check-TAG
@echo "Deploying $(TAG) to server $$server" ; \
ssh $(ssh_user)@$$server "mkdir -p ./deployments/$(TAG)/deichman && rm -rf ./deployments/$(TAG)/config cp -rf \$$DEPLOYMENT_CONFIG_LOCATION/ ./deployments/$(TAG)/config"; \
scp docker-compose.yml $(ssh_user)@$$server:deployments/$(TAG)/docker-compose.yml; \
ssh $(ssh_user)@$$server "cd deployments/$(TAG)/deichman && TAG=$(TAG) DEPLOYMENT_CONFIG_LOCATION=./config docker-compose --env-file=../config/.env -f ../docker-compose.yml -f ../config/docker-compose.yml > docker-compose.yml && docker-compose up -d $(CONTAINER)"; \
ssh $(ssh_user)@$$server "cd deployments/$(TAG)/deichman && TAG=$(TAG) DEPLOYMENT_CONFIG_LOCATION=./config docker-compose --env-file=../config/.env -f ../docker-compose.yml -f ../config/docker-compose.yml > docker-compose.yml && docker-compose pull && docker-compose up -d $(CONTAINER)"; \
done
remote-deploy-voting: | check-ssh_user check-TAG
ifdef voting_node
@echo "Deploying to voting node $(voting_node)" ; \
ssh $(ssh_user)@$(voting_node) "mkdir -p deployments/$(TAG)/deichman && rm -rf deployments/$(TAG)/config && cd deployments/$(TAG)/ && cp -rf \$$DEPLOYMENT_CONFIG_LOCATION config && cp \$$DEPLOYMENT_CONFIG_LOCATION/../debvoter/docker-compose.yml . && cd deichman && TAG=$(TAG) DEPLOYMENT_CONFIG_LOCATION=./config docker-compose --env-file=../config/.env -f ../docker-compose.yml config > docker-compose.yml && docker-compose up -d";
ssh $(ssh_user)@$(voting_node) "mkdir -p deployments/$(TAG)/deichman && rm -rf deployments/$(TAG)/config && cd deployments/$(TAG)/ && cp -rf \$$DEPLOYMENT_CONFIG_LOCATION config && cp \$$DEPLOYMENT_CONFIG_LOCATION/../debvoter/docker-compose.yml . && cd deichman && TAG=$(TAG) DEPLOYMENT_CONFIG_LOCATION=./config docker-compose --env-file=../config/.env -f ../docker-compose.yml config > docker-compose.yml && docker-compose pull && docker-compose up -d";
endif
remote-docker-command:
......
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