Feature Request: Schedule Stack Updates #355

Closed
opened 2025-10-31 15:09:41 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @mattsmallman on GitHub (May 12, 2025).

Now that the schedule is working well for actions is it possible to apply schedule approach to auto updates or perhaps provide some sample code if this is better done in an action.

P.S. This whole application is awesome and has transformed the way I manage my home and production environments.

Originally created by @mattsmallman on GitHub (May 12, 2025). Now that the schedule is working well for actions is it possible to apply schedule approach to auto updates or perhaps provide some sample code if this is better done in an action. P.S. This whole application is awesome and has transformed the way I manage my home and production environments.
Author
Owner

@mbecker20 commented on GitHub (May 12, 2025):

Hey, I'm glad you like it. Here is an Action which does what you are looking for, and you can schedule it however you'd like.

const SKIP_STACKS = ["komodo"];

// Pull Stacks
const stacks = (await komodo.read("ListStacks", {})).filter(
  (stack) =>
    !SKIP_STACKS.includes(stack.name) &&
    stack.info.state === Types.StackState.Running,
);
for (const stack of stacks) {
  await komodo.execute_and_poll("PullStack", { stack: stack.name });
}

// Update Stacks
const stacks_with_update = (
  await komodo.read("ListStacks", {
    query: { specific: { update_available: true } },
  })
).filter(
  (stack) =>
    !SKIP_STACKS.includes(stack.name) &&
    stack.info.state === Types.StackState.Running,
);
for (const stack of stacks_with_update) {
  console.log("Updating Stack:", stack.name);
  await komodo.execute("DeployStack", { stack: stack.name });
}
@mbecker20 commented on GitHub (May 12, 2025): Hey, I'm glad you like it. Here is an Action which does what you are looking for, and you can schedule it however you'd like. ```ts const SKIP_STACKS = ["komodo"]; // Pull Stacks const stacks = (await komodo.read("ListStacks", {})).filter( (stack) => !SKIP_STACKS.includes(stack.name) && stack.info.state === Types.StackState.Running, ); for (const stack of stacks) { await komodo.execute_and_poll("PullStack", { stack: stack.name }); } // Update Stacks const stacks_with_update = ( await komodo.read("ListStacks", { query: { specific: { update_available: true } }, }) ).filter( (stack) => !SKIP_STACKS.includes(stack.name) && stack.info.state === Types.StackState.Running, ); for (const stack of stacks_with_update) { console.log("Updating Stack:", stack.name); await komodo.execute("DeployStack", { stack: stack.name }); } ```
Author
Owner

@mattsmallman commented on GitHub (May 13, 2025):

Awesome work - Thanks

@mattsmallman commented on GitHub (May 13, 2025): Awesome work - Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#355
No description provided.