authelia/.buildkite/hooks/pre-artifact
Amir Zarrinkafsh 2fb20882d9
Utilise Buildkite for Authelia CI/CD (#507)
Publish steps are currently disabled.
2019-12-27 22:07:53 +11:00

25 lines
846 B
Bash
Executable File

#!/bin/bash
set +u
DOCKER_IMAGE=authelia/authelia
if [[ $BUILDKITE_COMMAND == "authelia-scripts --log-level debug ci" ]];
then
tar -czf dist.tar.gz dist
tar -czf web.tar.gz web
fi
if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]];
then
echo "--- :docker: Saving artifacts for :buildkite: :docker: :github: releases"
# Save binary for buildkite and github artifacts
docker create --name authelia-binary $DOCKER_IMAGE:latest
docker cp authelia-binary:/usr/app/authelia ./authelia-linux-$ARCH
docker cp authelia-binary:/usr/app/public_html ./
docker rm -f authelia-binary
tar -czf authelia-linux-$ARCH.tar.gz authelia-linux-$ARCH public_html
sha256sum authelia-linux-$ARCH.tar.gz > authelia-linux-$ARCH.tar.gz.sha256
# Saving image for push to DockerHub
docker save $DOCKER_IMAGE | gzip > authelia-image-$ARCH.tar.gz
fi