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