feat: build and distribute .deb packages (#2114)

* feat: build and distribute .deb packages

Creates .deb packages for distribution via GitHub releases and Buildkite builds for the following architectures:

* amd64
* armhf
* arm64

* fix: pkgver reference in debpackages.sh

* refactor: split deb packaging jobs and quote variables

* fix: pipeline upload for debpackages

* fix: depends_on key for debpackages

* fix: add depends_on: ~ for debpackages step

* fix: pre-artifact hook for debpackages

* fix: add .deb suffix in pre-artifact hook

* fix: variable reference in debhelper.sh

* refactor: silence wget output in debhelper.sh

* refactor: make build concurrency gate only depend_on docker builds

* refactor: make build concurrency gate also depend_on coverage build

* refactor: remove dependencies for build concurrency gate
pull/2121/head
Amir Zarrinkafsh 2021-06-26 11:45:21 +10:00 committed by GitHub
parent 756aee507f
commit 93e20a44e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 175 additions and 73 deletions

View File

@ -4,21 +4,27 @@
<dt>amd64</dt> <dt>amd64</dt>
<dd> <dd>
<a href="artifact://authelia-linux-amd64.tar.gz">authelia-linux-amd64.tar.gz</a><br> <a href="artifact://authelia-linux-amd64.tar.gz">authelia-linux-amd64.tar.gz</a><br>
<a href="artifact://authelia-linux-amd64.tar.gz.sha256">authelia-linux-amd64.tar.gz.sha256</a> <a href="artifact://authelia-linux-amd64.tar.gz.sha256">authelia-linux-amd64.tar.gz.sha256</a><br>
<a href="artifact://authelia_amd64.deb">authelia_amd64.deb</a><br>
<a href="artifact://authelia_amd64.deb.sha256">authelia_amd64.deb.sha256</a>
</dd> </dd>
</div> </div>
<div class="m1"> <div class="m1">
<dt>arm32v7</dt> <dt>arm32v7</dt>
<dd> <dd>
<a href="artifact://authelia-linux-arm32v7.tar.gz">authelia-linux-arm32v7.tar.gz</a><br> <a href="artifact://authelia-linux-arm32v7.tar.gz">authelia-linux-arm32v7.tar.gz</a><br>
<a href="artifact://authelia-linux-arm32v7.tar.gz.sha256">authelia-linux-arm32v7.tar.gz.sha256</a> <a href="artifact://authelia-linux-arm32v7.tar.gz.sha256">authelia-linux-arm32v7.tar.gz.sha256</a><br>
<a href="artifact://authelia_armhf.deb">authelia_armhf.deb</a><br>
<a href="artifact://authelia_armhf.deb.sha256">authelia_armhf.deb.sha256</a>
</dd> </dd>
</div> </div>
<div class="m1"> <div class="m1">
<dt>arm64v8</dt> <dt>arm64v8</dt>
<dd> <dd>
<a href="artifact://authelia-linux-arm64v8.tar.gz">authelia-linux-arm64v8.tar.gz</a><br> <a href="artifact://authelia-linux-arm64v8.tar.gz">authelia-linux-arm64v8.tar.gz</a><br>
<a href="artifact://authelia-linux-arm64v8.tar.gz.sha256">authelia-linux-arm64v8.tar.gz.sha256</a> <a href="artifact://authelia-linux-arm64v8.tar.gz.sha256">authelia-linux-arm64v8.tar.gz.sha256</a><br>
<a href="artifact://authelia_arm64.deb">authelia_arm64.deb</a><br>
<a href="artifact://authelia_arm64.deb.sha256">authelia_arm64.deb.sha256</a>
</dd> </dd>
</div> </div>
<div class="m1"> <div class="m1">

View File

@ -3,9 +3,9 @@ set -u
DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?) DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
if [[ $DIVERGED == 0 ]]; then if [[ "${DIVERGED}" == 0 ]]; then
if [[ $BUILDKITE_TAG == "" ]]; then if [[ "${BUILDKITE_TAG}" == "" ]]; then
if [[ $BUILDKITE_BRANCH == "master" ]]; then if [[ "${BUILDKITE_BRANCH}" == "master" ]]; then
CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false) CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
else else
CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false) CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
@ -43,6 +43,9 @@ steps:
- "build-docker-linux-amd64" - "build-docker-linux-amd64"
- "build-docker-linux-arm32v7" - "build-docker-linux-arm32v7"
- "build-docker-linux-arm64v8" - "build-docker-linux-arm64v8"
- "build-deb-package-amd64"
- "build-deb-package-armhf"
- "build-deb-package-arm64"
retry: retry:
automatic: true automatic: true
agents: agents:

