2020-03-09 01:32:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -u
|
|
|
|
|
2020-03-21 13:42:29 +00:00
|
|
|
DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
|
|
|
|
|
|
|
|
if [[ $DIVERGED -eq 0 ]]; then
|
|
|
|
if [[ $BUILDKITE_TAG == "" ]]; then
|
|
|
|
if [[ $BUILDKITE_BRANCH == "master" ]]; then
|
2020-03-31 22:44:57 +00:00
|
|
|
CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
|
2020-03-21 13:42:29 +00:00
|
|
|
else
|
2020-03-31 22:44:57 +00:00
|
|
|
CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|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"
|
|
|
|
command: "reviewdog -reporter=github-check"
|
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"
|
|
|
|
command: "authelia-scripts --log-level debug ci"
|
2020-04-28 14:07:20 +00:00
|
|
|
artifact_paths:
|
|
|
|
- "authelia-public_html.tar.gz"
|
|
|
|
- "authelia-public_html.tar.gz.sha256"
|
2020-03-31 22:44:57 +00:00
|
|
|
if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && 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"
|
|
|
|
depends_on: ~
|
2020-03-31 22:44:57 +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.branch !~ /^(master)|(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"
|
|
|
|
depends_on:
|
2020-04-03 05:13:24 +00:00
|
|
|
- "build-docker-linux-amd64"
|
2020-03-31 22:44:57 +00:00
|
|
|
if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
|
2020-04-03 05:13:24 +00:00
|
|
|
EOF
|