authelia/.buildkite/steps/aurhelper.sh
vdot0x23 6ccc92e47e
do not hardcode /bin/bash (#1122)
Co-authored-by: Victor Büttner <victor@0x23.dk>
Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-06-18 09:49:13 +02:00

25 lines
857 B
Bash
Executable File

#! /usr/bin/env 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 && \
sed -i "/pkgrel=/c\pkgrel=1" PKGBUILD && \
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && updpkgsums"
else
sed -i "/pkgver=/c\pkgver=${GITTAG}" PKGBUILD && \
sed -i "/pkgrel=/c\pkgrel=1" 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