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}"
|
|
|
|
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
|
2020-07-02 06:56:45 +00:00
|
|
|
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/
|
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-02-22 01:48:20 +00:00
|
|
|
done
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
- wait
|
|
|
|
|
|
|
|
- label: ":vertical_traffic_light: Build Concurrency Gate"
|
|
|
|
command: "echo End of concurrency gate"
|
|
|
|
concurrency: 3
|
|
|
|
concurrency_group: "builds"
|
|
|
|
EOF
|