Skip to content
Snippets Groups Projects
Verified Commit 6d4446d1 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

move when: to rules:

TRIGGER_JOBS=ci-test-image-build
parent 5a8ff4ae
No related branches found
No related tags found
No related merge requests found
......@@ -59,19 +59,6 @@ include:
- if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-/'
- if: '$CI_COMMIT_BRANCH == "master"'
.ci_test_image_build_rules:
rules:
# Automatically rebuild the container image if this file, the Dockerfile,
# the installed requirements or the kaniko template change
- changes:
- Dockerfile
- requirements.txt
- .gitlab/ci_templates/kaniko.yml
# Also rebuild when the CI variable contain this jobs name
# or commit msg contains /TRIGGER_JOBS=.*ci-test-image-build/
- if: '$TRIGGER_JOBS =~ /ci-test-image-build/'
- if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*ci-test-image-build/'
# app rules
#
# Define the rules when/if app specific jobs are run.
......@@ -241,9 +228,19 @@ ci-test-image-build:
url: https://open.greenhost.net:4567/openappstack/openappstack/openappstack-ci:${CI_COMMIT_REF_SLUG}
on_stop: delete-image
auto_stop_in: 3 weeks
rules:
# Automatically rebuild the container image if this file, the Dockerfile,
# the installed requirements or the kaniko template change
- changes:
- Dockerfile
- requirements.txt
- .gitlab/ci_templates/kaniko.yml
# Also rebuild when the CI variable contain this jobs name
# or commit msg contains /TRIGGER_JOBS=.*ci-test-image-build/
- if: '$TRIGGER_JOBS =~ /ci-test-image-build/'
- if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*ci-test-image-build/'
extends:
- .kaniko_build
- .ci_test_image_build_rules
interruptible: true
report-ci-image-tag:
......@@ -722,7 +719,6 @@ terminate-droplet:
# image re-build as well
delete-image:
stage: build
when: manual
needs:
- job: ci-test-image-build
variables:
......@@ -733,5 +729,15 @@ delete-image:
environment:
name: image/$CI_COMMIT_REF_SLUG
action: stop
extends:
- .ci_test_image_build_rules
rules:
# Copy the rules from ci-test-image-build to prevent broken pipelines when
# that job did not run
- changes:
- Dockerfile
- requirements.txt
- .gitlab/ci_templates/kaniko.yml
when: manual
- if: '$TRIGGER_JOBS =~ /ci-test-image-build/'
when: manual
- if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*ci-test-image-build/'
when: manual
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment