From c2d4eb610ac1fe6e36219e0b2ac9a385c8902a55 Mon Sep 17 00:00:00 2001 From: Nico Vermaas <vermaas@astron.nl> Date: Fri, 12 Feb 2021 17:15:20 +0100 Subject: [PATCH] trying 'staging' step instead of 'deploy to acceptance' --- .gitlab-ci.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55d987ba..ccb723ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,9 @@ stages: - build + - staging - deploy -docker-build-master: +docker-build: # Official docker image. image: docker:latest stage: build @@ -72,6 +73,25 @@ docker-deploy-acceptance: only: - acceptance +# deploy acceptance version on 'dop457.astron.nl' +docker-staging-acceptance: + image: docker:latest + stage: staging + before_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan dop457.astron.nl >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - ssh -o StrictHostKeyChecking=no vermaas@dop457.astron.nl "docker pull "$CI_REGISTRY_IMAGE"" + - ssh -o StrictHostKeyChecking=no vermaas@dop457.astron.nl "docker-compose -p atdb -f /data/docker_compose/docker-compose-atdb-ldv-acc-cd.yml up -d" + when: manual + only: + - release + # deploy release version on 'sdc.astron.nl' docker-deploy-release: image: docker:latest -- GitLab