Utilise zstd for compression

This commit is contained in:
Amir Zarrinkafsh 2020-01-07 10:12:37 +11:00
parent 8b8d0c0037
commit e97a11a9c1
6 changed files with 19 additions and 19 deletions

View File

@ -6,8 +6,8 @@ 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
tar --zstd -cf dist.tar.zst dist
tar --zstd -cf web.tar.zst web
fi
if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]];
@ -18,8 +18,8 @@ then
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
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
docker save $DOCKER_IMAGE | gzip > authelia-image-"${ARCH}".tar.gz
docker save $DOCKER_IMAGE | zstd > authelia-image-"${ARCH}".tar.zst
fi

View File

@ -5,14 +5,14 @@ set +u
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]];
then
echo "--- :go::node: Extracting build artifacts"
buildkite-agent artifact download "dist.tar.gz" . && tar xf dist.tar.gz
buildkite-agent artifact download "web.tar.gz" . && tar xf web.tar.gz
buildkite-agent artifact download "dist.tar.zst" . && tar xf dist.tar.zst
buildkite-agent artifact download "web.tar.zst" . && tar xf web.tar.zst
fi
if [[ $BUILDKITE_LABEL =~ ":docker: Deploy Image" ]];
then
buildkite-agent artifact download "authelia-image-${ARCH}*" .
zcat authelia-image-"${ARCH}".tar.gz | docker load
zstdcat authelia-image-"${ARCH}".tar.zst | docker load
fi
if [[ $BUILDKITE_LABEL == ":github: Deploy Artifacts" ]];

View File

@ -4,8 +4,8 @@ steps:
agents:
upload: "fast"
artifact_paths:
- "dist.tar.gz"
- "web.tar.gz"
- "dist.tar.zst"
- "web.tar.zst"
key: "build"
- wait

View File

@ -7,9 +7,9 @@ do
echo " commands:"
echo " - \"authelia-scripts docker build --arch=${BUILD_ARCH}\""
echo " artifact_paths:"
echo " - \"authelia-image-${BUILD_ARCH}.tar.gz\""
echo " - \"authelia-linux-${BUILD_ARCH}.tar.gz\""
echo " - \"authelia-linux-${BUILD_ARCH}.tar.gz.sha256\""
echo " - \"authelia-image-${BUILD_ARCH}.tar.zst\""
echo " - \"authelia-linux-${BUILD_ARCH}.tar.zst\""
echo " - \"authelia-linux-${BUILD_ARCH}.tar.zst.sha256\""
echo " env:"
echo " "ARCH: ${BUILD_ARCH}""
done

View File

@ -4,9 +4,9 @@ set -eu
artifacts=()
for FILES in \
authelia-linux-amd64.tar.gz authelia-linux-amd64.tar.gz.sha256 \
authelia-linux-arm32v7.tar.gz authelia-linux-arm32v7.tar.gz.sha256 \
authelia-linux-arm64v8.tar.gz authelia-linux-arm64v8.tar.gz.sha256;
authelia-linux-amd64.tar.zst authelia-linux-amd64.tar.zst.sha256 \
authelia-linux-arm32v7.tar.zst authelia-linux-arm32v7.tar.zst.sha256 \
authelia-linux-arm64v8.tar.zst authelia-linux-arm64v8.tar.zst.sha256;
do
artifacts+=(-a "${FILES}")
done

View File

@ -99,13 +99,13 @@ jobs:
- docker create --name authelia-binary authelia/authelia:${TRAVIS_TAG:1}-$ARCH
- docker cp authelia-binary:/usr/app/authelia ./authelia-linux-$ARCH
- docker cp authelia-binary:/usr/app/public_html ./
- tar -czf authelia-linux-$ARCH.tar.gz authelia-linux-$ARCH public_html
- sha256sum authelia-linux-$ARCH.tar.gz > authelia-linux-$ARCH.tar.gz.sha256
- 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
deploy:
provider: releases
api_key: "$GITHUB_API_KEY"
file_glob: true
file: "authelia-linux-$ARCH.tar.gz*"
file: "authelia-linux-$ARCH.tar.zst*"
skip_cleanup: true
on:
tags: true