Skip to content

Commit e3a246c

Browse files
committed
Add continuous delivery flag to wukong init command
Add prompt for `continuous_delivery` flag in `wukong init` command and save selection in `wukong.toml`. * **cli/src/application_config.rs** - Add `continuous_delivery` field to `ApplicationNamespaceConfig` struct as a boolean. - Provide a brief description of the `continuous_delivery` flag in the comments above the `ApplicationNamespaceConfig` struct. * **cli/src/commands/application/init.rs** - Add prompt for `continuous_delivery` flag in `configure_namespace` function. - Include `continuous_delivery` flag in the namespace configuration based on user input. - Update the generated `wukong.toml` file to include the `continuous_delivery` flag. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/mindvalley/wukong-cli?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 66c3da5 commit e3a246c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cli/src/application_config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ pub struct ApplicationNamespaceConfig {
2727
pub honeycomb: Option<ApplicationNamespaceHoneycombConfig>,
2828
pub cloudsql: Option<ApplicationNamespaceCloudsqlConfig>,
2929
pub notifications: Option<ApplicationNamespaceNotificationsConfig>,
30+
/// The `continuous_delivery` flag indicates whether continuous delivery is enabled for the namespace.
31+
pub continuous_delivery: bool,
3032
}
3133

3234
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]

cli/src/commands/application/init.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub async fn handle_application_init(context: Context) -> Result<bool, WKCliErro
108108
let workflows = get_workflows_from_current_dir()?;
109109
let mut excluded_workflows = Vec::new();
110110

111-
if !workflows.is_empty() {
111+
if (!workflows.is_empty()) {
112112
excluded_workflows = inquire::MultiSelect::new(
113113
"Workflows to exclude from the Wukong CLI & TUI",
114114
workflows.to_vec(),
@@ -385,6 +385,11 @@ async fn configure_namespace(
385385
.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.")
386386
.prompt()?;
387387

388+
let continuous_delivery = inquire::Confirm::new("Do you want to enable continuous delivery?")
389+
.with_render_config(inquire_render_config())
390+
.with_default(false)
391+
.prompt()?;
392+
388393
Ok(ApplicationNamespaceConfig {
389394
namespace_type: namespace_type.clone(),
390395
build: build_workflow.map(|workflow| ApplicationNamespaceBuildConfig {
@@ -441,6 +446,7 @@ async fn configure_namespace(
441446
}),
442447
})
443448
},
449+
continuous_delivery,
444450
})
445451
}
446452

0 commit comments

Comments
 (0)