Skip to content
Snippets Groups Projects
Commit fd56b9ad authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge branch 'split-pipeline-for-gitlab' into 'master'

Split pipeline for gitlab

See merge request !383
parents 0e90a4e7 623daee4
No related branches found
No related tags found
1 merge request!383Split pipeline for gitlab
Pipeline #101308 passed
......@@ -41,7 +41,7 @@ test-code:
- if: '$GITLAB_HOST == "git.astron.nl"'
# deploy to 'sdc-dev.astron.nl'
docker-deploy-to-test:
docker-deploy-to-test-gitlab-astron:
image: docker:latest
stage: deploy_to_test
tags:
......@@ -63,7 +63,7 @@ docker-deploy-to-test:
# deploy to 'sdc.astron.nl'
docker-deploy-to-production:
docker-deploy-to-production-gitlab-astron:
image: docker:latest
stage: deploy_to_production
tags:
......@@ -84,3 +84,51 @@ docker-deploy-to-production:
when: manual
rules:
- if: '$GITLAB_HOST == "git.astron.nl"'
# deploy to 'sdc-dev.astron.nl'
docker-deploy-to-test-gitlab-com:
image: docker:latest
stage: deploy_to_test
tags:
- "sdc-dev"
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_USER_SDC" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan dop814.astron.nl >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- scp -O -o StrictHostKeyChecking=no atdb/docker/docker-compose-dev-cd.yml sdc@dop814.astron.nl:/docker_compose/atdb-ldv/docker-compose-dev-cd.yml
- ssh -o StrictHostKeyChecking=no sdc@dop814.astron.nl "echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY"
- ssh -o StrictHostKeyChecking=no sdc@dop814.astron.nl "docker pull "$CI_REGISTRY_IMAGE""
- ssh -o StrictHostKeyChecking=no sdc@dop814.astron.nl "docker-compose -p atdb -f /docker_compose/atdb-ldv/docker-compose-dev-cd.yml up -d"
when: manual
rules:
- if: '$GITLAB_HOST != "git.astron.nl"'
# deploy to 'sdc.astron.nl'
docker-deploy-to-production-gitlab-com:
image: docker:latest
stage: deploy_to_production
tags:
- "sdc-dev"
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_USER_SDC" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan dop821.astron.nl >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- scp -O -o StrictHostKeyChecking=no atdb/docker/docker-compose-production-cd.yml sdco@dop821.astron.nl:/opt/dockercompose/atdb-ldv-compose/docker-compose-production-cd.yml
- ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY"
- ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker pull "$CI_REGISTRY_IMAGE""
- ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p atdb -f /opt/dockercompose/atdb-ldv-compose/docker-compose-production-cd.yml up -d"
when: manual
rules:
- if: '$GITLAB_HOST != "git.astron.nl"'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment