chore: make all configuration parts cloneable
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
7c8814118b
commit
3a9d7cceb1
|
@ -10,12 +10,12 @@ use std::path::{Path, PathBuf};
|
||||||
use serde::de::{self, Deserialize, Deserializer};
|
use serde::de::{self, Deserialize, Deserializer};
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub enum VCSConfig {
|
pub enum VCSConfig {
|
||||||
Gerrit,
|
Gerrit,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub runner: RunnerConfig,
|
pub runner: RunnerConfig,
|
||||||
pub feedback: FeedbackConfig,
|
pub feedback: FeedbackConfig,
|
||||||
|
@ -31,7 +31,7 @@ pub struct Config {
|
||||||
pub gerrit: Option<GerritConfig>,
|
pub gerrit: Option<GerritConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct FeedbackConfig {
|
pub struct FeedbackConfig {
|
||||||
pub full_logs: bool,
|
pub full_logs: bool,
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ pub struct RabbitMqConfig {
|
||||||
pub password_file: Option<PathBuf>,
|
pub password_file: Option<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct NixConfig {
|
pub struct NixConfig {
|
||||||
#[serde(deserialize_with = "deserialize_one_or_many")]
|
#[serde(deserialize_with = "deserialize_one_or_many")]
|
||||||
pub system: Vec<String>,
|
pub system: Vec<String>,
|
||||||
|
@ -93,7 +93,7 @@ const fn default_instance() -> u8 {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct RunnerConfig {
|
pub struct RunnerConfig {
|
||||||
#[serde(default = "default_instance")]
|
#[serde(default = "default_instance")]
|
||||||
pub instance: u8,
|
pub instance: u8,
|
||||||
|
@ -112,7 +112,7 @@ pub struct RunnerConfig {
|
||||||
pub build_all_jobs: Option<bool>,
|
pub build_all_jobs: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct CheckoutConfig {
|
pub struct CheckoutConfig {
|
||||||
#[serde(deserialize_with = "deserialize_and_expand_string")]
|
#[serde(deserialize_with = "deserialize_and_expand_string")]
|
||||||
pub root: String,
|
pub root: String,
|
||||||
|
|
Loading…
Reference in a new issue