diff --git a/yume-mods/misskey-auto-deploy/src/lib.rs b/yume-mods/misskey-auto-deploy/src/lib.rs index d23c209f94..93f3ae5153 100644 --- a/yume-mods/misskey-auto-deploy/src/lib.rs +++ b/yume-mods/misskey-auto-deploy/src/lib.rs @@ -49,6 +49,7 @@ pub struct RefConfig { pub stdout: Option, pub stderr: Option, pub working_dir: PathBuf, + pub profiles: Option>, pub compose_flags: Option>, pub env: Option>, pub uid: u32, @@ -200,6 +201,17 @@ impl App { let mut command = Command::new("docker") .arg("compose") + .args( + matched_ref + .config + .profiles + .as_ref() + .map(|profiles| + profiles.iter() + .flat_map(|profiles| ["--profile", profiles.as_str()]) + .collect::>()) + .unwrap_or(Vec::new()), + ) .arg("up") .arg("--detach") .arg("--build") @@ -289,7 +301,7 @@ impl App { State(state): State, Query(query): Query, ) -> Result, ApiError> { - let ref_ = match (&query.ref_, &query.branch) { + let ref_ = match (query.ref_.as_ref(), query.branch.as_ref()) { (Some(ref_), None) => ref_.clone(), (None, Some(branch)) => format!("refs/heads/{}", branch), _ => {