forgejo-ci: add postmarketOS repo when building aport under pmos

This commit is contained in:
Antoine Martin 2025-01-08 18:42:10 -05:00
parent fafce64d02
commit 84135d1a99
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -7,7 +7,7 @@
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
readonly REPOS="backports user"
readonly REPOS="backports user pmos"
readonly ALPINE_REPOS="main community testing"
readonly ARCH=$(apk --print-arch)
# gitlab variables
@ -16,6 +16,8 @@ readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
: "${REPODEST:=$HOME/packages}"
: "${MIRROR:=https://ayakael.net/api/packages/forge/alpine}"
: "${ALPINE_MIRROR:=http://dl-cdn.alpinelinux.org/alpine}"
: "${PMOS_MIRROR:=http://mirror.postmarketos.org/postmarketos}"
: "${PMOS_KEY:=https://git.syndicate-lang.org/synit/pmbootstrap/raw/commit/8efee86388408c0d8de45c64fe383580ffd91700/pmb/data/keys/build.postmarketos.org.rsa.pub}"
: "${MAX_ARTIFACT_SIZE:=300000000}" #300M
: "${CI_DEBUG_BUILD:=}"
@ -137,6 +139,22 @@ setup_system() {
git config --global init.defaultBranch master
}
setup_pmos() {
local release
case $BASEBRANCH in
v3.21) release="v24.12";;
v3.20) release="v24.6";;
v3.19) release="v23.12";;
edge) release=master;;
*) die "Branch \"$BASEBRANCH\" not supported!"
esac
doas wget "$PMOS_KEY" -P /etc/apk/keys
doas sh -c "echo $PMOS_MIRROR/$release >> /etc/apk/repositories"
doas apk update || true
}
sysinfo() {
printf ">>> Host system information (arch: %s, release: %s) <<<\n" "$ARCH" "$(get_release)"
printf "- Number of Cores: %s\n" "$(nproc)"
@ -144,6 +162,7 @@ sysinfo() {
printf "- Free space: %s\n" "$(df -hP / | awk '/\/$/ {print $4}')"
}
copy_artifacts() {
cd "$APORTSDIR"
@ -204,6 +223,7 @@ build_limit=$CI_ALPINE_BUILD_LIMIT
for repo in $(changed_repos); do
set_repositories_for "$repo"
[ "$repo" == "pmos" ] && setup_pmos
built_aports=0
changed_aports_in_repo=$(changed_aports "$repo")
changed_aports_in_repo_count=$(echo "$changed_aports_in_repo" | wc -l)