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