View File

@ -4,14 +4,14 @@ set +u
git fetch -q git fetch -q
if [[ ! $BUILDKITE_COMMAND =~ "buildkite-agent pipeline upload" ]] || \ if [[ ! "${BUILDKITE_COMMAND}" =~ "buildkite-agent pipeline upload" ]] || \
[[ $BUILDKITE_COMMAND == ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload" ]]; then [[ "${BUILDKITE_COMMAND}" == ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload" ]]; then
echo "--- :buildkite: Setting up Build environment" echo "--- :buildkite: Setting up Build environment"
source bootstrap.sh source bootstrap.sh
if [[ $BUILDKITE_COMMAND == "authelia-scripts --log-level debug ci" ]]; then if [[ "${BUILDKITE_COMMAND}" == "authelia-scripts --log-level debug ci" ]]; then
go mod download go mod download
fi fi
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":selenium:" ]]; then
go mod download go mod download
fi fi
fi fi

View File

@ -2,28 +2,28 @@
set +u set +u
if [[ $BUILDKITE_PULL_REQUEST != "false" ]]; then if [[ "${BUILDKITE_PULL_REQUEST}" != "false" ]]; then
if [[ $BUILDKITE_LABEL == ":service_dog: Linting" ]]; then if [[ "${BUILDKITE_LABEL}" == ":service_dog: Linting" ]]; then
echo "--- :go::service_dog: Provide in-line commentary for pull request" echo "--- :go::service_dog: Provide in-line commentary for pull request"
reviewdog -reporter=github-pr-review reviewdog -reporter=github-pr-review
fi fi
fi fi
if [[ ! $BUILDKITE_BRANCH =~ ^(v.*) ]] && [[ $BUILDKITE_COMMAND_EXIT_STATUS == 0 ]]; then if [[ ! "${BUILDKITE_BRANCH}" =~ ^(v.*) ]] && [[ "${BUILDKITE_COMMAND_EXIT_STATUS}" == 0 ]]; then
if [[ $BUILDKITE_LABEL == ":hammer_and_wrench: Unit Test" ]] || [[ $BUILDKITE_LABEL =~ ":selenium:" ]]; then if [[ "${BUILDKITE_LABEL}" == ":hammer_and_wrench: Unit Test" ]] || [[ "${BUILDKITE_LABEL}" =~ ":selenium:" ]]; then
echo "--- :codecov: Upload coverage reports" echo "--- :codecov: Upload coverage reports"
if [[ $BUILDKITE_AGENT_META_DATA_CODECOV == "verbose" ]]; then if [[ "${BUILDKITE_AGENT_META_DATA_CODECOV}" == "verbose" ]]; then
BUILDKITE_AGENT_META_DATA_CODECOV="-v" BUILDKITE_AGENT_META_DATA_CODECOV="-v"
fi fi
bash <(curl -s --connect-timeout 10 --retry 10 --retry-max-time 0 https://codecov.io/bash) -Z -c -s 'coverage*.txt' -F backend ${BUILDKITE_AGENT_META_DATA_CODECOV} bash <(curl -s --connect-timeout 10 --retry 10 --retry-max-time 0 https://codecov.io/bash) -Z -c -s 'coverage*.txt' -F backend "${BUILDKITE_AGENT_META_DATA_CODECOV}"
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":selenium:" ]]; then
cd web && yarn report cd web && yarn report
fi fi
bash <(curl -s --connect-timeout 10 --retry 10 --retry-max-time 0 https://codecov.io/bash) -Z -c -f '!*.go' -f '!*.zst' -F frontend ${BUILDKITE_AGENT_META_DATA_CODECOV} bash <(curl -s --connect-timeout 10 --retry 10 --retry-max-time 0 https://codecov.io/bash) -Z -c -f '!*.go' -f '!*.zst' -F frontend "${BUILDKITE_AGENT_META_DATA_CODECOV}"
fi fi
fi fi
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":selenium:" ]] || [[ "${BUILDKITE_LABEL}" =~ ":docker: Build Image" ]]; then
CONTAINERS=$(docker ps -a -q) CONTAINERS=$(docker ps -a -q)
if [[ ${CONTAINERS} != "" ]]; then if [[ ${CONTAINERS} != "" ]]; then
echo "--- :docker: Remove lingering containers" echo "--- :docker: Remove lingering containers"
@ -31,16 +31,16 @@ if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Bu
fi fi
fi fi
if [[ $BUILDKITE_LABEL == ":docker: Image Deployments" ]]; then if [[ "${BUILDKITE_LABEL}" == ":docker: Image Deployments" ]]; then
cat .buildkite/annotations/artifacts | buildkite-agent annotate --style "success" --context "ctx-success" cat .buildkite/annotations/artifacts | buildkite-agent annotate --style "success" --context "ctx-success"
fi fi
if [[ $BUILDKITE_LABEL =~ ":docker: Deploy" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":docker: Deploy" ]]; then
docker logout docker logout
docker logout ghcr.io docker logout ghcr.io
fi fi
if [[ $BUILDKITE_LABEL == ":docker: Deploy Manifests" ]] && [[ $BUILDKITE_BRANCH == "master" ]] && [[ $BUILDKITE_PULL_REQUEST == "false" ]]; then if [[ "${BUILDKITE_LABEL}" == ":docker: Deploy Manifests" ]] && [[ "${BUILDKITE_BRANCH}" == "master" ]] && [[ "${BUILDKITE_PULL_REQUEST}" == "false" ]]; then
echo "--- :docker: Removing tags for deleted branches" echo "--- :docker: Removing tags for deleted branches"
anontoken=$(curl -fsL --retry 3 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:authelia/authelia:pull' | jq -r .token) anontoken=$(curl -fsL --retry 3 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:authelia/authelia:pull' | jq -r .token)
authtoken=$(curl -fs --retry 3 -H "Content-Type: application/json" -X "POST" -d '{"username": "'${DOCKER_USERNAME}'", "password": "'${DOCKER_PASSWORD}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) authtoken=$(curl -fs --retry 3 -H "Content-Type: application/json" -X "POST" -d '{"username": "'${DOCKER_USERNAME}'", "password": "'${DOCKER_PASSWORD}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)

