forked from the-distro/ofborg
add a runner.identity to the cfg
This commit is contained in:
parent
e865b9164f
commit
76c1a342b9
|
@ -5,6 +5,7 @@ use std::io::Read;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
pub runner: RunnerConfig,
|
||||||
pub checkout: CheckoutConfig,
|
pub checkout: CheckoutConfig,
|
||||||
pub nix: NixConfig,
|
pub nix: NixConfig,
|
||||||
pub rabbitmq: RabbitMQConfig,
|
pub rabbitmq: RabbitMQConfig,
|
||||||
|
@ -24,11 +25,22 @@ pub struct NixConfig {
|
||||||
pub remote: String,
|
pub remote: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct RunnerConfig {
|
||||||
|
pub identity: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct CheckoutConfig {
|
pub struct CheckoutConfig {
|
||||||
pub root: String,
|
pub root: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Config {
|
||||||
|
pub fn whoami(&self) -> String {
|
||||||
|
return format!("{}-{}", self.runner.identity, self.nix.system);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
impl RabbitMQConfig {
|
impl RabbitMQConfig {
|
||||||
pub fn as_uri(&self) -> String{
|
pub fn as_uri(&self) -> String{
|
||||||
|
|
Loading…
Reference in a new issue