56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
|
stages:
|
||
|
- build
|
||
|
- release
|
||
|
- deploy
|
||
|
|
||
|
variables:
|
||
|
# CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
||
|
# CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
|
||
|
DOCKER_DRIVER: overlay2
|
||
|
IMAGE_PATH: $CI_REGISTRY/$CI_PROJECT_PATH
|
||
|
|
||
|
before_script:
|
||
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||
|
- mkdir -p .ci_status
|
||
|
|
||
|
.dedicated-runner: &dedicated-runner
|
||
|
tags:
|
||
|
- build1-shell
|
||
|
|
||
|
dns_check_build:
|
||
|
<<: *dedicated-runner
|
||
|
stage: build
|
||
|
script:
|
||
|
- DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build dns_check
|
||
|
- docker push $IMAGE_PATH/dns_records_check:dev
|
||
|
- touch .ci_status/dns_check_build
|
||
|
only:
|
||
|
refs:
|
||
|
- master
|
||
|
changes:
|
||
|
- ./*/*.json
|
||
|
- ./*/*.xml
|
||
|
- Dockerfile
|
||
|
- *.sh
|
||
|
- docker-compose.yml
|
||
|
artifacts:
|
||
|
paths:
|
||
|
- .ci_status/
|
||
|
|
||
|
dns_check_release:
|
||
|
<<: *dedicated-runner
|
||
|
stage: release
|
||
|
script:
|
||
|
- if [ -e .ci_status/dns_check_build ]; then docker pull $IMAGE_PATH/dns_records_check:dev; docker tag $IMAGE_PATH/dns_records_check:dev $IMAGE_PATH/dns_records_check:latest; docker push $IMAGE_PATH/dns_records_check:latest; touch .ci_status/dns_check_release; fi
|
||
|
artifacts:
|
||
|
paths:
|
||
|
- .ci_status/
|
||
|
|
||
|
dns_check_deploy:
|
||
|
<<: *dedicated-runner
|
||
|
stage: deploy
|
||
|
script:
|
||
|
- if [ -e .ci_status/dns_check_release ]; then docker-compose up -d --no-deps --build dns_check; fi
|
||
|
|
||
|
|
||
|
|