Update pipeline

This commit is contained in:
Santiago Lo Coco 2023-11-04 21:44:35 -03:00
parent 37327ed331
commit d12261f940
7 changed files with 89 additions and 61 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,8 @@
version: '3.8'
services:
browser-client:
container_name: fids_browser_client
image: ${CLIENT_IMAGE}
environment:
- TEST_TARGET=${TEST_TARGET}

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,8 @@
version: '3.8'
services:
screens-client:
container_name: fids_screens_client
image: ${CLIENT_IMAGE}
environment:
- TEST_TARGET=${TEST_TARGET}