authelia/.buildkite/deployment.sh
Amir Zarrinkafsh 93e20a44e9
feat: build and distribute .deb packages (#2114)
* feat: build and distribute .deb packages

Creates .deb packages for distribution via GitHub releases and Buildkite builds for the following architectures:

* amd64
* armhf
* arm64

* fix: pkgver reference in debpackages.sh

* refactor: split deb packaging jobs and quote variables

* fix: pipeline upload for debpackages

* fix: depends_on key for debpackages

* fix: add depends_on: ~ for debpackages step

* fix: pre-artifact hook for debpackages

* fix: add .deb suffix in pre-artifact hook

* fix: variable reference in debhelper.sh

* refactor: silence wget output in debhelper.sh

* refactor: make build concurrency gate only depend_on docker builds

* refactor: make build concurrency gate also depend_on coverage build

* refactor: remove dependencies for build concurrency gate
2021-06-26 11:45:21 +10:00

67 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
set -u
DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
if [[ "${DIVERGED}" == 0 ]]; then
if [[ "${BUILDKITE_TAG}" == "" ]]; then
if [[ "${BUILDKITE_BRANCH}" == "master" ]]; then
CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
else
CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
fi
else
CI_BYPASS="false"
fi
else
CI_BYPASS="false"
fi
cat << EOF
env:
CI_BYPASS: ${CI_BYPASS}
steps:
- label: ":docker: Image Deployments"
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
if: build.env("CI_BYPASS") != "true"
- wait:
if: build.env("CI_BYPASS") != "true"
- label: ":docker: Deploy Manifests"
command: "authelia-scripts docker push-manifest"
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
agents:
upload: "fast"
if: build.env("CI_BYPASS") != "true"
- label: ":github: Deploy Artifacts"
command: "ghartifacts.sh"
depends_on:
- "build-docker-linux-amd64"
- "build-docker-linux-arm32v7"
- "build-docker-linux-arm64v8"
- "build-deb-package-amd64"
- "build-deb-package-armhf"
- "build-deb-package-arm64"
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"
depends_on: ~
if: build.tag != null || build.branch == "master" && build.env("CI_BYPASS") != "true"
- label: ":book: Deploy Documentation"
command: "syncdoc.sh"
depends_on: ~
agents:
upload: "fast"
if: build.branch == "master"
EOF