View File

@ -4,21 +4,33 @@ set +u
DOCKER_IMAGE=authelia/authelia DOCKER_IMAGE=authelia/authelia
if [[ $BUILDKITE_LABEL == ":hammer_and_wrench: Unit Test" ]]; then if [[ "${BUILDKITE_LABEL}" == ":hammer_and_wrench: Unit Test" ]]; then
tar -czf authelia-public_html.tar.gz -C dist public_html tar -czf authelia-public_html.tar.gz -C dist public_html
sha256sum authelia-public_html.tar.gz > authelia-public_html.tar.gz.sha256 sha256sum authelia-public_html.tar.gz > authelia-public_html.tar.gz.sha256
fi fi
if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":docker: Build Image" ]]; 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
if [[ "${ARCH}" != "coverage" ]]; then if [[ "${ARCH}" != "coverage" ]]; then
docker create --name authelia-binary ${DOCKER_IMAGE}:latest docker create --name authelia-binary "${DOCKER_IMAGE}:latest"
docker cp authelia-binary:/app/authelia ./authelia-"${OS}"-"${ARCH}" docker cp authelia-binary:/app/authelia "./authelia-${OS}-${ARCH}"
docker rm -f authelia-binary docker rm -f authelia-binary
tar -czf authelia-"${OS}"-"${ARCH}".tar.gz authelia-"${OS}"-"${ARCH}" authelia.service config.template.yml tar -czf "authelia-${OS}-${ARCH}.tar.gz" "authelia-${OS}-${ARCH}" authelia.service config.template.yml
sha256sum authelia-"${OS}"-"${ARCH}".tar.gz > authelia-"${OS}"-"${ARCH}".tar.gz.sha256 sha256sum "authelia-${OS}-${ARCH}.tar.gz" > "authelia-${OS}-${ARCH}.tar.gz.sha256"
fi fi
# Saving image for push to docker hub # Saving image for push to docker hub
docker save ${DOCKER_IMAGE} | zstdmt -T0 -12 > authelia-image-"${ARCH}".tar.zst docker save "${DOCKER_IMAGE}" | zstdmt -T0 -12 > "authelia-image-${ARCH}.tar.zst"
fi
if [[ "${BUILDKITE_LABEL}" =~ ":debian: Build Package" ]]; then
if [[ "${BUILDKITE_TAG}" != "" ]]; then
echo "--- :debian: Saving artifacts for :github: release"
for f in *.deb; do mv "$f" "$(echo "$f" | sed s/${BUILDKITE_TAG//v}-1_//)"; done
else
echo "--- :debian: Saving artifacts for :buildkite: release"
VERSION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
for f in *.deb; do mv "$f" "$(echo "$f" | sed s/${VERSION}-1_//)"; done
fi
sha256sum "authelia_${PACKAGE}.deb" > "authelia_${PACKAGE}.deb.sha256"
fi fi

