From 76c1a342b93ad9b27ac75117511946497997926c Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 10 Nov 2017 19:22:15 -0500 Subject: [PATCH] add a runner.identity to the cfg --- ofborg/src/config.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 550f668..4995d52 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -5,6 +5,7 @@ use std::io::Read; #[derive(Serialize, Deserialize, Debug)] pub struct Config { + pub runner: RunnerConfig, pub checkout: CheckoutConfig, pub nix: NixConfig, pub rabbitmq: RabbitMQConfig, @@ -24,11 +25,22 @@ pub struct NixConfig { pub remote: String, } +#[derive(Serialize, Deserialize, Debug)] +pub struct RunnerConfig { + pub identity: String, +} + #[derive(Serialize, Deserialize, Debug)] pub struct CheckoutConfig { pub root: String, } +impl Config { + pub fn whoami(&self) -> String { + return format!("{}-{}", self.runner.identity, self.nix.system); + } +} + impl RabbitMQConfig { pub fn as_uri(&self) -> String{