zabbix-helpers/check_email_delivery/.gitlab-ci.yml
2024-11-06 10:16:00 +03:00

59 lines
1.6 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
email_check_build:
<<: *dedicated-runner
stage: build
script:
- DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build email_delivery_check_mail
- docker push $IMAGE_PATH/email_delivery_check:dev
- touch .ci_status/email_check_build
only:
refs:
- master
changes:
- check_email_delivery-0.7.1b/*
- ./*/*.json
- ./*/*.xml
- Dockerfile
- *.sh
- docker-compose.yml
artifacts:
paths:
- .ci_status/
email_check_release:
<<: *dedicated-runner
stage: release
script:
- if [ -e .ci_status/email_check_build ]; then docker pull $IMAGE_PATH/email_delivery_check:dev; docker tag $IMAGE_PATH/email_delivery_check:dev $IMAGE_PATH/email_delivery_check:latest; docker push $IMAGE_PATH/email_delivery_check:latest; touch .ci_status/email_check_release; fi
artifacts:
paths:
- .ci_status/
email_check_deploy:
<<: *dedicated-runner
stage: deploy
script:
- if [ -e .ci_status/email_check_release ]; then docker-compose up -d --no-deps --build email_delivery_check_mail; docker-compose up -d --no-deps --build email_delivery_check_mail2; fi