Add an option for dev time: always build all jobs
This commit is contained in:
parent
bebe197643
commit
f971b7b22d
|
@ -51,21 +51,38 @@ fn main() {
|
|||
})
|
||||
.unwrap();
|
||||
|
||||
channel
|
||||
.declare_queue(easyamqp::QueueConfig {
|
||||
queue: format!("build-inputs-{}", cfg.nix.system.clone()),
|
||||
passive: false,
|
||||
durable: true,
|
||||
exclusive: false,
|
||||
auto_delete: false,
|
||||
no_wait: false,
|
||||
arguments: None,
|
||||
})
|
||||
.unwrap();
|
||||
let queue_name: String;
|
||||
if cfg.runner.build_all_jobs != Some(true) {
|
||||
queue_name = channel
|
||||
.declare_queue(easyamqp::QueueConfig {
|
||||
queue: format!("build-inputs-{}", cfg.nix.system.clone()),
|
||||
passive: false,
|
||||
durable: true,
|
||||
exclusive: false,
|
||||
auto_delete: false,
|
||||
no_wait: false,
|
||||
arguments: None,
|
||||
})
|
||||
.unwrap().queue;
|
||||
} else {
|
||||
warn!("Building all jobs, please don't use this unless you're");
|
||||
warn!("developing and have Graham's permission!");
|
||||
queue_name = channel
|
||||
.declare_queue(easyamqp::QueueConfig {
|
||||
queue: "".to_owned(),
|
||||
passive: false,
|
||||
durable: false,
|
||||
exclusive: true,
|
||||
auto_delete: true,
|
||||
no_wait: false,
|
||||
arguments: None,
|
||||
})
|
||||
.unwrap().queue;
|
||||
}
|
||||
|
||||
channel
|
||||
.bind_queue(easyamqp::BindQueueConfig {
|
||||
queue: format!("build-inputs-{}", cfg.nix.system.clone()),
|
||||
queue: queue_name.clone(),
|
||||
exchange: "build-jobs".to_owned(),
|
||||
routing_key: None,
|
||||
no_wait: false,
|
||||
|
@ -82,7 +99,7 @@ fn main() {
|
|||
cfg.runner.identity.clone(),
|
||||
)),
|
||||
easyamqp::ConsumeConfig {
|
||||
queue: format!("build-inputs-{}", cfg.nix.system.clone()),
|
||||
queue: queue_name.clone(),
|
||||
consumer_tag: format!("{}-builder", cfg.whoami()),
|
||||
no_local: false,
|
||||
no_ack: false,
|
||||
|
@ -93,6 +110,7 @@ fn main() {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
println!("Fetching jobs from {}", &queue_name);
|
||||
channel.start_consuming();
|
||||
channel.close(200, "Bye").unwrap();
|
||||
println!("Closed the channel");
|
||||
|
|
|
@ -62,6 +62,14 @@ pub struct RunnerConfig {
|
|||
pub repos: Option<Vec<String>>,
|
||||
pub trusted_users: Option<Vec<String>>,
|
||||
pub known_users: Option<Vec<String>>,
|
||||
|
||||
/// If true, will create its own queue attached to the build job
|
||||
/// exchange. This means that builders with this enabled will
|
||||
/// trigger duplicate replies to the request for this
|
||||
/// architecture.
|
||||
///
|
||||
/// This should only be turned on for development.
|
||||
pub build_all_jobs: Option<bool>
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
Loading…
Reference in a new issue