Optimise Buildkite steps

* Utilise multi-threaded zstd for compression

* Fix container removal on dirty exit

* Optimise build step agents
pull/537/head^2
Amir Zarrinkafsh 2020-01-07 22:28:04 +11:00 committed by GitHub
parent e4764ad2cf
commit 1b39d28cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 8 deletions

View File

@ -8,6 +8,6 @@ then
if [[ ${CONTAINERS} != "" ]]; if [[ ${CONTAINERS} != "" ]];
then then
echo "--- :docker: Clean environment" echo "--- :docker: Clean environment"
docker rm -f "${CONTAINERS}" docker rm -f ${CONTAINERS}
fi fi
fi fi

View File

@ -7,8 +7,8 @@ DOCKER_IMAGE=authelia/authelia
if [[ $BUILDKITE_COMMAND == "authelia-scripts --log-level debug ci" ]]; if [[ $BUILDKITE_COMMAND == "authelia-scripts --log-level debug ci" ]];
then then
echo "--- :go::node: Saving artifacts for :chrome::selenium: Integration tests" echo "--- :go::node: Saving artifacts for :chrome::selenium: Integration tests"
tar --zstd -cf dist.tar.zst dist tar -I 'zstdmt -T0 -12' -cf dist.tar.zst dist
tar --zstd -cf web.tar.zst web tar -I 'zstdmt -T0 -12' -cf web.tar.zst web
fi fi
if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]];
@ -19,8 +19,8 @@ then
docker cp authelia-binary:/usr/app/authelia ./authelia-linux-"${ARCH}" docker cp authelia-binary:/usr/app/authelia ./authelia-linux-"${ARCH}"
docker cp authelia-binary:/usr/app/public_html ./ docker cp authelia-binary:/usr/app/public_html ./
docker rm -f authelia-binary docker rm -f authelia-binary
tar --zstd -cf authelia-linux-"${ARCH}".tar.zst authelia-linux-"${ARCH}" public_html tar -I 'zstdmt -T0 -12' -cf authelia-linux-"${ARCH}".tar.zst authelia-linux-"${ARCH}" public_html
sha256sum authelia-linux-"${ARCH}".tar.zst > authelia-linux-"${ARCH}".tar.zst.sha256 sha256sum authelia-linux-"${ARCH}".tar.zst > authelia-linux-"${ARCH}".tar.zst.sha256
# Saving image for push to DockerHub # Saving image for push to DockerHub
docker save $DOCKER_IMAGE | zstd > authelia-image-"${ARCH}".tar.zst docker save $DOCKER_IMAGE | zstdmt -T0 -12 > authelia-image-"${ARCH}".tar.zst
fi fi

View File

@ -1,8 +1,6 @@
steps: steps:
- label: ":hammer_and_wrench: Build & Test" - label: ":hammer_and_wrench: Build & Test"
command: "authelia-scripts --log-level debug ci" command: "authelia-scripts --log-level debug ci"
agents:
upload: "fast"
artifact_paths: artifact_paths:
- "dist.tar.zst" - "dist.tar.zst"
- "web.tar.zst" - "web.tar.zst"

View File

@ -99,7 +99,7 @@ jobs:
- docker create --name authelia-binary authelia/authelia:${TRAVIS_TAG:1}-$ARCH - 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/authelia ./authelia-linux-$ARCH
- docker cp authelia-binary:/usr/app/public_html ./ - docker cp authelia-binary:/usr/app/public_html ./
- tar --zstd -cf authelia-linux-$ARCH.tar.zst authelia-linux-$ARCH public_html - tar -I 'zstdmt -T0 -12' -cf authelia-linux-$ARCH.tar.zst authelia-linux-$ARCH public_html
- sha256sum authelia-linux-$ARCH.tar.zst > authelia-linux-$ARCH.tar.zst.sha256 - sha256sum authelia-linux-$ARCH.tar.zst > authelia-linux-$ARCH.tar.zst.sha256
deploy: deploy:
provider: releases provider: releases