View File

@ -2,29 +2,34 @@
set +u set +u
if [[ $BUILDKITE_LABEL == ":service_dog: Linting" ]]; then if [[ "${BUILDKITE_LABEL}" == ":service_dog: Linting" ]]; then
cd web && yarn install && cd ../ cd web && yarn install && cd ../
fi fi
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":selenium:" ]]; then
DEFAULT_ARCH=coverage DEFAULT_ARCH=coverage
echo "--- :docker: Extract, load and tag build container" echo "--- :docker: Extract, load and tag build container"
buildkite-agent artifact download "authelia-image-${DEFAULT_ARCH}*" . buildkite-agent artifact download "authelia-image-${DEFAULT_ARCH}*" .
zstdcat authelia-image-${DEFAULT_ARCH}.tar.zst | docker load zstdcat "authelia-image-${DEFAULT_ARCH}.tar.zst" | docker load
docker tag authelia/authelia authelia:dist docker tag authelia/authelia authelia:dist
fi fi
if [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]] && [[ "${ARCH}" != "coverage" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":docker: Build Image" ]] && [[ "${ARCH}" != "coverage" ]]; then
echo "--- :react: :swagger: Extract frontend assets" echo "--- :react: :swagger: Extract frontend assets"
buildkite-agent artifact download "authelia-public_html.tar.gz" . buildkite-agent artifact download "authelia-public_html.tar.gz" .
tar xzf authelia-public_html.tar.gz tar xzf authelia-public_html.tar.gz
fi fi
if [[ $BUILDKITE_LABEL =~ ":docker: Deploy Image" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":debian: Build Package" ]]; then
buildkite-agent artifact download "authelia-image-${ARCH}*" . buildkite-agent artifact download "authelia-linux-${ARCH}.tar.gz" .
zstdcat authelia-image-"${ARCH}".tar.zst | docker load
fi fi
if [[ $BUILDKITE_LABEL == ":github: Deploy Artifacts" ]]; then if [[ "${BUILDKITE_LABEL}" =~ ":docker: Deploy Image" ]]; then
buildkite-agent artifact download "authelia-image-${ARCH}*" .
zstdcat "authelia-image-${ARCH}.tar.zst" | docker load
fi
if [[ "${BUILDKITE_LABEL}" == ":github: Deploy Artifacts" ]]; then
buildkite-agent artifact download "authelia-*.tar.gz*" . buildkite-agent artifact download "authelia-*.tar.gz*" .
buildkite-agent artifact download "authelia_*.deb*" .
fi fi

