Shellcheck Buildkite pipeline

pull/540/head
Amir Zarrinkafsh 2020-01-06 01:31:33 +11:00
parent 4ca603883a
commit 8b8d0c0037
4 changed files with 14 additions and 11 deletions

View File

@ -5,9 +5,9 @@ set +u
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]];
then then
CONTAINERS=$(docker ps -a -q) CONTAINERS=$(docker ps -a -q)
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

@ -15,11 +15,11 @@ then
echo "--- :docker: Saving artifacts for :buildkite: :docker: :github: releases" echo "--- :docker: Saving artifacts for :buildkite: :docker: :github: releases"
# Save binary for buildkite and github artifacts # Save binary for buildkite and github artifacts
docker create --name authelia-binary $DOCKER_IMAGE:latest docker create --name authelia-binary $DOCKER_IMAGE:latest
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 -czf authelia-linux-$ARCH.tar.gz authelia-linux-$ARCH 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 sha256sum authelia-linux-"${ARCH}".tar.gz > authelia-linux-"${ARCH}".tar.gz.sha256
# Saving image for push to DockerHub # Saving image for push to DockerHub
docker save $DOCKER_IMAGE | gzip > authelia-image-$ARCH.tar.gz docker save $DOCKER_IMAGE | gzip > authelia-image-"${ARCH}".tar.gz
fi fi

View File

@ -11,8 +11,8 @@ fi
if [[ $BUILDKITE_LABEL =~ ":docker: Deploy Image" ]]; if [[ $BUILDKITE_LABEL =~ ":docker: Deploy Image" ]];
then then
buildkite-agent artifact download "authelia-image-$ARCH*" . buildkite-agent artifact download "authelia-image-${ARCH}*" .
zcat authelia-image-$ARCH.tar.gz | docker load zcat authelia-image-"${ARCH}".tar.gz | docker load
fi fi
if [[ $BUILDKITE_LABEL == ":github: Deploy Artifacts" ]]; if [[ $BUILDKITE_LABEL == ":github: Deploy Artifacts" ]];

View File

@ -3,9 +3,12 @@ set -eu
artifacts=() artifacts=()
for FILES in authelia-linux-amd64.tar.gz authelia-linux-arm32v7.tar.gz authelia-linux-arm64v8.tar.gz authelia-linux-amd64.tar.gz.sha256 authelia-linux-arm32v7.tar.gz.sha256 authelia-linux-arm64v8.tar.gz.sha256; 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;
do do
artifacts+=(-a ${FILES}) artifacts+=(-a "${FILES}")
done done
hub release create ${artifacts[@]} -m $BUILDKITE_TAG $BUILDKITE_TAG hub release create "${artifacts[@]}" -m "${BUILDKITE_TAG}" "${BUILDKITE_TAG}"