authelia/.buildkite/steps/aurhelper.sh
Amir Zarrinkafsh 7a0d217b67
[Buildkite] Reorder git fetch in pipeline (#697)
This will ensure that we always will have up-to-date refs for the repo post-checkout.
2020-03-09 16:53:13 +11:00

23 lines
759 B
Bash
Executable File

#! /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