From ffd5c9066d16022ad2ae2e65484e722c5ca7ce32 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 10 Nov 2024 00:10:52 -0600 Subject: [PATCH] autodeploy add profiles Signed-off-by: eternal-flame-AD --- yume-mods/misskey-auto-deploy/src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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), _ => {