forgejo-ci: setup pmos repo
Some checks failed
/ lint (pull_request) Failing after 26s
/ deploy-x86_64 (pull_request) Has been skipped
/ build-x86_64 (pull_request) Failing after 29s
/ build-aarch64 (pull_request) Failing after 52s
/ deploy-aarch64 (pull_request) Has been skipped

This commit is contained in:
Antoine Martin 2025-01-08 18:32:38 -05:00
parent edd6e26107
commit 5cf1478761
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/master}"
: "${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:=}"
@ -76,6 +78,9 @@ get_release() {
esac
}
get_release_pmos() {
}
build_aport() {
local repo="$1" aport="$2"
cd "$APORTSDIR/$repo/$aport"
@ -137,6 +142,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_REPO/$release >> /etc/apk/repositories"
doas apk update
}
sysinfo() {
printf ">>> Host system information (arch: %s, release: %s) <<<\n" "$ARCH" "$(get_release)"
printf "- Number of Cores: %s\n" "$(nproc)"
@ -144,6 +165,7 @@ sysinfo() {
printf "- Free space: %s\n" "$(df -hP / | awk '/\/$/ {print $4}')"
}
copy_artifacts() {
cd "$APORTSDIR"
@ -204,6 +226,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)