BPO development

Various resources on builds.postmarketos.org (bpo) development, which will be our future binary repository infrastructure. This article is only relevant for people who wish to contribute to that effort, it has nothing to do with running postmarketOS or creating packages for it.

Local development environment
These steps set up a local copy of bpo in docker, that runs against your username's namespace on the official builds.sr.ht instance.

Requirements

 * Register at builds.sr.ht
 * Install docker and docker-compose

Store package signing key in builds.sr.ht
Run  to generate a public and private key pair for signing packages. We will use the same private key on the bpo server. Open secrets and fill out the "add new secret" form on the left:


 * Name: "bpo test build key"
 * Secret: (put here the output of )
 * Secret Type: File
 * Path: ~/.secrets/build@postmarketos.org.priv
 * Mode: 644

Then click "Add secret". Note down the key it generated on the right (the string that looks like 46f739e5-4538-45dd-a79f-bf173b7a2ed9), you will need it in the next step.

Clone and configure
Open  in a text editor and change the following:
 * SRHT_SECRET_ID: the secret ID for your build key, as generated above
 * SRHT_TOKEN: generate a personal access token

Run the development environment
Build the custom bpo docker container and run it, together with MariaDB and phpMyAdmin docker containers:

You can access bpo at http://localhost and phpMyAdmin at http://localhost:8080 (login with:,  ).

Submitting a job
Open phpMyAdmin and open bpo / commit. Create a new entry:

Make sure that bpo is still running, and execute:

When something goes wrong, this will output a full html page. In that case, the error is in the tag, and you can see the whole thing with a stack trace and links to browse the code by opening the HTML page.

When it went right, a new job should appear on top of your personal builds.sr.ht start page.

Submitting the same job again

 * Remove the entry that appeared in the queue table
 * Now you can run api-task-submit.sh again

Changing the pmbootstrap branch
Pass the branch as argument to  here, e.g..

Status values for the "commits" table

 * INDEXING not running yet
 * BUILDING currently building on sr.ht
 * FAILED build failed on sr.ht
 * SUPERSEDED a job for a newer version of the package has been submitted
 * DONE everything build successfully