2020-06-18 07:49:13 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-12-27 11:07:53 +00:00
|
|
|
set -eu
|
|
|
|
|
2020-06-05 00:43:19 +00:00
|
|
|
declare -A BUILDS=(["linux"]="amd64 arm32v7 arm64v8 coverage")
|
2020-04-03 05:13:24 +00:00
|
|
|
|
|
|
|
for BUILD_OS in "${!BUILDS[@]}"; do
|
|
|
|
for BUILD_ARCH in ${BUILDS[$BUILD_OS]}; do
|
2020-03-09 01:32:07 +00:00
|
|
|
cat << EOF
|
|
|
|
- label: ":docker: Build Image [${BUILD_ARCH}]"
|
|
|
|
command: "authelia-scripts docker build --arch=${BUILD_ARCH}"
|
2021-08-07 01:04:21 +00:00
|
|
|
retry:
|
|
|
|
manual:
|
|
|
|
permit_on_passed: true
|
2020-03-09 01:32:07 +00:00
|
|
|
agents:
|
2020-04-08 01:31:33 +00:00
|
|
|
build: "${BUILD_OS}-${BUILD_ARCH}"
|
2020-03-09 01:32:07 +00:00
|
|
|
artifact_paths:
|
|
|
|
- "authelia-image-${BUILD_ARCH}.tar.zst"
|
2020-06-05 00:43:19 +00:00
|
|
|
EOF
|
|
|
|
if [[ "${BUILD_ARCH}" != "coverage" ]]; then
|
|
|
|
cat << EOF
|
2020-04-03 05:13:24 +00:00
|
|
|
- "authelia-${BUILD_OS}-${BUILD_ARCH}.tar.gz"
|
|
|
|
- "authelia-${BUILD_OS}-${BUILD_ARCH}.tar.gz.sha256"
|
2021-01-03 04:28:46 +00:00
|
|
|
depends_on:
|
|
|
|
- "unit-test"
|
2020-06-05 00:43:19 +00:00
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
cat << EOF
|
2020-03-09 01:32:07 +00:00
|
|
|
env:
|
|
|
|
ARCH: "${BUILD_ARCH}"
|
2020-04-03 05:13:24 +00:00
|
|
|
OS: "${BUILD_OS}"
|
|
|
|
key: "build-docker-${BUILD_OS}-${BUILD_ARCH}"
|
2020-03-09 01:32:07 +00:00
|
|
|
EOF
|
2020-06-05 00:43:19 +00:00
|
|
|
if [[ "${BUILD_ARCH}" == "coverage" ]]; then
|
|
|
|
cat << EOF
|
2021-08-07 00:06:42 +00:00
|
|
|
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.message !~ /\[(skip test|test skip)\]/
|
2020-06-05 00:43:19 +00:00
|
|
|
EOF
|
2021-01-31 00:49:36 +00:00
|
|
|
else
|
|
|
|
cat << EOF
|
2021-03-10 04:53:33 +00:00
|
|
|
if: build.branch !~ /^(dependabot|renovate)\/.*/
|
2021-01-31 00:49:36 +00:00
|
|
|
EOF
|
2020-06-05 00:43:19 +00:00
|
|
|
fi
|
2020-04-03 05:13:24 +00:00
|
|
|
done
|
2021-06-26 01:45:21 +00:00
|
|
|
done
|