2019-12-27 18:07:53 +07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set +u
|
|
|
|
|
|
|
|
DOCKER_IMAGE=authelia/authelia
|
|
|
|
|
2020-01-30 14:37:11 +07:00
|
|
|
if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; then
|
2019-12-27 18:07:53 +07:00
|
|
|
echo "--- :docker: Saving artifacts for :buildkite: :docker: :github: releases"
|
|
|
|
# Save binary for buildkite and github artifacts
|
2020-01-30 14:37:11 +07:00
|
|
|
docker create --name authelia-binary ${DOCKER_IMAGE}:latest
|
2020-04-03 12:13:24 +07:00
|
|
|
docker cp authelia-binary:/usr/app/authelia ./authelia-"${OS}"-"${ARCH}"
|
2019-12-27 18:07:53 +07:00
|
|
|
docker cp authelia-binary:/usr/app/public_html ./
|
|
|
|
docker rm -f authelia-binary
|
2020-04-03 12:13:24 +07:00
|
|
|
if [[ $OS == "linux" ]]; then
|
|
|
|
tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" authelia.service config.template.yml public_html
|
|
|
|
else
|
|
|
|
tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" config.template.yml public_html
|
|
|
|
fi
|
|
|
|
sha256sum authelia-"${OS}"-"${ARCH}".tar.gz > authelia-"${OS}"-"${ARCH}".tar.gz.sha256
|
|
|
|
# Saving image for push to docker hub, darwin image is not required as OSX utilses linux manifests
|
|
|
|
if [[ $BUILDKITE_LABEL != ":docker: Build Image [darwin]" ]]; then
|
|
|
|
docker save ${DOCKER_IMAGE} | zstdmt -T0 -12 > authelia-image-"${ARCH}".tar.zst
|
|
|
|
fi
|
2019-12-27 18:07:53 +07:00
|
|
|
fi
|