authelia/.buildkite/deployment.sh

77 lines
2.3 KiB
Bash
Raw Normal View History

#!/bin/bash
set -u
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-04-01 05:44:57 +07:00
CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(BREAKING.md|CONTRIBUTING.md|README.md|docs\/.*)/!{q1}' && echo true || echo false)
else
2020-04-01 05:44:57 +07: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)
fi
else
2020-04-01 05:44:57 +07:00
CI_BYPASS="false"
fi
else
2020-04-01 05:44:57 +07:00
CI_BYPASS="false"
fi
cat << EOF
env:
2020-04-01 05:44:57 +07:00
CI_BYPASS: ${CI_BYPASS}
steps:
- label: ":docker: Image Deployments"
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
concurrency: 1
concurrency_group: "deployments"
2020-04-01 05:44:57 +07:00
if: build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":docker: Image Deployments"
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
2020-04-01 05:44:57 +07:00
if: build.branch != "master" && build.env("CI_BYPASS") != "true"
- wait:
2020-04-01 05:44:57 +07:00
if: build.env("CI_BYPASS") != "true"
- label: ":docker: Deploy Manifests"
command: "authelia-scripts docker push-manifest"
concurrency: 1
concurrency_group: "deployments"
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
2020-04-01 05:44:57 +07:00
if: build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":docker: Deploy Manifests"
command: "authelia-scripts docker push-manifest"
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
2020-04-01 05:44:57 +07:00
if: build.branch != "master" && build.env("CI_BYPASS") != "true"
- label: ":github: Deploy Artifacts"
command: "ghartifacts.sh"
depends_on: ~
retry:
automatic: true
agents:
upload: "fast"
key: "artifacts"
if: build.tag != null
- label: ":linux: Deploy AUR"
command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload"
concurrency: 1
concurrency_group: "aur"
depends_on: ~
2020-04-01 05:44:57 +07:00
if: build.tag != null || build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":book: Deploy Documentation"
command: "syncdoc.sh"
concurrency: 1
concurrency_group: "documentation"
depends_on: ~
agents:
upload: "fast"
if: build.branch == "master"
EOF