autodeploy add profiles
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
5aef6a6238
commit
ffd5c9066d
1 changed files with 13 additions and 1 deletions
|
@ -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),
|
||||||
_ => {
|
_ => {
|
||||||
|
|
Loading…
Reference in a new issue