Skip to content

Commit

Permalink
feat: allow setting extra pushpkg options from environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
KexyBiscuit committed Jul 31, 2024
1 parent c2a5650 commit 531d31b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Steps (as root):
2. `cd /buildroots/buildit && git clone https://github.com/AOSC-Dev/buildit`
3. `cd /buildroots/buildit && ciel new` with maintainer called `AOSC OS Maintainers <[email protected]>`, making sure to create an instance named "main" when asked
4. `cp /buildroots/buildit/buildit/systemd/buildit-worker.service /etc/systemd/system`
5. `$EDITOR /etc/systemd/system/buildit-worker.service`:update ARCH
6. `$EDITOR /buildroots/buildit/buildit/.env`: set BUILDIT_SERVER, BUILDIT_WORKER_SECRET BUILDIT_SSH_KEY and BUILDIT_WORKER_PERFORMANCE; for workers in China, optionally update BUILDIT_RSYNC_HOST to repo-cn.aosc.io
5. `$EDITOR /etc/systemd/system/buildit-worker.service`:update `ARCH`
6. `$EDITOR /buildroots/buildit/buildit/.env`: set `BUILDIT_SERVER`, `BUILDIT_WORKER_SECRET` `BUILDIT_SSH_KEY` and `BUILDIT_WORKER_PERFORMANCE`; for workers in China, optionally update `BUILDIT_RSYNC_HOST` to `repo-cn.aosc.io`; for workers with special network environments, optionally set `BUILDIT_PUSHPKG_OPTIONS`
7. `systemctl enable --now buildit-worker`
8. `chmod 600 /buildroots/buildit/buildit/.env`
9. Generate a new SSH key at the location of BUILDIT_SSH_KEY, and setup authorized_keys on repo.aosc.io (contact infra team)
9. Generate a new SSH key at the location of `BUILDIT_SSH_KEY`, and setup `authorized_keys` on repo.aosc.io (contact infra team)
10. Add SSH known hosts from repo.aosc.io, repo-cn.aosc.io and github.com: `ssh-keyscan repo.aosc.io >> ~/.ssh/known_hosts && ssh-keyscan repo-cn.aosc.io >> ~/.ssh/known_hosts && ssh-keyscan github.com >> ~/.ssh/known_hosts`

Arch-specific notes:
Expand Down
1 change: 1 addition & 0 deletions worker/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ async fn build(
&args.rsync_host,
"-i",
upload_ssh_key,
&args.pushpkg_options,
"maintainers",
&job.git_branch,
];
Expand Down
9 changes: 9 additions & 0 deletions worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ pub struct Args {
)]
pub rsync_host: String,

/// pushpkg extra options
#[arg(
short,
long,
default_value = "",
env = "BUILDIT_PUSHPKG_OPTIONS"
)]
pub pushpkg_options: String,

/// Performance number of the worker (smaller is better)
#[arg(short = 'p', long, env = "BUILDIT_WORKER_PERFORMANCE")]
pub worker_performance: Option<i64>,
Expand Down

0 comments on commit 531d31b

Please sign in to comment.