2020-06-18 07:49:13 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-12-27 11:07:53 +00:00
|
|
|
|
|
|
|
set +u
|
|
|
|
|
|
|
|
DOCKER_IMAGE=authelia/authelia
|
|
|
|
|
2021-06-26 01:45:21 +00:00
|
|
|
if [[ "${BUILDKITE_LABEL}" == ":hammer_and_wrench: Unit Test" ]]; then
|
2020-04-28 14:07:20 +00:00
|
|
|
tar -czf authelia-public_html.tar.gz -C dist public_html
|
|
|
|
sha256sum authelia-public_html.tar.gz > authelia-public_html.tar.gz.sha256
|
|
|
|
fi
|
|
|
|
|
2021-06-26 01:45:21 +00:00
|
|
|
if [[ "${BUILDKITE_LABEL}" =~ ":docker: Build Image" ]]; then
|
2019-12-27 11:07:53 +00:00
|
|
|
echo "--- :docker: Saving artifacts for :buildkite: :docker: :github: releases"
|
|
|
|
# Save binary for buildkite and github artifacts
|
2020-06-05 00:43:19 +00:00
|
|
|
if [[ "${ARCH}" != "coverage" ]]; then
|
2021-06-26 01:45:21 +00:00
|
|
|
docker create --name authelia-binary "${DOCKER_IMAGE}:latest"
|
|
|
|
docker cp authelia-binary:/app/authelia "./authelia-${OS}-${ARCH}"
|
2020-06-05 00:43:19 +00:00
|
|
|
docker rm -f authelia-binary
|
2021-06-26 01:45:21 +00:00
|
|
|
tar -czf "authelia-${OS}-${ARCH}.tar.gz" "authelia-${OS}-${ARCH}" authelia.service config.template.yml
|
|
|
|
sha256sum "authelia-${OS}-${ARCH}.tar.gz" > "authelia-${OS}-${ARCH}.tar.gz.sha256"
|
2020-06-05 00:43:19 +00:00
|
|
|
fi
|
2020-05-03 12:03:53 +00:00
|
|
|
# Saving image for push to docker hub
|
2021-06-26 01:45:21 +00:00
|
|
|
docker save "${DOCKER_IMAGE}" | zstdmt -T0 -12 > "authelia-image-${ARCH}.tar.zst"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${BUILDKITE_LABEL}" =~ ":debian: Build Package" ]]; then
|
|
|
|
if [[ "${BUILDKITE_TAG}" != "" ]]; then
|
|
|
|
echo "--- :debian: Saving artifacts for :github: release"
|
|
|
|
for f in *.deb; do mv "$f" "$(echo "$f" | sed s/${BUILDKITE_TAG//v}-1_//)"; done
|
|
|
|
else
|
|
|
|
echo "--- :debian: Saving artifacts for :buildkite: release"
|
|
|
|
VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
|
|
|
|
for f in *.deb; do mv "$f" "$(echo "$f" | sed s/${VERSION}-1_//)"; done
|
|
|
|
fi
|
|
|
|
sha256sum "authelia_${PACKAGE}.deb" > "authelia_${PACKAGE}.deb.sha256"
|
2019-12-27 11:07:53 +00:00
|
|
|
fi
|