authelia/.buildkite/hooks/pre-artifact

26 lines
976 B
Plaintext
Raw Normal View History

#!/bin/bash
set +u
DOCKER_IMAGE=authelia/authelia
if [[ $BUILDKITE_COMMAND == "authelia-scripts --log-level debug ci" ]];
then
echo "--- :go::node: Saving artifacts for :chrome::selenium: Integration tests"
2020-01-06 23:12:37 +00:00
tar --zstd -cf dist.tar.zst dist
tar --zstd -cf web.tar.zst 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
2020-01-05 14:31:33 +00:00
docker cp authelia-binary:/usr/app/authelia ./authelia-linux-"${ARCH}"
docker cp authelia-binary:/usr/app/public_html ./
docker rm -f authelia-binary
2020-01-06 23:12:37 +00:00
tar --zstd -cf authelia-linux-"${ARCH}".tar.zst authelia-linux-"${ARCH}" public_html
sha256sum authelia-linux-"${ARCH}".tar.zst > authelia-linux-"${ARCH}".tar.zst.sha256
# Saving image for push to DockerHub
2020-01-06 23:12:37 +00:00
docker save $DOCKER_IMAGE | zstd > authelia-image-"${ARCH}".tar.zst
fi