cfg/bin/aur2repo
Knut Ahlers 7238e2c96e
Remove repo download
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-10-19 19:00:23 +02:00

37 lines
831 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
source ${HOME}/bin/script_framework.sh
REPO_DIR=${REPO_DIR:-/home/luzifer/tmp/archrepo}
PACKAGE=${1:-}
[ -z "${PACKAGE}" ] && fail "No package given as CLI argument"
# Create working dir
TMPDIR="/tmp/aur2repo_${PACKAGE}"
mkdir -p "${TMPDIR}/cfg"
# Ensure cleanup on script exit
function cleanup() {
rm -rf "${TMPDIR}"
}
trap cleanup EXIT
step "Fetching signing key"
vault read --field=key secret/jenkins/arch-signing >"${TMPDIR}/cfg/signing.asc"
step "Re-fetching Docker image"
docker pull luzifer/arch-repo-builder
step "Building AUR package"
docker run --rm -ti \
-v "${TMPDIR}/src:/src" \
-v "${TMPDIR}/cfg:/config" \
-v "${REPO_DIR}:/repo" \
luzifer/arch-repo-builder \
"https://aur.archlinux.org/${PACKAGE}.git"
step "Synchronizing repository changes"
cd "${REPO_DIR}"
make upload