[Buildkite] Adjust CI bypasses (#804)

pull/806/head^2
Amir Zarrinkafsh 2020-04-01 09:44:57 +11:00 committed by GitHub
parent 6652d53b8b
commit 6128081e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 31 deletions

View File

@ -0,0 +1,8 @@
<h4>Bypass Build</h4>
<dl class="flex flex-wrap mxn1">
<div class="m1">
<dd>
CI/CD steps have been skipped as this build will not affect code.
</dd>
</div>
</dl>

View File

@ -1,8 +0,0 @@
<h4>Documentation Build</h4>
<dl class="flex flex-wrap mxn1">
<div class="m1">
<dd>
CI/CD steps have been skipped as this build only affects documentation.
</dd>
</div>
</dl>

View File

@ -6,34 +6,34 @@ DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
if [[ $DIVERGED -eq 0 ]]; then if [[ $DIVERGED -eq 0 ]]; then
if [[ $BUILDKITE_TAG == "" ]]; then if [[ $BUILDKITE_TAG == "" ]]; then
if [[ $BUILDKITE_BRANCH == "master" ]]; then if [[ $BUILDKITE_BRANCH == "master" ]]; then
CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
else else
CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) 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)
fi fi
else else
CI_DOCS_BYPASS="false" CI_BYPASS="false"
fi fi
else else
CI_DOCS_BYPASS="false" CI_BYPASS="false"
fi fi
cat << EOF cat << EOF
env: env:
CI_DOCS_BYPASS: ${CI_DOCS_BYPASS} CI_BYPASS: ${CI_BYPASS}
steps: steps:
- label: ":docker: Image Deployments" - label: ":docker: Image Deployments"
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload" command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
concurrency: 1 concurrency: 1
concurrency_group: "deployments" concurrency_group: "deployments"
if: build.branch == "master" && build.env("CI_DOCS_BYPASS") != "true" if: build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":docker: Image Deployments" - label: ":docker: Image Deployments"
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload" command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
if: build.branch != "master" && build.env("CI_DOCS_BYPASS") != "true" if: build.branch != "master" && build.env("CI_BYPASS") != "true"
- wait: - wait:
if: build.env("CI_DOCS_BYPASS") != "true" if: build.env("CI_BYPASS") != "true"
- label: ":docker: Deploy Manifests" - label: ":docker: Deploy Manifests"
command: "authelia-scripts docker push-manifest" command: "authelia-scripts docker push-manifest"
@ -41,13 +41,13 @@ steps:
concurrency_group: "deployments" concurrency_group: "deployments"
env: env:
DOCKER_CLI_EXPERIMENTAL: "enabled" DOCKER_CLI_EXPERIMENTAL: "enabled"
if: build.branch == "master" && build.env("CI_DOCS_BYPASS") != "true" if: build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":docker: Deploy Manifests" - label: ":docker: Deploy Manifests"
command: "authelia-scripts docker push-manifest" command: "authelia-scripts docker push-manifest"
env: env:
DOCKER_CLI_EXPERIMENTAL: "enabled" DOCKER_CLI_EXPERIMENTAL: "enabled"
if: build.branch != "master" && build.env("CI_DOCS_BYPASS") != "true" if: build.branch != "master" && build.env("CI_BYPASS") != "true"
- label: ":github: Deploy Artifacts" - label: ":github: Deploy Artifacts"
command: "ghartifacts.sh" command: "ghartifacts.sh"
@ -62,7 +62,7 @@ steps:
- label: ":linux: Deploy AUR" - label: ":linux: Deploy AUR"
command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload" command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload"
depends_on: ~ depends_on: ~
if: build.tag != null || build.branch == "master" && build.env("CI_DOCS_BYPASS") != "true" if: build.tag != null || build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":book: Deploy Documentation" - label: ":book: Deploy Documentation"
command: "syncdoc.sh" command: "syncdoc.sh"

View File

@ -6,44 +6,44 @@ DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
if [[ $DIVERGED -eq 0 ]]; then if [[ $DIVERGED -eq 0 ]]; then
if [[ $BUILDKITE_TAG == "" ]]; then if [[ $BUILDKITE_TAG == "" ]]; then
if [[ $BUILDKITE_BRANCH == "master" ]]; then if [[ $BUILDKITE_BRANCH == "master" ]]; then
CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
else else
CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) 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)
fi fi
if [[ $CI_DOCS_BYPASS == "true" ]]; then if [[ $CI_BYPASS == "true" ]]; then
cat .buildkite/annotations/documentation | buildkite-agent annotate --style "info" --context "ctx-info" cat .buildkite/annotations/bypass | buildkite-agent annotate --style "info" --context "ctx-info"
fi fi
else else
CI_DOCS_BYPASS="false" CI_BYPASS="false"
fi fi
else else
CI_DOCS_BYPASS="false" CI_BYPASS="false"
fi fi
cat << EOF cat << EOF
env: env:
CI_DOCS_BYPASS: ${CI_DOCS_BYPASS} CI_BYPASS: ${CI_BYPASS}
steps: steps:
- label: ":hammer_and_wrench: Unit Test" - label: ":hammer_and_wrench: Unit Test"
command: "authelia-scripts --log-level debug ci" command: "authelia-scripts --log-level debug ci"
if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_DOCS_BYPASS") != "true" if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
- wait: - wait:
if: build.env("CI_DOCS_BYPASS") != "true" if: build.env("CI_BYPASS") != "true"
- label: ":docker: Image Builds" - label: ":docker: Image Builds"
command: ".buildkite/steps/buildimages.sh | buildkite-agent pipeline upload" command: ".buildkite/steps/buildimages.sh | buildkite-agent pipeline upload"
depends_on: ~ depends_on: ~
if: build.env("CI_DOCS_BYPASS") != "true" if: build.env("CI_BYPASS") != "true"
- wait: - wait:
if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_DOCS_BYPASS") != "true" if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
- label: ":chrome: Integration Tests" - label: ":chrome: Integration Tests"
command: ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload" command: ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload"
depends_on: depends_on:
- "build-docker-amd64" - "build-docker-amd64"
if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_DOCS_BYPASS") != "true" if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
EOF EOF