2020-06-18 07:49:13 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-03-09 01:32:07 +00:00
|
|
|
set -u
|
|
|
|
|
2020-03-21 13:42:29 +00:00
|
|
|
DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
|
|
|
|
|
2021-06-26 01:45:21 +00:00
|
|
|
if [[ "${DIVERGED}" == 0 ]]; then
|
|
|
|
if [[ "${BUILDKITE_TAG}" == "" ]]; then
|
|
|
|
if [[ "${BUILDKITE_BRANCH}" == "master" ]]; then
|
2021-07-30 06:46:06 +00:00
|
|
|
CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(CODE_OF_CONDUCT.md|CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
|
2020-03-21 13:42:29 +00:00
|
|
|
else
|
2021-07-30 06:46:06 +00:00
|
|
|
CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CODE_OF_CONDUCT.md|CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
|
2020-03-21 13:42:29 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-31 22:44:57 +00:00
|
|
|
if [[ $CI_BYPASS == "true" ]]; then
|
|
|
|
cat .buildkite/annotations/bypass | buildkite-agent annotate --style "info" --context "ctx-info"
|
2020-03-21 13:42:29 +00:00
|
|
|
fi
|
2020-03-15 10:07:23 +00:00
|
|
|
else
|
2020-03-31 22:44:57 +00:00
|
|
|
CI_BYPASS="false"
|
2020-03-15 10:07:23 +00:00
|
|
|
fi
|
2020-03-15 11:01:52 +00:00
|
|
|
else
|
2020-03-31 22:44:57 +00:00
|
|
|
CI_BYPASS="false"
|
2020-03-10 23:25:47 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-09 01:32:07 +00:00
|
|
|
cat << EOF
|
|
|
|
env:
|
2020-03-31 22:44:57 +00:00
|
|
|
CI_BYPASS: ${CI_BYPASS}
|
2020-03-09 01:32:07 +00:00
|
|
|
|
|
|
|
steps:
|
2020-04-22 13:10:22 +00:00
|
|
|
- label: ":service_dog: Linting"
|
2020-12-03 07:06:42 +00:00
|
|
|
command: "reviewdog -reporter=github-check -filter-mode=nofilter -fail-on-error"
|
2020-04-29 02:30:46 +00:00
|
|
|
retry:
|
|
|
|
automatic: true
|
|
|
|
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/
|
2020-04-22 13:10:22 +00:00
|
|
|
|
2020-03-09 01:32:07 +00:00
|
|
|
- label: ":hammer_and_wrench: Unit Test"
|
2021-06-25 11:53:20 +00:00
|
|
|
command: "authelia-scripts --log-level debug ci --buildkite"
|
2021-02-22 03:24:01 +00:00
|
|
|
agents:
|
|
|
|
build: "unit-test"
|
2020-04-28 14:07:20 +00:00
|
|
|
artifact_paths:
|
|
|
|
- "authelia-public_html.tar.gz"
|
|
|
|
- "authelia-public_html.tar.gz.sha256"
|
2021-01-03 04:28:46 +00:00
|
|
|
key: "unit-test"
|
2020-05-02 01:41:53 +00:00
|
|
|
if: build.env("CI_BYPASS") != "true"
|
2020-03-09 01:32:07 +00:00
|
|
|
|
|
|
|
- wait:
|
2020-03-31 22:44:57 +00:00
|
|
|
if: build.env("CI_BYPASS") != "true"
|
2020-03-09 01:32:07 +00:00
|
|
|
|
|
|
|
- label: ":docker: Image Builds"
|
|
|
|
command: ".buildkite/steps/buildimages.sh | buildkite-agent pipeline upload"
|
2021-02-22 00:13:51 +00:00
|
|
|
concurrency: 3
|
|
|
|
concurrency_group: "builds"
|
2020-03-09 01:32:07 +00:00
|
|
|
depends_on: ~
|
2020-03-31 22:44:57 +00:00
|
|
|
if: build.env("CI_BYPASS") != "true"
|
2020-03-09 01:32:07 +00:00
|
|
|
|
2021-06-26 01:45:21 +00:00
|
|
|
- label: ":debian: Package Builds"
|
|
|
|
command: ".buildkite/steps/debpackages.sh | buildkite-agent pipeline upload"
|
|
|
|
depends_on: ~
|
2021-06-27 03:58:58 +00:00
|
|
|
if: build.branch !~ /^(dependabot|renovate)\/.*/ && build.env("CI_BYPASS") != "true"
|
2021-06-26 01:45:21 +00:00
|
|
|
|
|
|
|
- wait:
|
|
|
|
if: build.env("CI_BYPASS") != "true"
|
|
|
|
|
|
|
|
- label: ":vertical_traffic_light: Build Concurrency Gate"
|
|
|
|
command: "echo End of concurrency gate"
|
|
|
|
concurrency: 3
|
|
|
|
concurrency_group: "builds"
|
|
|
|
if: build.env("CI_BYPASS") != "true"
|
|
|
|
|
2020-03-09 01:32:07 +00:00
|
|
|
- wait:
|
2020-07-02 06:56:45 +00:00
|
|
|
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
|
2020-03-09 01:32:07 +00:00
|
|
|
|
|
|
|
- label: ":chrome: Integration Tests"
|
|
|
|
command: ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload"
|
2021-02-22 00:13:51 +00:00
|
|
|
concurrency: 3
|
|
|
|
concurrency_group: "tests"
|
2020-03-09 01:32:07 +00:00
|
|
|
depends_on:
|
2020-06-05 00:43:19 +00:00
|
|
|
- "build-docker-linux-coverage"
|
2020-07-02 06:56:45 +00:00
|
|
|
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
|
2021-06-26 01:45:21 +00:00
|
|
|
|
|
|
|
- wait:
|
|
|
|
if: build.env("CI_BYPASS") != "true"
|
|
|
|
|
|
|
|
- label: ":vertical_traffic_light: Test Concurrency Gate"
|
|
|
|
command: "echo End of concurrency gate"
|
|
|
|
concurrency: 3
|
|
|
|
concurrency_group: "tests"
|
|
|
|
if: build.env("CI_BYPASS") != "true"
|
2020-04-03 05:13:24 +00:00
|
|
|
EOF
|