Shellcheck Buildkite pipeline
parent
4ca603883a
commit
8b8d0c0037
|
@ -5,9 +5,9 @@ set +u
|
|||
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]];
|
||||
then
|
||||
CONTAINERS=$(docker ps -a -q)
|
||||
if [[ $CONTAINERS != "" ]];
|
||||
if [[ ${CONTAINERS} != "" ]];
|
||||
then
|
||||
echo "--- :docker: Clean environment"
|
||||
docker rm -f $CONTAINERS
|
||||
docker rm -f "${CONTAINERS}"
|
||||
fi
|
||||
fi
|
|
@ -15,11 +15,11 @@ 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-linux-$ARCH
|
||||
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 -czf authelia-linux-"${ARCH}".tar.gz authelia-linux-"${ARCH}" public_html
|
||||
sha256sum authelia-linux-"${ARCH}".tar.gz > authelia-linux-"${ARCH}".tar.gz.sha256
|
||||
# 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
|
|
@ -11,8 +11,8 @@ fi
|
|||
|
||||
if [[ $BUILDKITE_LABEL =~ ":docker: Deploy Image" ]];
|
||||
then
|
||||
buildkite-agent artifact download "authelia-image-$ARCH*" .
|
||||
zcat authelia-image-$ARCH.tar.gz | docker load
|
||||
buildkite-agent artifact download "authelia-image-${ARCH}*" .
|
||||
zcat authelia-image-"${ARCH}".tar.gz | docker load
|
||||
fi
|
||||
|
||||
if [[ $BUILDKITE_LABEL == ":github: Deploy Artifacts" ]];
|
||||
|
|
|
@ -3,9 +3,12 @@ set -eu
|
|||
|
||||
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
|
||||
artifacts+=(-a ${FILES})
|
||||
artifacts+=(-a "${FILES}")
|
||||
done
|
||||
|
||||
hub release create ${artifacts[@]} -m $BUILDKITE_TAG $BUILDKITE_TAG
|
||||
hub release create "${artifacts[@]}" -m "${BUILDKITE_TAG}" "${BUILDKITE_TAG}"
|
Loading…
Reference in New Issue