diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b17c2c..6bc61f9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -131,9 +131,9 @@ build-gateway: - *build-and-push-script .test-script: &test-script - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_DEV_FILE down - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_DEV_FILE pull - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit --renew-anon-volumes + - docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE down + - docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull + - docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit --renew-anon-volumes .test-api-script: &test-api-script - *test-script @@ -274,37 +274,37 @@ test-screen-client: .test-integration: &test-integration - export TEST_TARGET=INTEGRATION - export API_IMAGE=$FLIGHTS_INFO_TEST_IMAGE_NAME - - docker compose -f flights-domain/docker-compose.yml --env-file $ENV_DEV_FILE down - - docker compose -f flights-domain/docker-compose.yml --env-file $ENV_DEV_FILE pull - - docker compose -f flights-domain/docker-compose.yml --env-file $ENV_DEV_FILE up -d + - docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down + - docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull + - docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d - export API_IMAGE=$GATEWAY_TEST_IMAGE_NAME - - docker compose -f gateway/docker-compose.yml --env-file $ENV_DEV_FILE down - - docker compose -f gateway/docker-compose.yml --env-file $ENV_DEV_FILE pull - - docker compose -f gateway/docker-compose.yml --env-file $ENV_DEV_FILE up -d + - docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE down + - docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull + - docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d - export API_IMAGE=$USER_MANAGER_TEST_IMAGE_NAME - - docker compose -f auth-domain/docker-compose.yml --env-file $ENV_DEV_FILE down - - docker compose -f auth-domain/docker-compose.yml --env-file $ENV_DEV_FILE pull - - docker compose -f auth-domain/docker-compose.yml --env-file $ENV_DEV_FILE up -d - - docker compose -f auth-domain/docker-compose.yml --env-file $ENV_DEV_FILE exec usermanager-api python manage.py recreate_db - - docker compose -f auth-domain/docker-compose.yml --env-file $ENV_DEV_FILE exec usermanager-api python manage.py seed_db + - docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down + - docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull + - docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d + - docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE exec usermanager-api python manage.py recreate_db + - docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE exec usermanager-api python manage.py seed_db - export API_IMAGE=$SUBSCRIPTION_TEST_IMAGE_NAME - - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE down - - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE pull - - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE up -d - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_DEV_FILE down - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_DEV_FILE pull - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit + - docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down + - docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull + - docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d + - docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE down + - docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull + - docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit .test-integration-clean: &test-integration-clean - export $(cat context.env | xargs) - export API_IMAGE=${FLIGHTS_INFO_TEST_IMAGE_NAME} - - docker compose -f flights-domain/docker-compose.yml --env-file $ENV_DEV_FILE down + - docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down - export API_IMAGE=${USER_MANAGER_TEST_IMAGE_NAME} - - docker compose -f auth-domain/docker-compose.yml --env-file $ENV_DEV_FILE down + - docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down - export API_IMAGE=${SUBSCRIPTION_TEST_IMAGE_NAME} - - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE down + - docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down - export API_IMAGE=${GATEWAY_TEST_IMAGE_NAME} - - docker compose -f gateway/docker-compose.yml --env-file $ENV_DEV_FILE down + - docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE down test-browser-integration: stage: test @@ -405,34 +405,34 @@ deliver-dockerhub: - job: preparation artifacts: true -build-and-run-elk: - extends: - - .build - rules: - - changes: - - observability/**/* - script: - - export ELK_SETUP_IMAGE=${IMAGE_BASE}/elasticsearch:prod - - export ELASTICSEARCH_IMAGE=${IMAGE_BASE}/elk-setup:prod - - export LOGSTASH_IMAGE=${IMAGE_BASE}/heartbeat:prod - - export KIBANA_IMAGE=${IMAGE_BASE}/kibana:prod - - export CURATOR_IMAGE=${IMAGE_BASE}/curator:prod - - export HEARTBEAT_IMAGE=${IMAGE_BASE}/logstash:prod - - export ELK=observability/elk +# TODO: remove, it doesn't make sense for this to be in the pipeline... +# build-and-run-elk: +# extends: +# - .build +# rules: +# - changes: +# - observability/**/* +# script: +# - export ELK_SETUP_IMAGE=${IMAGE_BASE}/elasticsearch:prod +# - export ELASTICSEARCH_IMAGE=${IMAGE_BASE}/elk-setup:prod +# - export LOGSTASH_IMAGE=${IMAGE_BASE}/heartbeat:prod +# - export KIBANA_IMAGE=${IMAGE_BASE}/kibana:prod +# - export CURATOR_IMAGE=${IMAGE_BASE}/curator:prod +# - export HEARTBEAT_IMAGE=${IMAGE_BASE}/logstash:prod +# - export ELK=observability/elk - - docker build $ELK/setup -f $ELK/setup/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${ELK_SETUP_IMAGE} - - docker build $ELK/elasticsearch -f $ELK/elasticsearch/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${ELASTICSEARCH_IMAGE} - - docker build $ELK/logstash -f $ELK/logstash/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${LOGSTASH_IMAGE} - - docker build $ELK/kibana -f $ELK/kibana/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${KIBANA_IMAGE} - - docker build $ELK/extensions/curator -f $ELK/extensions/curator/Dockerfile -t ${CURATOR_IMAGE} - - docker build $ELK/extensions/heartbeat -f $ELK/extensions/heartbeat/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${HEARTBEAT_IMAGE} +# - docker build $ELK/setup -f $ELK/setup/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${ELK_SETUP_IMAGE} +# - docker build $ELK/elasticsearch -f $ELK/elasticsearch/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${ELASTICSEARCH_IMAGE} +# - docker build $ELK/logstash -f $ELK/logstash/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${LOGSTASH_IMAGE} +# - docker build $ELK/kibana -f $ELK/kibana/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${KIBANA_IMAGE} +# - docker build $ELK/extensions/curator -f $ELK/extensions/curator/Dockerfile -t ${CURATOR_IMAGE} +# - docker build $ELK/extensions/heartbeat -f $ELK/extensions/heartbeat/Dockerfile --build-arg "ELASTIC_VERSION=8.7.1" -t ${HEARTBEAT_IMAGE} - - docker compose -f observability/docker-compose.yml --env-file $ENV_DEV_FILE --profile setup up -d - - docker compose -f observability/docker-compose.yml -f $ELK/extensions/curator/curator-compose.yml -f $ELK/extensions/heartbeat/heartbeat-compose.yml --env-file $ENV_DEV_FILE up -d +# - docker compose -f observability/docker-compose.yml --env-file $ENV_DEV_FILE --profile setup up -d +# - docker compose -f observability/docker-compose.yml -f $ELK/extensions/curator/curator-compose.yml -f $ELK/extensions/heartbeat/heartbeat-compose.yml --env-file $ENV_DEV_FILE up -d .stop-and-run: &stop-and-run - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_PROD_FILE stop - - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_PROD_FILE rm -f + - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_PROD_FILE down - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_PROD_FILE pull - docker compose -f ${FOLDER}/docker-compose.yml --env-file $ENV_PROD_FILE up -d diff --git a/browser-domain/docker-compose.dev.yml b/browser-domain/docker-compose.dev.yml new file mode 100644 index 0000000..52f0d07 --- /dev/null +++ b/browser-domain/docker-compose.dev.yml @@ -0,0 +1,9 @@ +version: '3.8' + +services: + browser-client-dev: + extends: + file: docker-template.yml + service: browser-client + container_name: fids_browser_client_dev + network_mode: host diff --git a/browser-domain/docker-compose.yml b/browser-domain/docker-compose.yml index 9218174..1f29d85 100644 --- a/browser-domain/docker-compose.yml +++ b/browser-domain/docker-compose.yml @@ -1,11 +1,8 @@ version: '3.8' services: - client: - container_name: fids_browser_client - image: ${CLIENT_IMAGE} - restart: always - environment: - - API_HOST=api - - TEST_TARGET=${TEST_TARGET} + browser-client: + extends: + file: docker-template.yml + service: browser-client network_mode: host diff --git a/browser-domain/docker-template.yml b/browser-domain/docker-template.yml new file mode 100644 index 0000000..a75879b --- /dev/null +++ b/browser-domain/docker-template.yml @@ -0,0 +1,8 @@ +version: '3.8' + +services: + browser-client: + container_name: fids_browser_client + image: ${CLIENT_IMAGE} + environment: + - TEST_TARGET=${TEST_TARGET} diff --git a/screen-domain/docker-compose.dev.yml b/screen-domain/docker-compose.dev.yml new file mode 100644 index 0000000..162330b --- /dev/null +++ b/screen-domain/docker-compose.dev.yml @@ -0,0 +1,9 @@ +version: '3.8' + +services: + screens-client-dev: + extends: + file: docker-template.yml + service: screens-client + container_name: fids_screens_client_dev + network_mode: host diff --git a/screen-domain/docker-compose.yml b/screen-domain/docker-compose.yml index 9a288b3..bee3886 100644 --- a/screen-domain/docker-compose.yml +++ b/screen-domain/docker-compose.yml @@ -2,10 +2,7 @@ version: '3.8' services: screens-client: - container_name: fids_screens_client - image: ${CLIENT_IMAGE} - restart: always - environment: - - API_HOST=api - - TEST_TARGET=${TEST_TARGET} + extends: + file: docker-template.yml + service: screens-client network_mode: host diff --git a/screen-domain/docker-template.yml b/screen-domain/docker-template.yml new file mode 100644 index 0000000..2b70e9a --- /dev/null +++ b/screen-domain/docker-template.yml @@ -0,0 +1,8 @@ +version: '3.8' + +services: + screens-client: + container_name: fids_screens_client + image: ${CLIENT_IMAGE} + environment: + - TEST_TARGET=${TEST_TARGET}