authelia/.buildkite/deployment.sh
Amir Zarrinkafsh 92ec00d7c5
feat: builds with gox and buildx (#2381)
* feat: builds with gox and buildx

This change builds all of Authelia respective binaries in parallel within a single step and distributes as necessary to subsequent steps, we now also build and distribute for the following OS/Architecture: freebsd/amd64.

Our CI/CD pipeline now also utilises docker buildx as a default for builds and pushes.

* refactor: clean up docker helper

* Remove `authelia-scripts docker push-image` command as all pushes will be performed with buildx and manifests
* Rename the --arch flag to --container
* Add Dockerfile.dev for users that want to build an Authelia container from source without utilising suites
* Set Dockerfile.dev as default for `authelia-scripts docker build` command

* refactor: variant -> container
2021-09-16 22:39:18 +10:00

71 lines
2.0 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 '/^(CODE_OF_CONDUCT.md|CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*|examples\/.*)/!{q1}' && echo true || echo false)
else
CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CODE_OF_CONDUCT.md|CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*|examples\/.*)/!{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: Deploy Manifest"
command: "authelia-scripts docker push-manifest"
depends_on:
- "unit-test"
retry:
manual:
permit_on_passed: true
agents:
upload: "fast"
if: build.env("CI_BYPASS") != "true"
- label: ":github: Deploy Artifacts"
command: "ghartifacts.sh"
depends_on:
- "unit-test"
- "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: ":debian: :fedora: :ubuntu: Deploy APT"
command: "aptdeploy.sh"
depends_on:
- "build-deb-package-amd64"
- "build-deb-package-arm64"
- "build-deb-package-armhf"
agents:
upload: "fast"
if: build.tag != null
- label: ":book: Deploy Documentation"
command: "syncdoc.sh"
depends_on: ~
agents:
upload: "fast"
if: build.branch == "master"
EOF