2020-03-09 01:32:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -u
|
|
|
|
|
2020-03-15 10:07:23 +00:00
|
|
|
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
|
2020-03-09 06:45:15 +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
|
|
|
|
2020-01-31 04:16:46 +00:00
|
|
|
steps:
|
|
|
|
- label: ":docker: Image Deployments"
|
|
|
|
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
|
|
|
|
concurrency: 1
|
|
|
|
concurrency_group: "deployments"
|
2020-03-09 01:32:07 +00:00
|
|
|
if: build.branch == "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-02-29 14:31:10 +00:00
|
|
|
|
|
|
|
- label: ":docker: Image Deployments"
|
|
|
|
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
|
2020-03-15 03:48:18 +00:00
|
|
|
if: build.branch != "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-01-31 04:16:46 +00:00
|
|
|
|
2020-03-09 01:32:07 +00:00
|
|
|
- wait:
|
2020-03-15 03:48:18 +00:00
|
|
|
if: build.env("CI_DOCS_BYPASS") != "true"
|
2020-01-31 04:16:46 +00:00
|
|
|
|
|
|
|
- label: ":docker: Deploy Manifests"
|
|
|
|
command: "authelia-scripts docker push-manifest"
|
|
|
|
concurrency: 1
|
|
|
|
concurrency_group: "deployments"
|
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
2020-03-09 01:32:07 +00:00
|
|
|
if: build.branch == "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-02-29 14:31:10 +00:00
|
|
|
|
|
|
|
- label: ":docker: Deploy Manifests"
|
|
|
|
command: "authelia-scripts docker push-manifest"
|
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
2020-03-15 03:48:18 +00:00
|
|
|
if: build.branch != "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-01-31 04:16:46 +00:00
|
|
|
|
|
|
|
- label: ":github: Deploy Artifacts"
|
2020-02-29 00:43:59 +00:00
|
|
|
command: "ghartifacts.sh"
|
2020-02-29 14:31:10 +00:00
|
|
|
depends_on: ~
|
2020-02-28 21:58:44 +00:00
|
|
|
retry:
|
|
|
|
automatic: true
|
2020-01-31 04:16:46 +00:00
|
|
|
agents:
|
|
|
|
upload: "fast"
|
2020-02-19 23:25:28 +00:00
|
|
|
key: "artifacts"
|
|
|
|
if: build.tag != null
|
|
|
|
|
|
|
|
- label: ":linux: Deploy AUR"
|
|
|
|
command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload"
|
2020-02-29 14:31:10 +00:00
|
|
|
depends_on: ~
|
2020-03-09 01:32:07 +00:00
|
|
|
if: build.tag != null || build.branch == "master" && build.env("CI_DOCS_BYPASS") != "true"
|
2020-02-29 00:43:59 +00:00
|
|
|
|
2020-02-29 05:15:03 +00:00
|
|
|
- label: ":book: Deploy Documentation"
|
2020-02-29 00:43:59 +00:00
|
|
|
command: "syncdoc.sh"
|
2020-02-29 14:31:10 +00:00
|
|
|
depends_on: ~
|
2020-02-29 00:43:59 +00:00
|
|
|
agents:
|
|
|
|
upload: "fast"
|
|
|
|
if: build.branch == "master"
|
2020-03-09 01:32:07 +00:00
|
|
|
EOF
|