mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(stacks): extract auto update logic [EE-4945] (#8545)
This commit is contained in:
parent
085381e6fc
commit
6918da2414
42 changed files with 410 additions and 166 deletions
|
@ -32,6 +32,20 @@ type (
|
|||
// Authorizations represents a set of authorizations associated to a role
|
||||
Authorizations map[Authorization]bool
|
||||
|
||||
//AutoUpdateSettings represents the git auto sync config for stack deployment
|
||||
AutoUpdateSettings struct {
|
||||
// Auto update interval
|
||||
Interval string `example:"1m30s"`
|
||||
// A UUID generated from client
|
||||
Webhook string `example:"05de31a2-79fa-4644-9c12-faa67e5c49f0"`
|
||||
// Autoupdate job id
|
||||
JobID string `example:"15"`
|
||||
// Force update ignores repo changes
|
||||
ForceUpdate bool `example:"false"`
|
||||
// Pull latest image
|
||||
ForcePullImage bool `example:"false"`
|
||||
}
|
||||
|
||||
// AzureCredentials represents the credentials used to connect to an Azure
|
||||
// environment(endpoint).
|
||||
AzureCredentials struct {
|
||||
|
@ -986,7 +1000,7 @@ type (
|
|||
// Only applies when deploying stack with multiple files
|
||||
AdditionalFiles []string `json:"AdditionalFiles"`
|
||||
// The auto update settings of a git stack
|
||||
AutoUpdate *StackAutoUpdate `json:"AutoUpdate"`
|
||||
AutoUpdate *AutoUpdateSettings `json:"AutoUpdate"`
|
||||
// The stack deployment option
|
||||
Option *StackOption `json:"Option"`
|
||||
// The git config of this stack
|
||||
|
@ -999,16 +1013,6 @@ type (
|
|||
IsComposeFormat bool `example:"false"`
|
||||
}
|
||||
|
||||
//StackAutoUpdate represents the git auto sync config for stack deployment
|
||||
StackAutoUpdate struct {
|
||||
// Auto update interval
|
||||
Interval string `example:"1m30s"`
|
||||
// A UUID generated from client
|
||||
Webhook string `example:"05de31a2-79fa-4644-9c12-faa67e5c49f0"`
|
||||
// Autoupdate job id
|
||||
JobID string `example:"15"`
|
||||
}
|
||||
|
||||
// StackOption represents the options for stack deployment
|
||||
StackOption struct {
|
||||
// Prune services that are no longer referenced
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue