diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85c801f39bf3f5d181a9e4e94a44b9f31894a739..06a0f7631f641418e0e60d54561a6395d5b5bb60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,3 +63,53 @@ worker: - job: backend variables: image: worker + +.boot-instance: + image: debian:bookworm-slim + tags: + - heavyweight + services: + - name: docker:stable-dind + alias: docker + variables: + DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://docker:2375 + DOCKER_TLS_CERTDIR: "" + before_script: + - apt update && apt install -y --no-install-recommends + curl + docker-compose + docker.io + wait-for-it + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" + - docker info + - | + cat << EOF > docker-compose.override.yml + version: '2.1' + services: + frontend: + image: $CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_REF_SLUG + ports: + - "80:3000" + backend: + image: $CI_REGISTRY_IMAGE/backend:$CI_COMMIT_REF_SLUG + ports: + - "5252:5252" + worker: + image: $CI_REGISTRY_IMAGE/worker:$CI_COMMIT_REF_SLUG + EOF + - docker-compose up -d + - wait-for-it docker:5252 -s --timeout=180 -- echo "The OBS backend is up" + - wait-for-it docker:80 -s --timeout=180 -- echo "The OBS frontend is up" + after_script: + - docker-compose logs > docker-compose.txt + artifacts: + paths: + - docker-compose.txt + when: always + +integration-test: + stage: test + extends: .boot-instance + script: + - curl http://docker:80/