diff --git a/bin/core/src/monitor/resources.rs b/bin/core/src/monitor/resources.rs index 16a847529..e00758ae9 100644 --- a/bin/core/src/monitor/resources.rs +++ b/bin/core/src/monitor/resources.rs @@ -358,11 +358,16 @@ pub async fn update_stack_cache( { let id = stack.id.clone(); let server_name = server_name.clone(); + let services = if stack.config.auto_update_all_services { + Vec::new() + } else { + services_to_update + }; tokio::spawn(async move { match execute::inner_handler( ExecuteRequest::DeployStack(DeployStack { stack: stack.name.clone(), - services: services_to_update, + services, stop_time: None, }), auto_redeploy_user().to_owned(), diff --git a/client/core/rs/src/entities/stack.rs b/client/core/rs/src/entities/stack.rs index e6b0727f2..7f89bbb97 100644 --- a/client/core/rs/src/entities/stack.rs +++ b/client/core/rs/src/entities/stack.rs @@ -172,9 +172,6 @@ pub struct StackInfo { /// The output of `docker compose config`. /// This is updated whenever Komodo successfully deploys the stack. pub deployed_config: Option, - // /// The output of `` - // pub pulled_config: Option, - /// The latest service names. /// This is updated whenever the stack cache refreshes, using the latest file contents (either db defined or remote). #[serde(default)] @@ -253,6 +250,14 @@ pub struct StackConfig { #[builder(default)] pub auto_update: bool, + /// If auto update is enabled, Komodo will + /// by default only update the specific services + /// with image updates. If this parameter is set to true, + /// Komodo will redeploy the whole Stack (all services). + #[serde(default)] + #[builder(default)] + pub auto_update_all_services: bool, + /// Whether to run `docker compose down` before `compose up`. #[serde(default)] #[builder(default)] @@ -498,6 +503,7 @@ impl Default for StackConfig { auto_pull: default_auto_pull(), poll_for_updates: Default::default(), auto_update: Default::default(), + auto_update_all_services: Default::default(), ignore_services: Default::default(), pre_deploy: Default::default(), post_deploy: Default::default(), diff --git a/client/core/ts/src/types.ts b/client/core/ts/src/types.ts index 14882ca40..92ab3f400 100644 --- a/client/core/ts/src/types.ts +++ b/client/core/ts/src/types.ts @@ -1606,6 +1606,13 @@ export interface StackConfig { * enable both. */ auto_update?: boolean; + /** + * If auto update is enabled, Komodo will + * by default only update the specific services + * with image updates. If this parameter is set to true, + * Komodo will redeploy the whole Stack (all services). + */ + auto_update_all_services?: boolean; /** Whether to run `docker compose down` before `compose up`. */ destroy_before_deploy?: boolean; /** Whether to skip secret interpolation into the stack environment variables. */ diff --git a/frontend/public/client/types.d.ts b/frontend/public/client/types.d.ts index d554967e7..afbc6ca19 100644 --- a/frontend/public/client/types.d.ts +++ b/frontend/public/client/types.d.ts @@ -1705,6 +1705,13 @@ export interface StackConfig { * enable both. */ auto_update?: boolean; + /** + * If auto update is enabled, Komodo will + * by default only update the specific services + * with image updates. If this parameter is set to true, + * Komodo will redeploy the whole Stack (all services). + */ + auto_update_all_services?: boolean; /** Whether to run `docker compose down` before `compose up`. */ destroy_before_deploy?: boolean; /** Whether to skip secret interpolation into the stack environment variables. */ diff --git a/frontend/src/components/resources/stack/config.tsx b/frontend/src/components/resources/stack/config.tsx index 06709144e..0567004ee 100644 --- a/frontend/src/components/resources/stack/config.tsx +++ b/frontend/src/components/resources/stack/config.tsx @@ -256,6 +256,19 @@ export const StackConfig = ({ auto_update: { description: "Trigger a redeploy if a newer image is found.", }, + auto_update_all_services: (value, set) => { + return ( + + set({ auto_update_all_services }) + } + disabled={disabled || !auto_update} + /> + ); + }, }, }, { @@ -309,14 +322,14 @@ export const StackConfig = ({ { label: "Post Deploy", description: - "Execute a shell command after running docker compose up. The 'path' is relative to the Run Directory", + "Execute a shell command after running docker compose up. The 'path' is relative to the Run Directory", components: { post_deploy: (value, set) => ( - set({ post_deploy: value })} - disabled={disabled} - /> + set({ post_deploy: value })} + disabled={disabled} + /> ), }, },