Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ pub fn get_example_config() -> GitLabRunnersConfig {
runner: gitlab_config::Runner {
builds_dir: "$HOME/builds/$NAME/".into(),
cache_dir: "$HOME/cache/".into(),
output_limit: None,
executor: gitlab_config::Executor::Custom {
custom: gitlab_config::CustomExecutor {
config_exec: "$THIS".into(),
Expand Down
4 changes: 3 additions & 1 deletion src/gitlab_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ pub struct Runner {
pub builds_dir: String,
/// Directory to use for build caches, will be variable-expanded
pub cache_dir: String,
#[serde(flatten)]
/// How many kilobytes of output to collect, will NOT be variable-expanded
pub output_limit: Option<u64>,
/// The executor to use for this runner
#[serde(flatten)]
pub executor: Executor,
/// Additional environment variables, will be variable-expanded
pub environment: Option<Vec<String>>,
Expand Down
5 changes: 5 additions & 0 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub fn expand_runner_config_template(
Ok(Runner {
builds_dir: string_expand(&config.builds_dir).context("builds_dir")?,
cache_dir: string_expand(&config.cache_dir).context("cache_dir")?,
output_limit: config.output_limit.clone(),
environment: config
.environment
.as_ref()
Expand Down Expand Up @@ -269,6 +270,7 @@ mod tests {
let config = gitlab_config::Runner {
builds_dir: "~/$FOO/$NAME".into(),
cache_dir: "$PWD/$BAR".into(),
output_limit: Some(10),
executor: gitlab_config::Executor::Custom {
custom: gitlab_config::CustomExecutor {
config_exec: "$THIS".into(),
Expand Down Expand Up @@ -311,6 +313,7 @@ mod tests {
let expanded = expanded.unwrap();
assert_eq!(expanded.builds_dir, format!("{}/foo/name", home));
assert_eq!(expanded.cache_dir, format!("{}/bar", workdir));
assert_eq!(expanded.output_limit, Some(10));
assert_eq!(expanded.environment, Some(vec!["baz".to_owned()]));
match expanded.executor {
Executor::Custom { custom } => {
Expand Down Expand Up @@ -343,6 +346,7 @@ mod tests {
runner: Runner {
builds_dir,
cache_dir: "".into(),
output_limit: None,
executor: Executor::Custom {
custom: CustomExecutor {
config_exec: "".into(),
Expand Down Expand Up @@ -499,6 +503,7 @@ mod tests {
runner: Runner {
builds_dir: "".into(),
cache_dir: "".into(),
output_limit: None,
executor: Executor::Custom {
custom: CustomExecutor {
config_exec: "".into(),
Expand Down