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

Add continuous delivery flag to wukong init command #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions cli/src/application_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pub struct ApplicationNamespaceConfig {
pub honeycomb: Option<ApplicationNamespaceHoneycombConfig>,
pub cloudsql: Option<ApplicationNamespaceCloudsqlConfig>,
pub notifications: Option<ApplicationNamespaceNotificationsConfig>,
/// The `continuous_delivery` flag indicates whether continuous delivery is enabled for the namespace.
pub continuous_delivery: bool,
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
Expand Down
8 changes: 7 additions & 1 deletion cli/src/commands/application/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub async fn handle_application_init(context: Context) -> Result<bool, WKCliErro
let workflows = get_workflows_from_current_dir()?;
let mut excluded_workflows = Vec::new();

if !workflows.is_empty() {
if (!workflows.is_empty()) {
excluded_workflows = inquire::MultiSelect::new(
"Workflows to exclude from the Wukong CLI & TUI",
workflows.to_vec(),
Expand Down Expand Up @@ -385,6 +385,11 @@ async fn configure_namespace(
.with_help_message("Leave it blank to disable Slack notifications. Use 'channel-name' format without the '#'. \n\nIt is your responsibility to ensure the channel name exists, and to add the bot integration if the channel is private.")
.prompt()?;

let continuous_delivery = inquire::Confirm::new("Do you want to enable continuous delivery?")
.with_render_config(inquire_render_config())
.with_default(false)
.prompt()?;

Ok(ApplicationNamespaceConfig {
namespace_type: namespace_type.clone(),
build: build_workflow.map(|workflow| ApplicationNamespaceBuildConfig {
Expand Down Expand Up @@ -441,6 +446,7 @@ async fn configure_namespace(
}),
})
},
continuous_delivery,
})
}

Expand Down
Loading