diff --git a/.buildkite/annotations/bypass b/.buildkite/annotations/bypass new file mode 100644 index 00000000..b7a22186 --- /dev/null +++ b/.buildkite/annotations/bypass @@ -0,0 +1,8 @@ +

Bypass Build

+
+
+
+ CI/CD steps have been skipped as this build will not affect code. +
+
+
\ No newline at end of file diff --git a/.buildkite/annotations/documentation b/.buildkite/annotations/documentation deleted file mode 100644 index e6cb1da4..00000000 --- a/.buildkite/annotations/documentation +++ /dev/null @@ -1,8 +0,0 @@ -

Documentation Build

-
-
-
- CI/CD steps have been skipped as this build only affects documentation. -
-
-
\ No newline at end of file diff --git a/.buildkite/deployment.sh b/.buildkite/deployment.sh index 15eb1e8e..8e6e898e 100755 --- a/.buildkite/deployment.sh +++ b/.buildkite/deployment.sh @@ -6,34 +6,34 @@ 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) + CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|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) + 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 else - CI_DOCS_BYPASS="false" + CI_BYPASS="false" fi else - CI_DOCS_BYPASS="false" + CI_BYPASS="false" fi cat << EOF env: - CI_DOCS_BYPASS: ${CI_DOCS_BYPASS} + CI_BYPASS: ${CI_BYPASS} steps: - label: ":docker: Image Deployments" command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload" concurrency: 1 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" 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: - if: build.env("CI_DOCS_BYPASS") != "true" + if: build.env("CI_BYPASS") != "true" - label: ":docker: Deploy Manifests" command: "authelia-scripts docker push-manifest" @@ -41,13 +41,13 @@ steps: concurrency_group: "deployments" env: 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" command: "authelia-scripts docker push-manifest" env: 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" command: "ghartifacts.sh" @@ -62,7 +62,7 @@ steps: - label: ":linux: Deploy AUR" command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload" 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" command: "syncdoc.sh" diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index b042b662..8637bf13 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -6,44 +6,44 @@ 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) + CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|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) + 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 - if [[ $CI_DOCS_BYPASS == "true" ]]; then - cat .buildkite/annotations/documentation | buildkite-agent annotate --style "info" --context "ctx-info" + if [[ $CI_BYPASS == "true" ]]; then + cat .buildkite/annotations/bypass | buildkite-agent annotate --style "info" --context "ctx-info" fi else - CI_DOCS_BYPASS="false" + CI_BYPASS="false" fi else - CI_DOCS_BYPASS="false" + CI_BYPASS="false" fi cat << EOF env: - CI_DOCS_BYPASS: ${CI_DOCS_BYPASS} + CI_BYPASS: ${CI_BYPASS} steps: - label: ":hammer_and_wrench: Unit Test" 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: - if: build.env("CI_DOCS_BYPASS") != "true" + if: build.env("CI_BYPASS") != "true" - label: ":docker: Image Builds" command: ".buildkite/steps/buildimages.sh | buildkite-agent pipeline upload" depends_on: ~ - if: build.env("CI_DOCS_BYPASS") != "true" + if: build.env("CI_BYPASS") != "true" - 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" command: ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload" depends_on: - "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