Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow setting extra pushpkg options from environment variable #19

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading