2019-12-27 18:07:53 +07:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
|
2020-04-03 12:13:24 +07:00
|
|
|
declare -A BUILDS=(["linux"]="amd64 arm32v7 arm64v8" ["darwin"]="amd64")
|
|
|
|
|
|
|
|
for BUILD_OS in "${!BUILDS[@]}"; do
|
|
|
|
for BUILD_ARCH in ${BUILDS[$BUILD_OS]}; do
|
|
|
|
if [[ "${BUILD_OS}" == "darwin" ]]; then
|
|
|
|
cat << EOF
|
|
|
|
- label: ":docker: Build Image [${BUILD_OS}]"
|
|
|
|
command: "authelia-scripts docker build --arch=${BUILD_OS}"
|
|
|
|
EOF
|
|
|
|
else
|
2020-03-09 08:32:07 +07:00
|
|
|
cat << EOF
|
|
|
|
- label: ":docker: Build Image [${BUILD_ARCH}]"
|
|
|
|
command: "authelia-scripts docker build --arch=${BUILD_ARCH}"
|
2020-04-03 12:13:24 +07:00
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
cat << EOF
|
2020-03-09 08:32:07 +07:00
|
|
|
agents:
|
|
|
|
build: "true"
|
|
|
|
artifact_paths:
|
2020-04-03 12:13:24 +07:00
|
|
|
EOF
|
|
|
|
if [[ "${BUILD_OS}" == "linux" ]]; then
|
|
|
|
cat << EOF
|
2020-03-09 08:32:07 +07:00
|
|
|
- "authelia-image-${BUILD_ARCH}.tar.zst"
|
2020-04-03 12:13:24 +07:00
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
cat << EOF
|
|
|
|
- "authelia-${BUILD_OS}-${BUILD_ARCH}.tar.gz"
|
|
|
|
- "authelia-${BUILD_OS}-${BUILD_ARCH}.tar.gz.sha256"
|
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-04-03 12:13:24 +07:00
|
|
|
done
|
2019-12-27 18:07:53 +07:00
|
|
|
done
|