[Buildkite] Automate CD for AUR packages (#644)
* [Buildkite] Automate continuous deployment for AUR packages * [Buildkite] Make AUR deploy step conditionalpull/645/head
parent
d80becc343
commit
447b2461e4
|
@ -17,4 +17,9 @@ steps:
|
|||
command: ".buildkite/steps/ghartifacts.sh"
|
||||
agents:
|
||||
upload: "fast"
|
||||
key: "artifacts"
|
||||
if: build.tag != null
|
||||
|
||||
- label: ":linux: Deploy AUR"
|
||||
command: ".buildkite/steps/aurpackages.sh | buildkite-agent pipeline upload"
|
||||
if: build.tag != null || build.branch == "master"
|
|
@ -0,0 +1,23 @@
|
|||
#! /bin/bash
|
||||
|
||||
GITTAG=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
|
||||
|
||||
echo "--- :linux: Deploy AUR package: ${PACKAGE}"
|
||||
git clone ssh://aur@aur.archlinux.org/"${PACKAGE}".git
|
||||
cd "${PACKAGE}" || exit
|
||||
|
||||
if [[ $PACKAGE != "authelia-git" ]]; then
|
||||
sed -i "/pkgver=/c\pkgver=${BUILDKITE_TAG//v/}" PKGBUILD && \
|
||||
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && updpkgsums"
|
||||
else
|
||||
sed -i "/pkgver=/c\pkgver=${GITTAG}" PKGBUILD
|
||||
fi
|
||||
|
||||
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && makepkg --printsrcinfo >| .SRCINFO" && \
|
||||
git add . && \
|
||||
if [[ $PACKAGE != "authelia-git" ]]; then
|
||||
git commit -m "Update to ${BUILDKITE_TAG}"
|
||||
else
|
||||
git commit -m "Update to GIT version: ${GITTAG}"
|
||||
fi
|
||||
git push
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
for AUR_PACKAGE in authelia authelia-bin authelia-git;
|
||||
do
|
||||
echo " - label: \":linux: Deploy AUR Package [${AUR_PACKAGE}]\""
|
||||
echo " commands:"
|
||||
echo " - \"aurhelper.sh\""
|
||||
echo " agents:"
|
||||
echo " upload: \"fast\""
|
||||
echo " env:"
|
||||
echo " "PACKAGE: ${AUR_PACKAGE}""
|
||||
if [[ "${AUR_PACKAGE}" != "authelia-git" ]]; then
|
||||
echo " depends_on:"
|
||||
echo " - \"artifacts\""
|
||||
echo " if: build.tag != null"
|
||||
else
|
||||
echo " if: build.branch == \"master\""
|
||||
fi
|
||||
done
|
|
@ -7,7 +7,7 @@ do
|
|||
echo " - \"authelia-scripts docker push-image --arch=${BUILD_ARCH}\""
|
||||
echo " label: \":docker: Deploy Image [${BUILD_ARCH}]\""
|
||||
echo " agents:"
|
||||
echo " "upload: fast""
|
||||
echo " upload: \"fast\""
|
||||
echo " env:"
|
||||
echo " "ARCH: ${BUILD_ARCH}""
|
||||
done
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export PATH=$PATH:./cmd/authelia-scripts/:./node_modules/.bin:/tmp
|
||||
export PATH=$PATH:./cmd/authelia-scripts/:./.buildkite/steps/:./node_modules/.bin:/tmp
|
||||
|
||||
if [[ -z "$OLD_PS1" ]]; then
|
||||
OLD_PS1="$PS1"
|
||||
|
|
Loading…
Reference in New Issue