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
|
|
|
|
CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false)
|
|
|
|
else
|
|
|
|
CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $CI_DOCS_BYPASS == "true" ]]; then
|
|
|
|
cat .buildkite/annotations/documentation | buildkite-agent annotate --style "info" --context "ctx-info"
|
|
|
|
fi
|
2020-03-15 10:07:23 +00:00
|
|
|
else
|
2020-03-21 13:42:29 +00:00
|
|
|
CI_DOCS_BYPASS="false"
|
2020-03-15 10:07:23 +00:00
|
|
|
fi
|
2020-03-15 11:01:52 +00:00
|
|
|
else
|
|
|
|
CI_DOCS_BYPASS="false"
|
2020-03-10 23:25:47 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-09 01:32:07 +00:00
|
|
|
cat << EOF
|
|
|
|
env:
|
2020-03-09 06:45:15 +00:00
|
|
|
CI_DOCS_BYPASS: ${CI_DOCS_BYPASS}
|
2020-03-09 01:32:07 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- label: ":hammer_and_wrench: Unit Test"
|
|
|
|
command: "authelia-scripts --log-level debug ci"
|
2020-03-20 03:03:50 +00:00
|
|
|
if: build.branch != "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-03-09 01:32:07 +00:00
|
|
|
|
|
|
|
- wait:
|
|
|
|
if: build.env("CI_DOCS_BYPASS") != "true"
|
|
|
|
|
|
|
|
- label: ":docker: Image Builds"
|
|
|
|
command: ".buildkite/steps/buildimages.sh | buildkite-agent pipeline upload"
|
|
|
|
depends_on: ~
|
|
|
|
if: build.env("CI_DOCS_BYPASS") != "true"
|
|
|
|
|
|
|
|
- wait:
|
2020-03-20 03:03:50 +00:00
|
|
|
if: build.branch != "master" && build.env("CI_DOCS_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:
|
|
|
|
- "build-docker-amd64"
|
2020-03-20 03:03:50 +00:00
|
|
|
if: build.branch != "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-03-09 01:32:07 +00:00
|
|
|
EOF
|