From 87550d1957b7f92c0a3d567f905d4854e050c2c9 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Sat, 7 Aug 2021 10:06:42 +1000 Subject: [PATCH] ci(buildkite): add [skip-test] and [test-skip] conditionals (#2265) If a commit message includes either `[skip-test]` or `[test-skip]` a some CI steps will be ignored. This is to allow rapid deployments and prototyping when attempting fixes, under no circumstances should any PR to master be accepted with said tags/conditionals. --- .buildkite/pipeline.sh | 10 +++++----- .buildkite/steps/buildimages.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index 88b9c3bac..6aada3d68 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -30,7 +30,7 @@ steps: command: "reviewdog -reporter=github-check -filter-mode=nofilter -fail-on-error" retry: automatic: true - if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ + if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.message !~ /\[(skip test|test skip)\]/ - label: ":hammer_and_wrench: Unit Test" command: "authelia-scripts --log-level debug ci --buildkite" @@ -67,7 +67,7 @@ steps: if: build.env("CI_BYPASS") != "true" - wait: - if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" + if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" && build.message !~ /\[(skip test|test skip)\]/ - label: ":chrome: Integration Tests" command: ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload" @@ -75,14 +75,14 @@ steps: concurrency_group: "tests" depends_on: - "build-docker-linux-coverage" - if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" + if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" && build.message !~ /\[(skip test|test skip)\]/ - wait: - if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" + if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" && build.message !~ /\[(skip test|test skip)\]/ - label: ":vertical_traffic_light: Test Concurrency Gate" command: "echo End of concurrency gate" concurrency: 3 concurrency_group: "tests" - if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" + if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" && build.message !~ /\[(skip test|test skip)\]/ EOF \ No newline at end of file diff --git a/.buildkite/steps/buildimages.sh b/.buildkite/steps/buildimages.sh index 53d5cf68c..00d40ab00 100755 --- a/.buildkite/steps/buildimages.sh +++ b/.buildkite/steps/buildimages.sh @@ -29,7 +29,7 @@ cat << EOF EOF if [[ "${BUILD_ARCH}" == "coverage" ]]; then cat << EOF - if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ + if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.message !~ /\[(skip test|test skip)\]/ EOF else cat << EOF