mirror of
https://github.com/Luzifer/archrepo.git
synced 2024-12-20 21:21:19 +00:00
34 lines
837 B
Bash
Executable file
34 lines
837 B
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
source ./scripts/script_framework.sh
|
|
|
|
REPO_DIR=${REPO_DIR:-$(pwd)}
|
|
|
|
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 gcr.io/luzifer-registry/arch-repo-builder
|
|
|
|
step "Building AUR package ${PACKAGE}"
|
|
docker run --rm -ti \
|
|
-v "${TMPDIR}/src:/src" \
|
|
-v "${TMPDIR}/cfg:/config" \
|
|
-v "${REPO_DIR}:/repo" \
|
|
-v "$(pwd)/scripts/pacman.conf:/etc/pacman.conf:ro" \
|
|
gcr.io/luzifer-registry/arch-repo-builder \
|
|
"https://aur.archlinux.org/${PACKAGE}.git"
|