auto update all service deploy option

This commit is contained in:
mbecker20
2025-03-05 18:58:31 -08:00
parent 66a80c1262
commit c91e107245
5 changed files with 48 additions and 10 deletions

View File

@@ -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(),

View File

@@ -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<String>,
// /// The output of ``
// pub pulled_config: Option<String>,
/// 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(),

View File

@@ -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. */

View File

@@ -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. */

View File

@@ -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 (
<ConfigSwitch
label="Full Stack Auto Update"
description="Always redeploy full stack instead of just specific services with update."
value={value}
onChange={(auto_update_all_services) =>
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) => (
<SystemCommand
value={value}
set={(value) => set({ post_deploy: value })}
disabled={disabled}
/>
<SystemCommand
value={value}
set={(value) => set({ post_deploy: value })}
disabled={disabled}
/>
),
},
},