image: alpine/latest packages: - coreutils - procps - py3-requests - xz sources: - "https://gitlab.com/postmarketOS/pmaports.git/" - "https://gitlab.com/postmarketOS/pmbootstrap.git/" - "https://gitlab.com/postmarketOS/build.postmarketos.org.git/" environment: BPO_TOKEN_FILE: "/home/build/.token" BPO_API_HOST: https://build.postmarketos.org BPO_JOB_NAME: build_package BPO_WIP_REPO_URL: https://build.postmarketos.org/wip/master/ BPO_WIP_REPO_ARG: '-mp http://build.postmarketos.org/wip/' secrets: - 482975ec-22f7-49fd-9b54-486b0b1947c3 triggers: - action: webhook condition: failure url: https://build.postmarketos.org/api/public/update-job-status tasks: - bpo_setup: | export BPO_JOB_ID="$JOB_ID" # Switch branch and release channel mkdir -p ~/.config ( echo "[pmbootstrap]" echo "is_default_channel = False" ) > ~/.config/pmbootstrap.cfg git -C pmaports checkout master sudo ln -s "$PWD"/pmbootstrap/pmbootstrap.py /usr/bin/pmbootstrap yes "" | pmbootstrap --aports=$PWD/pmaports -q init sudo modprobe binfmt_misc sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc branch="$(git -C pmaports rev-parse --abbrev-ref HEAD)" if [ "$branch" != master ]; then echo "ERROR: pmbootstrap switched to the wrong branch: $branch" exit 1 fi # Put apk cache into tmpfs to use less disk space (pma#1623) sudo mkdir -p /mnt/tmpfs-for-apks sudo mount -t tmpfs -o size=1500M tmpfs /mnt/tmpfs-for-apks WORK="$(pmbootstrap config work)" for arch in x86_64 aarch64 armv7 armhf x86 riscv64; do mkdir -p /mnt/tmpfs-for-apks/cache_apk_"$arch" rm -rf "$WORK"/cache_apk_"$arch" ln -s /mnt/tmpfs-for-apks/cache_apk_"$arch" "$WORK" done - install_pubkey: | export BPO_JOB_ID="$JOB_ID" echo -n '-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnFsP5NKYRgJZxXkPG1JA 2IM1kZjfJZAMBzWoN9Q68D3FWErRbQWn7+Im0ifmHH/zms5kKaaaRNRLjTjrmf3y kFrJQNhqCvEfZcWz/nvH+tsoGk8/b5fm6+W2hRh8JZpXs/aXR8YeAhB34U4moYol Zxw9VVbUKeoZGgO6JHnm3aFBoODg26m5yqcZdJFuuDbci8q3I4RqojppYOXr/q4F o3m8FNcvdKBb6uOCucyDKXqBSZE7KTYHKFT76w0D7EJLVteanhRqzX2D5UGvei5M SrjiQWm5tv92IS1wdRRgdHoEQ2fTRxV9ps4gatfY3Gz7UkfbnORcxFSSclOl1XCw VQIDAQAB -----END PUBLIC KEY----- ' > pmbootstrap/pmb/data/keys/wip.rsa.pub - pmbootstrap_build: | export BPO_JOB_ID="$JOB_ID" pmbootstrap \ -m http://dl-cdn.alpinelinux.org/alpine/ $BPO_WIP_REPO_ARG -mp http://mirror.postmarketos.org/postmarketos/ \ --aports=$PWD/pmaports \ --no-ccache \ --timeout 900 \ --details-to-stdout \ build \ --no-depends \ --strict \ --arch aarch64 \ --force \ device-samsung-grandpplte - checksums: | export BPO_JOB_ID="$JOB_ID" cd "$(pmbootstrap -q config work)/packages/" sha512sum $(find . -name '*.apk') - submit: | export BPO_JOB_ID="$JOB_ID" export BPO_API_ENDPOINT="build-package" export BPO_ARCH=aarch64 export BPO_BRANCH=master export BPO_DEVICE="" packages="$(pmbootstrap -q config work)/packages" export BPO_PAYLOAD_FILES="$(find "$packages" -name '*.apk')" export BPO_PAYLOAD_FILES_PREVIOUS="" export BPO_PAYLOAD_IS_JSON="0" export BPO_PKGNAME=device-samsung-grandpplte export BPO_UI="" export BPO_VERSION=2-r3 exec build.postmarketos.org/helpers/submit.py