autodeploy add profiles
All checks were successful
Test (production install and build) / production (20.16.0) (push) Successful in 1m35s
Publish Docker image / Build (push) Successful in 4m46s

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-10 00:10:52 -06:00
parent 5aef6a6238
commit ffd5c9066d
No known key found for this signature in database

View file

@ -49,6 +49,7 @@ pub struct RefConfig {
pub stdout: Option<PathBuf>, pub stdout: Option<PathBuf>,
pub stderr: Option<PathBuf>, pub stderr: Option<PathBuf>,
pub working_dir: PathBuf, pub working_dir: PathBuf,
pub profiles: Option<Vec<String>>,
pub compose_flags: Option<Vec<String>>, pub compose_flags: Option<Vec<String>>,
pub env: Option<HashMap<String, String>>, pub env: Option<HashMap<String, String>>,
pub uid: u32, pub uid: u32,
@ -200,6 +201,17 @@ impl App {
let mut command = Command::new("docker") let mut command = Command::new("docker")
.arg("compose") .arg("compose")
.args(
matched_ref
.config
.profiles
.as_ref()
.map(|profiles|
profiles.iter()
.flat_map(|profiles| ["--profile", profiles.as_str()])
.collect::<Vec<_>>())
.unwrap_or(Vec::new()),
)
.arg("up") .arg("up")
.arg("--detach") .arg("--detach")
.arg("--build") .arg("--build")
@ -289,7 +301,7 @@ impl App {
State(state): State<AppState>, State(state): State<AppState>,
Query(query): Query<GetStatusQuery>, Query(query): Query<GetStatusQuery>,
) -> Result<Json<RefStatus>, ApiError> { ) -> Result<Json<RefStatus>, ApiError> {
let ref_ = match (&query.ref_, &query.branch) { let ref_ = match (query.ref_.as_ref(), query.branch.as_ref()) {
(Some(ref_), None) => ref_.clone(), (Some(ref_), None) => ref_.clone(),
(None, Some(branch)) => format!("refs/heads/{}", branch), (None, Some(branch)) => format!("refs/heads/{}", branch),
_ => { _ => {