Skip to content

Commit

Permalink
README: Document check/publish hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswestman authored and barthalion committed Feb 7, 2023
1 parent 14b2834 commit 2262372
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@ The source repository contains an `example.env` and an
cp example-config.json config.json
# edit config.json

### Hooks

flat-manager can be configured to run hook scripts during the upload
and publish processes. These are configured per-repository in the
config file; see `example-config.json`.

The publish hook runs in the build directory before a build is published
to a main repository. It can modify the build, for example by rewriting
the appstream files in the commits.

Check scripts are run after a build is uploaded. Builds may not be
published unless all checks have passed. The check is marked as failed
if the command exits with a nonzero code (or marked as requiring review
if `"reviewable": true` is set).

Check scripts may also set their own status via the flat-manager API,
though this will be overridden if the command exits with a nonzero code.
To facilitate this, check scripts are run with `FLAT_MANAGER_BUILD_ID` and
`FLAT_MANAGER_JOB_ID` environment variables to pass to the API. The same
endpoint can be used by other systems for manual reviews.

## Database

flat-manager uses a PostgreSQL database to store information, and
Expand Down
9 changes: 9 additions & 0 deletions example-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
"suggested-repo-name": "testrepo-beta",
"runtime-repo-url": "https://dl.flathub.org/repo/flathub.flatpakrepo",
"gpg-key": null,
"hooks": {
"publish": ["true"],
"checks": {
"example-check": {
"command": ["true"],
"reviewable": true
}
}
},
"subsets": {
"all": {
"collection-id": "org.test.Beta",
Expand Down

0 comments on commit 2262372

Please sign in to comment.