Skip to content

Commit 2262372

Browse files
jameswestmanbarthalion
authored andcommitted
README: Document check/publish hooks
1 parent 14b2834 commit 2262372

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ The source repository contains an `example.env` and an
4747
cp example-config.json config.json
4848
# edit config.json
4949

50+
### Hooks
51+
52+
flat-manager can be configured to run hook scripts during the upload
53+
and publish processes. These are configured per-repository in the
54+
config file; see `example-config.json`.
55+
56+
The publish hook runs in the build directory before a build is published
57+
to a main repository. It can modify the build, for example by rewriting
58+
the appstream files in the commits.
59+
60+
Check scripts are run after a build is uploaded. Builds may not be
61+
published unless all checks have passed. The check is marked as failed
62+
if the command exits with a nonzero code (or marked as requiring review
63+
if `"reviewable": true` is set).
64+
65+
Check scripts may also set their own status via the flat-manager API,
66+
though this will be overridden if the command exits with a nonzero code.
67+
To facilitate this, check scripts are run with `FLAT_MANAGER_BUILD_ID` and
68+
`FLAT_MANAGER_JOB_ID` environment variables to pass to the API. The same
69+
endpoint can be used by other systems for manual reviews.
70+
5071
## Database
5172

5273
flat-manager uses a PostgreSQL database to store information, and

example-config.json

+9
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
"suggested-repo-name": "testrepo-beta",
2525
"runtime-repo-url": "https://dl.flathub.org/repo/flathub.flatpakrepo",
2626
"gpg-key": null,
27+
"hooks": {
28+
"publish": ["true"],
29+
"checks": {
30+
"example-check": {
31+
"command": ["true"],
32+
"reviewable": true
33+
}
34+
}
35+
},
2736
"subsets": {
2837
"all": {
2938
"collection-id": "org.test.Beta",

0 commit comments

Comments
 (0)