From e97a11a9c139d91e46cee9d630a0a905a9155a17 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Tue, 7 Jan 2020 10:12:37 +1100 Subject: [PATCH] Utilise zstd for compression --- .buildkite/hooks/pre-artifact | 10 +++++----- .buildkite/hooks/pre-command | 6 +++--- .buildkite/pipeline.yml | 4 ++-- .buildkite/steps/buildimages.sh | 6 +++--- .buildkite/steps/ghartifacts.sh | 6 +++--- .travis.yml | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.buildkite/hooks/pre-artifact b/.buildkite/hooks/pre-artifact index 6d2d75e42..a863c9edd 100755 --- a/.buildkite/hooks/pre-artifact +++ b/.buildkite/hooks/pre-artifact @@ -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 \ No newline at end of file diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index aa04019e0..7886ee48a 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -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" ]]; diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index f8b6a27c5..e2f6b94b9 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -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 diff --git a/.buildkite/steps/buildimages.sh b/.buildkite/steps/buildimages.sh index 551c36c08..eed81008e 100755 --- a/.buildkite/steps/buildimages.sh +++ b/.buildkite/steps/buildimages.sh @@ -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 \ No newline at end of file diff --git a/.buildkite/steps/ghartifacts.sh b/.buildkite/steps/ghartifacts.sh index 20a6f26a9..9ca19dd78 100755 --- a/.buildkite/steps/ghartifacts.sh +++ b/.buildkite/steps/ghartifacts.sh @@ -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 diff --git a/.travis.yml b/.travis.yml index a057a04c7..c9de6694a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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