View File

@ -2,7 +2,7 @@
set +u set +u
if [[ $BUILDKITE_AGENT_META_DATA_CLEANBUILD != "false" ]]; then if [[ "${BUILDKITE_AGENT_META_DATA_CLEANBUILD}" != "false" ]]; then
echo "--- :docker: Clean environment" echo "--- :docker: Clean environment"
docker system prune -af --volumes docker system prune -af --volumes
fi fi

View File

@ -3,9 +3,9 @@ set -u
DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?) DIVERGED=$(git merge-base --fork-point origin/master > /dev/null; echo $?)
if [[ $DIVERGED == 0 ]]; then if [[ "${DIVERGED}" == 0 ]]; then
if [[ $BUILDKITE_TAG == "" ]]; then if [[ "${BUILDKITE_TAG}" == "" ]]; then
if [[ $BUILDKITE_BRANCH == "master" ]]; then if [[ "${BUILDKITE_BRANCH}" == "master" ]]; then
CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false) CI_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
else else
CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false) CI_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^(CONTRIBUTING.md|README.md|SECURITY.md|\.all-contributorsrc|\.github\/.*|docs\/.*)/!{q1}' && echo true || echo false)
@ -52,6 +52,20 @@ steps:
depends_on: ~ depends_on: ~
if: build.env("CI_BYPASS") != "true" if: build.env("CI_BYPASS") != "true"
- label: ":debian: Package Builds"
command: ".buildkite/steps/debpackages.sh | buildkite-agent pipeline upload"
depends_on: ~
if: build.env("CI_BYPASS") != "true"
- wait:
if: build.env("CI_BYPASS") != "true"
- label: ":vertical_traffic_light: Build Concurrency Gate"
command: "echo End of concurrency gate"
concurrency: 3
concurrency_group: "builds"
if: build.env("CI_BYPASS") != "true"
- wait: - wait:
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
@ -62,4 +76,13 @@ steps:
depends_on: depends_on:
- "build-docker-linux-coverage" - "build-docker-linux-coverage"
if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"
- wait:
if: build.env("CI_BYPASS") != "true"
- label: ":vertical_traffic_light: Test Concurrency Gate"
command: "echo End of concurrency gate"
concurrency: 3
concurrency_group: "tests"
if: build.env("CI_BYPASS") != "true"
EOF EOF

View File

