feat(Docker Compose): Test Docker Compose

This commit is contained in:
Marcel Feix 2022-06-14 16:16:29 +02:00
parent a96c62fb3d
commit 6d2aecc06c
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
3 changed files with 37 additions and 15 deletions

View File

@ -6,7 +6,6 @@ stages:
include: include:
- local: 'templates/releasing/release.gitlab-ci.yml' - local: 'templates/releasing/release.gitlab-ci.yml'
- local: 'templates/releasing/release-gitlab.gitlab-ci.yml' - local: 'templates/releasing/release-gitlab.gitlab-ci.yml'
- local: 'templates/IaC/docker-compose.gitlab-ci.yml'
- local: 'templates/documentations/documentation.gitlab-ci.yml' - local: 'templates/documentations/documentation.gitlab-ci.yml'
Test-Java-Backend: Test-Java-Backend:
@ -26,20 +25,11 @@ Test-Docker-compose:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
when: always when: always
- when: manual - when: manual
extends: .docker-compose-deploy trigger:
variables: strategy: depend
SCP_DESTINATION: "/tmp" include:
SCP_SOURCE: "$CI_PROJECT_DIR/test/docker-compose.yml" - local: "test/docker-compose/test.gitlab-ci.yml"
COMPOSE_EXTRA_ARGS: "-f test/docker-compose.yml"
SSH_URL: "ci-cd.dev.exxcellent.de"
SSH_USER: "user"
SSH_PORT: "22"
DOCKER_REGISTRY: "$CI_REGISTRY"
ENV_SETUP_FILE: "setup_env.sh"
SSH_PRIVATE_KEY_DEPLOY: $SSH_PRIVATE_KEY
after_script:
- ssh $SSH_USER@$SSH_URL "if [ -f test.log ]; then exit 1; rm test.log; fi"
- ssh $SSH_USER@$SSH_URL "if [ -f docker-compose.yml ]; then exit 1; rm docker-compose.yml; fi"
check_confluence_validity: check_confluence_validity:
extends: .documentation-check-confluence-validity extends: .documentation-check-confluence-validity

View File

@ -0,0 +1,32 @@
stages:
- compose
- verify
include:
- local: 'templates/IaC/docker-compose.gitlab-ci.yml'
- local: 'templates/IaC/ssh-transfer-data.gitlab-ci.yml'
Docker-compose:
stage: compose
rules:
- when: always
extends: .docker-compose-deploy
variables:
SCP_DESTINATION: "/tmp"
SCP_SOURCE: "$CI_PROJECT_DIR/test/docker-compose.yml"
COMPOSE_EXTRA_ARGS: "-f test/docker-compose.yml"
SSH_URL: "ci-cd.dev.exxcellent.de"
SSH_USER: "user"
SSH_PORT: "22"
DOCKER_REGISTRY: "$CI_REGISTRY"
ENV_SETUP_FILE: "setup_env.sh"
SSH_PRIVATE_KEY_DEPLOY: $SSH_PRIVATE_KEY
Test-Files:
stage: verify
rules:
when: always
extends: .ssh-transfer-data
script:
- ssh $SSH_USER@$SSH_URL "if [ -f test.log ]; then exit 1; rm test.log; fi"
- ssh $SSH_USER@$SSH_URL "if [ -f docker-compose.yml ]; then exit 1; rm docker-compose.yml; fi"