diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 671c131..8251eab 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -51,7 +51,12 @@ fn main() { channel.basic_prefetch(1).unwrap(); channel.basic_consume( - worker::new(tasks::build::BuildWorker::new(cloner, nix, cfg.nix.system.clone())), + worker::new(tasks::build::BuildWorker::new( + cloner, + nix, + cfg.nix.system.clone(), + cfg.runner.identity.clone() + )), format!("build-inputs-{}", cfg.nix.system.clone()).as_ref(), format!("{}-builder", cfg.whoami()).as_ref(), false, diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 967a40b..8d3f376 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -20,14 +20,16 @@ pub struct BuildWorker { cloner: checkout::CachedCloner, nix: nix::Nix, system: String, + identity: String, } impl BuildWorker { - pub fn new(cloner: checkout::CachedCloner, nix: nix::Nix, system: String) -> BuildWorker { + pub fn new(cloner: checkout::CachedCloner, nix: nix::Nix, system: String, identity: String) -> BuildWorker { return BuildWorker{ cloner: cloner, nix: nix, system: system, + identity: identity, }; } @@ -54,9 +56,10 @@ impl worker::SimpleWorker for BuildWorker { } fn consumer(&self, job: &buildjob::BuildJob) -> worker::Actions { + info!("Working on {}", job.pr.number); let project = self.cloner.project(job.repo.full_name.clone(), job.repo.clone_url.clone()); let co = project.clone_for("builder".to_string(), - job.pr.number.to_string()).unwrap(); + self.identity.clone()).unwrap(); let target_branch = match job.pr.target_branch.clone() { Some(x) => { x }