Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli/deploy): Add --path flag #4861

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/cli/src/commands/app/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ the app:\n"
non_interactive: self.non_interactive,
publish_package: true,
dir: self.app_dir_path.clone(),
path: None,
no_wait: self.no_wait,
no_default: false,
no_persist_id: false,
Expand Down
12 changes: 10 additions & 2 deletions lib/cli/src/commands/app/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ pub struct CmdAppDeploy {
#[clap(long)]
pub dir: Option<PathBuf>,

/// The path to the `app.yaml` file.
#[clap(long, conflicts_with = "dir")]
pub path: Option<PathBuf>,

/// Do not wait for the app to become reachable.
#[clap(long)]
pub no_wait: bool,
Expand Down Expand Up @@ -226,7 +230,11 @@ impl AsyncCliCommand for CmdAppDeploy {
let client =
login_user(&self.api, &self.env, !self.non_interactive, "deploy an app").await?;

let base_dir_path = self.dir.clone().unwrap_or(std::env::current_dir()?);
let base_dir_path = self
.dir
.clone()
.unwrap_or(self.path.clone().unwrap_or(std::env::current_dir()?));
theduke marked this conversation as resolved.
Show resolved Hide resolved

let (app_config_path, base_dir_path) = {
if base_dir_path.is_file() {
(
Expand Down Expand Up @@ -508,7 +516,7 @@ impl AsyncCliCommand for CmdAppDeploy {
// If the config changed, write it back.
if new_app_config != app_config {
// We want to preserve unknown fields to allow for newer app.yaml
// settings without requring new CLI versions, so instead of just
// settings without requiring new CLI versions, so instead of just
// serializing the new config, we merge it with the old one.
let new_merged = crate::utils::merge_yaml_values(
&app_config.clone().to_yaml_value()?,
Expand Down
Loading