2023-01-10 14:28:19 +00:00
|
|
|
image: docker:20.10.22
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- test
|
2023-02-09 13:20:05 +00:00
|
|
|
- build
|
2023-01-10 14:28:19 +00:00
|
|
|
|
|
|
|
##############
|
|
|
|
# TEST STAGE #
|
|
|
|
##############
|
|
|
|
|
2023-01-11 11:50:04 +00:00
|
|
|
test:
|
2023-01-10 14:28:19 +00:00
|
|
|
stage: test
|
|
|
|
image: docker/compose:latest
|
2023-01-12 11:51:40 +00:00
|
|
|
variables:
|
2023-03-30 08:28:20 +00:00
|
|
|
DOCKER_TLS_CERTDIR: ''
|
2023-01-10 14:28:19 +00:00
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
script:
|
2023-02-09 13:20:05 +00:00
|
|
|
- docker-compose -f docker-compose.ci.tools.yml -p auth-tools --env-file ci/.env.ci up -d
|
2023-01-10 14:28:19 +00:00
|
|
|
- sh ci/wait-up.sh
|
2023-02-09 13:20:05 +00:00
|
|
|
- docker-compose -f docker-compose.ci.service.yml -p auth-service --env-file ci/.env.ci up -d
|
2023-02-28 09:46:03 +00:00
|
|
|
- docker exec -t v3-auth-api sh -c "npm run test:integration:ci"
|
2023-01-10 14:28:19 +00:00
|
|
|
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
|
|
|
|
rules:
|
2023-03-30 08:28:20 +00:00
|
|
|
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
2023-01-10 14:28:19 +00:00
|
|
|
when: always
|
2023-02-09 13:20:05 +00:00
|
|
|
|
|
|
|
###############
|
|
|
|
# BUILD STAGE #
|
|
|
|
###############
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
image: docker:20.10.22
|
|
|
|
variables:
|
2023-03-30 08:28:20 +00:00
|
|
|
DOCKER_TLS_CERTDIR: ''
|
2023-02-09 13:20:05 +00:00
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
|
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
script:
|
|
|
|
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
|
|
|
|
- docker push "$CI_REGISTRY_IMAGE"
|
|
|
|
only:
|
|
|
|
- main
|
|
|
|
when: manual
|