summaryrefslogtreecommitdiff
path: root/.buildkite/hooks/pre-artifact
diff options
context:
space:
mode:
authorAmir Zarrinkafsh <nightah@me.com>2020-04-29 00:07:20 +1000
committerGitHub <noreply@github.com>2020-04-29 00:07:20 +1000
commitf8bd506326cb472c80cfa24b18d758f3cd67f3aa (patch)
tree77fc6f4dc08a7a6da7c04a6821d4159c5226f12a /.buildkite/hooks/pre-artifact
parentff2df8b0396fcfbdd5486ed06095d5de3cc2c286 (diff)
[FEATURE] Embed static assets in Go binary (#916)
* [FEATURE] Embed static assets in Go binary * Refactor/consolidate code and specify public_html via configuration * Update docs and config template for assets * Update AUR package pre-requisites and systemd unit * Include static assets as Buildkite and GitHub artifacts * Remove references to PUBLIC_DIR * Only serve assets via embedded filesystem and remove configuration references * Update authelia-scripts helper to build the embedded filesystem * Mock the embedded filesystem for unit tests Add to gitignore to ensure this isn't overwritten. * Move go:generate to satisfy linter
Diffstat (limited to '.buildkite/hooks/pre-artifact')
-rwxr-xr-x.buildkite/hooks/pre-artifact10
1 files changed, 7 insertions, 3 deletions
diff --git a/.buildkite/hooks/pre-artifact b/.buildkite/hooks/pre-artifact
index b7bd0b91e..db9c0ee11 100755
--- a/.buildkite/hooks/pre-artifact
+++ b/.buildkite/hooks/pre-artifact
@@ -4,17 +4,21 @@ set +u
DOCKER_IMAGE=authelia/authelia
+if [[ $BUILDKITE_LABEL == ":hammer_and_wrench: Unit Test" ]]; then
+ tar -czf authelia-public_html.tar.gz -C dist public_html
+ sha256sum authelia-public_html.tar.gz > authelia-public_html.tar.gz.sha256
+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-"${OS}"-"${ARCH}"
- docker cp authelia-binary:/usr/app/public_html ./
docker rm -f authelia-binary
if [[ $OS == "linux" ]]; then
- tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" authelia.service config.template.yml public_html
+ tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" authelia.service config.template.yml
else
- tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" config.template.yml public_html
+ tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" config.template.yml
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