@ -1,4 +1,4 @@
#! /usr/bin/env bash #!/usr/bin/env bash
GITTAG=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') GITTAG=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
@ -6,20 +6,20 @@ echo "--- :linux: Deploy AUR package: ${PACKAGE}"
git clone ssh://aur@aur.archlinux.org/"${PACKAGE}".git git clone ssh://aur@aur.archlinux.org/"${PACKAGE}".git
cd "${PACKAGE}" || exit cd "${PACKAGE}" || exit
if [[ $PACKAGE != "authelia-git" ]]; then if [[ "${PACKAGE}" != "authelia-git" ]]; then
sed -i "/pkgver=/c\pkgver=${BUILDKITE_TAG//v/}" PKGBUILD && \ sed -i -e "/pkgver=/c pkgver=${BUILDKITE_TAG//v/}" \
sed -i "/pkgrel=/c\pkgrel=1" PKGBUILD && \ -e '/pkgrel=/c pkgrel=1' PKGBUILD && \
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && updpkgsums" docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && updpkgsums"
else else
sed -i "/pkgver=/c\pkgver=${GITTAG}" PKGBUILD && \ sed -i -e "/pkgver=/c pkgver=${GITTAG}" \
sed -i "/pkgrel=/c\pkgrel=1" PKGBUILD -e '/pkgrel=/c pkgrel=1' PKGBUILD
fi fi
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && makepkg --printsrcinfo >| .SRCINFO" && \ docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && makepkg --printsrcinfo >| .SRCINFO" && \
git add . && \ git add . && \
if [[ $PACKAGE != "authelia-git" ]]; then if [[ "${PACKAGE}" != "authelia-git" ]]; then
git commit -m "Update to ${BUILDKITE_TAG}" git commit -m "Update to ${BUILDKITE_TAG}"
else else
git commit -m "Update to GIT version: ${GITTAG}" git commit -m "Update to GIT version: ${GITTAG}"
fi fi
git push git push

View File

@ -37,13 +37,4 @@ cat << EOF
EOF EOF
fi fi
done done
done done
cat << EOF
- wait
- label: ":vertical_traffic_light: Build Concurrency Gate"
command: "echo End of concurrency gate"
concurrency: 3
concurrency_group: "builds"
EOF

View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
GITTAG=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
if [[ "${BUILDKITE_TAG}" == "" ]]; then
VERSION="pkgver=${GITTAG}"
else
VERSION="pkgver=${BUILDKITE_TAG//v/}"
fi
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=authelia-bin -qO PKGBUILD && \
sed -i -e '/^pkgname=/c pkgname=authelia' -e "/pkgver=/c $VERSION" -e '10,14d' \
-e 's/source_x86_64.*/source_x86_64=("authelia-linux-amd64.tar.gz")/' \
-e 's/source_aarch64.*/source_aarch64=("authelia-linux-arm64v8.tar.gz")/' \
-e 's/source_armv7h.*/source_armv7h=("authelia-linux-arm32v7.tar.gz")/' \
-e 's/sha256sums_x86_64.*/sha256sums_x86_64=("SKIP")/' \
-e 's/sha256sums_aarch64.*/sha256sums_aarch64=("SKIP")/' \
-e 's/sha256sums_armv7h.*/sha256sums_armv7h=("SKIP")/' PKGBUILD
if [[ "${PACKAGE}" == "amd64" ]]; then
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && makedeb"
elif [[ "${PACKAGE}" == "armhf" ]]; then
docker run --rm -v $PWD:/build nightah/debpackager:armhf bash -c "cd /build && makedeb"
else
docker run --rm -v $PWD:/build nightah/debpackager:arm64 bash -c "cd /build && makedeb"
fi

View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -eu
for DEB_PACKAGE in amd64 armhf arm64; do
cat << EOF
- label: ":debian: Build Package [${DEB_PACKAGE}]"
command: "debhelper.sh"
artifact_paths:
- "*.deb"
- "*.deb.sha256"
env:
PACKAGE: "${DEB_PACKAGE}"
EOF
if [[ "${DEB_PACKAGE}" == "amd64" ]]; then
cat << EOF
ARCH: "${DEB_PACKAGE}"
depends_on:
- "build-docker-linux-amd64"
EOF
elif [[ "${DEB_PACKAGE}" == "armhf" ]]; then
cat << EOF
ARCH: "arm32v7"
depends_on:
- "build-docker-linux-arm32v7"
EOF
else
cat << EOF
ARCH: "arm64v8"
depends_on:
- "build-docker-linux-arm64v8"
EOF
fi
cat << EOF
key: "build-deb-package-${DEB_PACKAGE}"
EOF
done

