-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jlebon/pr/add-config-bot
tree: add new config-bot service
- Loading branch information
Showing
5 changed files
with
535 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM registry.fedoraproject.org/fedora:30 | ||
|
||
RUN dnf -y install git python3-toml python3-aiohttp && dnf clean all | ||
|
||
COPY main /usr/lib/config-bot/main | ||
COPY config.toml /etc/config-bot.toml | ||
|
||
CMD /usr/lib/config-bot/main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# config-bot | ||
|
||
config-bot performs automated management tasks on the main | ||
[fedora-coreos-config](https://github.com/coreos/fedora-coreos-config) | ||
repo. | ||
|
||
It performs three closely related, but mostly independent | ||
functions. The names below reflect each of those functions. | ||
One can find their corresponding configuration section in | ||
`config.toml` and function names in `main`. | ||
|
||
1. `sync-build-lockfiles`: watches for new builds on a set | ||
of streams, and pushes the generated lockfile to their | ||
corresponding branches | ||
2. `promote-lockfiles`: on some configurable interval, | ||
pushes lockfiles from one config branch to another | ||
3. `propagate-files`: watches for pushes to a config branch | ||
and propagates changes to a subset of files to a set of | ||
target branches. | ||
|
||
All these are currently timer-based. In the future, they | ||
will use fedora-messaging for triggering. | ||
|
||
Similarly, for now all changes are done using `git push`. In | ||
the future, config-bot PR functionality can be added. | ||
|
||
## Testing locally | ||
|
||
Tweak settings as appropriate in `config.toml`, e.g.: | ||
- point to your fork of `fedora-coreos-config` | ||
- use your own GitHub token | ||
- you can comment out whole sections if you'd like to test a | ||
specific function only; e.g. if you only want to test | ||
`promote-lockfiles`, you can comment out | ||
`sync-build-lockfiles` and `propagate-files` | ||
|
||
Then: | ||
|
||
``` | ||
./main --config myconfig.toml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[git] | ||
author.name = 'CoreOS Bot' | ||
author.email = '[email protected]' | ||
github.repo.owner = 'coreos' | ||
github.repo.name = 'fedora-coreos-config' | ||
github.token.username = 'coreosbot' | ||
github.token.path = '/var/run/secrets/coreos.fedoraproject.org/github-token/token' | ||
|
||
[sync-build-lockfiles] | ||
builds-base-url = 'https://builds.coreos.fedoraproject.org/prod/streams' | ||
streams = [ | ||
'bodhi-updates', | ||
] | ||
trigger.mode = 'periodic' | ||
trigger.period = '15m' | ||
method = 'push' | ||
|
||
#[promote-lockfiles] | ||
#source-ref = 'bodhi-updates' | ||
#target-ref = 'testing-devel' | ||
#trigger.mode = 'periodic' | ||
#trigger.period = '24h' | ||
#method = 'push' | ||
|
||
[propagate-files] | ||
source-ref = 'testing-devel' | ||
target-refs = [ | ||
'bodhi-updates', | ||
] | ||
skip-files = [ | ||
'manifest.yaml', | ||
'manifest-lock.*', | ||
] | ||
trigger.mode = 'periodic' | ||
trigger.period = '15m' | ||
method = 'push' |
Oops, something went wrong.