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_image BPO_WIP_REPO_URL: https://build.postmarketos.org/wip/ 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 - img_prepare: | export BPO_JOB_ID="$JOB_ID" IMG_DATE="$(date +%Y%m%d-%H%M)" echo "$IMG_DATE" > img-date # Image prefix format: # -postmarketOS---- UI_VERSION=$(grep "^pkgver=" "$(pmbootstrap config aports \ )"/main/postmarketos-ui-plasma-mobile/APKBUILD | cut -d= -f2) IMG_PREFIX="$IMG_DATE"-postmarketOS-edge-plasma-mobile IMG_PREFIX="$IMG_PREFIX"-"$UI_VERSION"-samsung-serranovelte echo "$IMG_PREFIX" > img-prefix pmbootstrap config ui plasma-mobile pmbootstrap config device samsung-serranovelte mkdir out - img_mainline_modem: | export BPO_JOB_ID="$JOB_ID" IMG_PREFIX=$(cat img-prefix)-mainline-modem pmbootstrap config kernel mainline-modem pmbootstrap -q -y zap -p printf "%s\n%s\n" 147147 147147 | pmbootstrap \ -m http://dl-2.alpinelinux.org/alpine/ \ -mp http://mirror.postmarketos.org/postmarketos/ \ --details-to-stdout \ install \ --no-local-pkgs sudo mv $(pmbootstrap config work)/chroot_native/home/pmos/rootfs/samsung-serranovelte.img \ "out/$IMG_PREFIX.img" ls -lh out - img_mainline_modem_bootimg: | export BPO_JOB_ID="$JOB_ID" IMG_PREFIX=$(cat img-prefix)-mainline-modem for i in $(pmbootstrap config work)/chroot_rootfs_samsung-serranovelte/boot/boot.img-*; do if [ -e "$i" ]; then sudo mv "$i" "out/$IMG_PREFIX-boot.img" fi done ls -lh out - compress: | export BPO_JOB_ID="$JOB_ID" sudo chown "$(id -u):$(id -g)" out/*.img for i in out/*.img; do xz -0 -T0 "$i" done ls -lh out - checksums: | export BPO_JOB_ID="$JOB_ID" cd out sha512sum * - submit: | export BPO_JOB_ID="$JOB_ID" export BPO_API_ENDPOINT="build-image" export BPO_ARCH="" export BPO_BRANCH=master export BPO_DEVICE=samsung-serranovelte export BPO_UI=plasma-mobile export BPO_PAYLOAD_FILES="$(find out -type f)" export BPO_PAYLOAD_IS_JSON="0" export BPO_PKGNAME="" export BPO_VERSION="$(cat img-date)" # Always run submit.py with exec, because when running locally, the # current_task.sh script can change before submit.py completes! exec build.postmarketos.org/helpers/submit.py