View File

@ -29,13 +29,4 @@ cat << EOF
suite: "all" suite: "all"
EOF EOF
fi fi
done done
cat << EOF
- wait
- label: ":vertical_traffic_light: Test Concurrency Gate"
command: "echo End of concurrency gate"
concurrency: 3
concurrency_group: "tests"
EOF

View File

@ -14,10 +14,20 @@ do
artifacts+=(-a "${FILE/authelia-/authelia-${BUILDKITE_TAG}-}") artifacts+=(-a "${FILE/authelia-/authelia-${BUILDKITE_TAG}-}")
done done
for FILE in \
authelia_amd64.deb authelia_amd64.deb.sha256 \
authelia_arm64.deb authelia_arm64.deb.sha256 \
authelia_armhf.deb authelia_armhf.deb.sha256;
do
# Add the version to the artifact name
mv $FILE ${FILE/authelia_/authelia_${BUILDKITE_TAG}_}
artifacts+=(-a "${FILE/authelia_/authelia_${BUILDKITE_TAG}_}")
done
echo "--- :github: Deploy artifacts for release: ${BUILDKITE_TAG}" echo "--- :github: Deploy artifacts for release: ${BUILDKITE_TAG}"
hub release create "${BUILDKITE_TAG}" "${artifacts[@]}" -F <(echo -e "${BUILDKITE_TAG}\n$(conventional-changelog -p angular -o /dev/stdout -r 2 | sed -e '1,3d')\n\n### Docker Container\n* \`docker pull authelia/authelia:${BUILDKITE_TAG//v}\`\n* \`docker pull ghcr.io/authelia/authelia:${BUILDKITE_TAG//v}\`"); EXIT=$? hub release create "${BUILDKITE_TAG}" "${artifacts[@]}" -F <(echo -e "${BUILDKITE_TAG}\n$(conventional-changelog -p angular -o /dev/stdout -r 2 | sed -e '1,3d')\n\n### Docker Container\n* \`docker pull authelia/authelia:${BUILDKITE_TAG//v}\`\n* \`docker pull ghcr.io/authelia/authelia:${BUILDKITE_TAG//v}\`"); EXIT=$?
if [[ $EXIT == 0 ]]; if [[ "${EXIT}" == 0 ]];
then then
exit exit
else else

View File

@ -30,7 +30,8 @@ The following is a simple diagram of the architecture:
**Authelia** can be installed as a standalone service from the [AUR](https://aur.archlinux.org/packages/authelia/), **Authelia** can be installed as a standalone service from the [AUR](https://aur.archlinux.org/packages/authelia/),
[FreeBSD Ports](https://svnweb.freebsd.org/ports/head/www/authelia/), or using a [FreeBSD Ports](https://svnweb.freebsd.org/ports/head/www/authelia/), or using a
[Static binary](https://github.com/authelia/authelia/releases/latest), [Docker] or [Kubernetes] either manually or via [Static binary](https://github.com/authelia/authelia/releases/latest),
[.deb package]((https://github.com/authelia/authelia/releases/latest)), [Docker] or [Kubernetes] either manually or via
the Helm [Chart](https://charts.authelia.com) (beta) leveraging ingress controllers and ingress configurations. the Helm [Chart](https://charts.authelia.com) (beta) leveraging ingress controllers and ingress configurations.
<p align="center"> <p align="center">
@ -38,8 +39,6 @@ the Helm [Chart](https://charts.authelia.com) (beta) leveraging ingress controll
<img src="./docs/images/logos/docker.logo.png" width="100"> <img src="./docs/images/logos/docker.logo.png" width="100">
</p> </p>
***Help Wanted:*** Assistance to publish a [Debian package](https://github.com/authelia/authelia/issues/573) would be greatly appreciated.
Here is what Authelia's portal looks like: Here is what Authelia's portal looks like:
<p align="center"> <p align="center">