Commit 361e1aab authored by Michał Kępień's avatar Michał Kępień
Browse files

Improve CI job triggering rules

  - Automatically start jobs for all images potentially affected by a
    Dockerfile template change or a Packer source file modification.
    The rationale here is that most meaningful changes to image contents
    happen through modifications to Dockerfile templates and Packer
    source files while Makefile updates are rare (and starting all
    relevant jobs when a Makefile is modified would be reckless).

  - Allow all jobs to be run (on demand) for pipelines created through
    the web interface.  This allows any build job to be tested before
    merging a branch which modifies Makefile(s) but does not touch any
    Dockerfile templates or Packer source files (since Makefile changes
    alone do not trigger build jobs).

  - Automatically push rebuilt images to the production Docker registry
    when a branch is merged into "master".  Propagating changes
    introduced by branches which only touch Makefile(s) will require
    creating a pipeline for the "master" branch using the web interface,
    but that is expected to be needed rarely.

  - Ensure scheduled build jobs are still run automatically.
parent 8ddcd2cb
......@@ -36,11 +36,6 @@ stages:
.image_job: &image_job
services:
- docker:dind
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- when: manual
allow_failure: true
before_script:
# Since IPv6 is not configured properly for containers running these jobs,
# remove the default IPv6 route first to prevent IPv6-related connection
......@@ -82,6 +77,15 @@ alpine:3.11:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/alpine-template/*
when: always
centos:6:amd64:docker:
stage: images
......@@ -91,6 +95,15 @@ centos:6:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/centos-template/*
when: always
centos:7:amd64:docker:
stage: images
......@@ -100,6 +113,15 @@ centos:7:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/centos-template/*
when: always
centos:8:amd64:docker:
stage: images
......@@ -109,6 +131,15 @@ centos:8:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/centos-template/*
when: always
centos:6:amd64:packer:
stage: images
......@@ -120,6 +151,15 @@ centos:6:amd64:packer:
ISO_CHECKSUM: 7c0dee2a0494dabd84809b72ddb4b761f9ef92b78a506aef709b531c54d30770
<<: *linux_amd64
<<: *kvm_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- packer/centos/*
when: always
centos:7:amd64:packer:
stage: images
......@@ -131,6 +171,15 @@ centos:7:amd64:packer:
ISO_CHECKSUM: 9a2c47d97b9975452f7d582264e9fc16d108ed8252ac6816239a3b58cef5c53d
<<: *linux_amd64
<<: *kvm_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- packer/centos/*
when: always
centos:8:amd64:packer:
stage: images
......@@ -142,6 +191,15 @@ centos:8:amd64:packer:
ISO_CHECKSUM: 7fea13202bf2f26989df4175aace8fdc16e1137f7961c33512cbfad844008948
<<: *linux_amd64
<<: *kvm_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- packer/centos/*
when: always
fedora:31:amd64:docker:
stage: images
......@@ -151,6 +209,15 @@ fedora:31:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/fedora-template/*
when: always
debian:stretch:amd64:docker:
stage: images
......@@ -160,6 +227,15 @@ debian:stretch:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
debian:buster:amd64:docker:
stage: images
......@@ -169,6 +245,15 @@ debian:buster:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
debian:sid:amd64:docker:
stage: images
......@@ -179,6 +264,15 @@ debian:sid:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
debian:sid:arm64:docker:
image: arm64v8/docker:latest
......@@ -191,6 +285,15 @@ debian:sid:arm64:docker:
ARCHS: arm64
<<: *linux_arm64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
ubuntu:xenial:amd64:docker:
stage: images
......@@ -200,6 +303,15 @@ ubuntu:xenial:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/ubuntu-template/*
when: always
ubuntu:bionic:amd64:docker:
stage: images
......@@ -209,6 +321,15 @@ ubuntu:bionic:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/ubuntu-template/*
when: always
debian:stretch:i386:docker:
stage: images
......@@ -218,6 +339,15 @@ debian:stretch:i386:docker:
ARCHS: i386
<<: *linux_i386
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
debian:buster:i386:docker:
stage: images
......@@ -227,6 +357,15 @@ debian:buster:i386:docker:
ARCHS: i386
<<: *linux_i386
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
debian:sid:i386:docker:
stage: images
......@@ -237,6 +376,15 @@ debian:sid:i386:docker:
ARCHS: i386
<<: *linux_i386
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/debian-template/*
when: always
# openSUSE Tumbleweed is a rolling release distribution,
# which has only one version "latest".
......@@ -249,6 +397,15 @@ tumbleweed:latest:amd64:docker:
ARCHS: amd64
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/tumbleweed-template/*
when: always
ubuntu:xenial:i386:docker:
stage: images
......@@ -258,6 +415,15 @@ ubuntu:xenial:i386:docker:
ARCHS: i386
<<: *linux_i386
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/ubuntu-template/*
when: always
ubuntu:bionic:i386:docker:
stage: images
......@@ -267,6 +433,15 @@ ubuntu:bionic:i386:docker:
ARCHS: i386
<<: *linux_i386
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/bind9/ubuntu-template/*
when: always
packager:rpm:docker:
stage: images
......@@ -274,6 +449,15 @@ packager:rpm:docker:
TARGET: packager-rpm
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/packager/rpm/*
when: always
website:rsync_ssh_curl:docker:
stage: images
......@@ -281,6 +465,15 @@ website:rsync_ssh_curl:docker:
TARGET: website-rsync_ssh_curl
<<: *linux_amd64
<<: *docker_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- docker/website/rsync_ssh_curl/*
when: always
freebsd:11.3:amd64:packer:
stage: images
......@@ -292,6 +485,15 @@ freebsd:11.3:amd64:packer:
ISO_CHECKSUM: d268db365e26305ec3d51b29211caad903749c33a4a8f2cf661d671f8e0ba0b0
<<: *linux_amd64
<<: *kvm_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- packer/freebsd/*
when: always
freebsd:12.1:amd64:packer:
stage: images
......@@ -303,6 +505,15 @@ freebsd:12.1:amd64:packer:
ISO_CHECKSUM: aa9d34b458826486999ed3e872436b6712ae38cede5ea41de4ab923e3419d461
<<: *linux_amd64
<<: *kvm_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- packer/freebsd/*
when: always
openbsd:6.6:amd64:packer:
stage: images
......@@ -314,3 +525,12 @@ openbsd:6.6:amd64:packer:
ISO_CHECKSUM: b22e63df56e6266de6bbeed8e9be0fbe9ee2291551c5bc03f3cc2e4ab9436ee3
<<: *linux_amd64
<<: *kvm_image_job
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "schedule" && $REBUILD_PERIODICALLY == "yes"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- packer/openbsd/*
when: always
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment