mirror of
https://github.com/moghtech/komodo.git
synced 2025-12-05 19:17:36 -06:00
validate compose_cmd_wrapper for required placeholder and add interpolation support (#977)
This commit is contained in:
@@ -670,6 +670,13 @@ impl Resolve<super::Args> for ComposeUp {
|
||||
let compose_cmd_wrapper =
|
||||
parse_multiline_command(&stack.config.compose_cmd_wrapper);
|
||||
if !compose_cmd_wrapper.is_empty() {
|
||||
if !compose_cmd_wrapper.contains("[[COMPOSE_COMMAND]]") {
|
||||
res.logs.push(Log::error(
|
||||
"Compose Command Wrapper",
|
||||
"compose_cmd_wrapper is configured but does not contain [[COMPOSE_COMMAND]] placeholder. The placeholder is required to inject the compose command.".to_string(),
|
||||
));
|
||||
return Ok(res);
|
||||
}
|
||||
command =
|
||||
compose_cmd_wrapper.replace("[[COMPOSE_COMMAND]]", &command);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ impl<'a> Interpolator<'a> {
|
||||
.interpolate_string(&mut stack.config.environment)?
|
||||
.interpolate_string(&mut stack.config.pre_deploy.command)?
|
||||
.interpolate_string(&mut stack.config.post_deploy.command)?
|
||||
.interpolate_string(&mut stack.config.compose_cmd_wrapper)?
|
||||
.interpolate_extra_args(&mut stack.config.extra_args)?
|
||||
.interpolate_extra_args(&mut stack.config.build_extra_args)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user