From 6a3435f2bf537ba6ac5a52e17f5f87735a03fd53 Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Sat, 7 Jun 2025 02:13:55 +0300 Subject: [PATCH] CI: PostmarketOS: use env instead fo hardcoded vars Signed-off-by: Vasiliy Doylov --- .forgejo/workflows/pmbootstrap.yaml | 6 +++--- compose.yml | 4 +++- pmb/env | 5 +++++ pmb/pmbootstrap | 2 +- pmb/setup | 7 +++++++ setup-runner | 2 +- 6 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 pmb/env diff --git a/.forgejo/workflows/pmbootstrap.yaml b/.forgejo/workflows/pmbootstrap.yaml index 1141de7..ae64bef 100644 --- a/.forgejo/workflows/pmbootstrap.yaml +++ b/.forgejo/workflows/pmbootstrap.yaml @@ -10,16 +10,16 @@ jobs: runs-on: Pmbootstrap steps: - name: Pull pmbootstrap from mirror - run: cd /data/pmbootstrap && git fetch && git reset --hard origin/master + run: cd ${{env.PMB_PMBOOTSTRAP}} && git fetch && git reset --hard origin/master pull-pmaports: name: Update PostamrketOS aports runs-on: Pmbootstrap steps: - name: Pull pmaports from mirror - run: cd /data/pmaports && git fetch && git reset --hard origin/master + run: cd ${{env.PMB_PMAPORTS}} && git fetch && git reset --hard origin/master pull-aports: name: Update Alpine aports runs-on: Pmbootstrap steps: - name: Pull aports from mirror - run: cd /data/aports && git fetch && git reset --hard origin/master + run: cd ${{env.PMB_APORTS}} && git fetch && git reset --hard origin/master diff --git a/compose.yml b/compose.yml index 484d93b..b13e4c0 100644 --- a/compose.yml +++ b/compose.yml @@ -27,5 +27,7 @@ services: - ./conf/pmb/:/conf - ./pmb/setup:/setup-pmbootstrap - ./pmb/pmbootstrap:/usr/bin/pmbootstrap - - ./pmb/pmbootstrap.conf:/pmbootstrap.conf + - ./pmb/pmbootstrap.cfg:/pmbootstrap.cfg + - ./pmb/env:/data/.env command: "/setup-pmbootstrap" + privileged: true diff --git a/pmb/env b/pmb/env new file mode 100644 index 0000000..d1883e5 --- /dev/null +++ b/pmb/env @@ -0,0 +1,5 @@ +PMB_DATA="/data" +PMB_PMBOOTSTRAP=$PMB_DATA"/pmbootstrap" +PMB_PMAPORTS=$PMB_DATA"/pmaports" +PMB_APORTS=$PMB_DATA"/aports" +PMB_WORK=$PMB_DATA"/work" diff --git a/pmb/pmbootstrap b/pmb/pmbootstrap index 877f601..620b400 100755 --- a/pmb/pmbootstrap +++ b/pmb/pmbootstrap @@ -1,2 +1,2 @@ #!/bin/sh -exec /data/pmbootstrap/pmbootstrap.py -c /pmbootstrap.cfg -p /data/pmaports -w /data/work -y "$@" +exec /data/pmbootstrap/pmbootstrap.py -c /pmbootstrap.cfg --aports /data/pmaports -w /data/work --details-to-stdout --as-root "$@" diff --git a/pmb/setup b/pmb/setup index 378696f..ababa0d 100755 --- a/pmb/setup +++ b/pmb/setup @@ -1,6 +1,13 @@ #!/bin/sh /setup-runner +apk add python3 losetup cmd:kpartx openssl git clone https://git.nekocwd.duckdns.org/Mirror/pmbootstrap /data/pmbootstrap || true git clone https://git.nekocwd.duckdns.org/Mirror/pmaports /data/pmaports || true git clone https://git.nekocwd.duckdns.org/Mirror/aports /data/aports || true +git -C /data/pmaports remote add postmarketos https://gitlab.postmarketos.org/postmarketOS/pmaports.git || true +git -C /data/pmaports fetch postmarketos --depth=1 -f || true +yes '' | pmbootstrap init +pmbootstrap config mirrors.alpine https://mirror.nekocwd.duckdns.org/alpine/ +pmbootstrap config mirrors.pmaports https://mirror.nekocwd.duckdns.org/postmarketos/ +pmbootstrap config mirrors.systemd https://mirror.nekocwd.duckdns.org/postmarketos/extra-repos/systemd/ /run-runner diff --git a/setup-runner b/setup-runner index 264bbee..8ccd69a 100755 --- a/setup-runner +++ b/setup-runner @@ -5,4 +5,4 @@ if [ ! -e /conf/config.yaml ]; then forgejo-runner generate-config > /conf/config.yaml forgejo-runner register -c /conf/config.yaml --no-interactive --instance $INSTANCE --labels $LABELS --name $NAME --token $TOKEN fi -apk add nodejs git # For basic checkout action +apk add nodejs git curl # For basic checkout action