-
Notifications
You must be signed in to change notification settings - Fork 208
Add ability to disable auto trigger deployment on git change #2714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
dce2482
0fdd89e
f02c940
7b5c119
cbd67d8
d8899a9
148765f
471d092
5734d05
b9bc4cc
8dffc8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,10 @@ type GenericDeploymentSpec struct { | |
| SealedSecrets []SealedSecretMapping `json:"sealedSecrets"` | ||
| // List of directories or files where their changes will trigger the deployment. | ||
| // Regular expression can be used. | ||
| // Deprecated: use Trigger.Paths instead. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs in dev should be updated too.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do in a separated PR 🙆♀️ |
||
| TriggerPaths []string `json:"triggerPaths,omitempty"` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should keep both of fields to avoid breaking changes.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see, then mark it as deprecated and remove it later 👍 Lets me address this
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed by 6591559
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better update our docs as well
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, will do it by a separated PR 🙏 |
||
| // The trigger configuration use to determine trigger logic. | ||
| Trigger Trigger `json:"trigger"` | ||
| // The maximum length of time to execute deployment before giving up. | ||
| // Default is 6h. | ||
| Timeout Duration `json:"timeout,omitempty" default:"6h"` | ||
|
|
@@ -55,6 +58,19 @@ type DeploymentPlanner struct { | |
| AlwaysUsePipeline bool `json:"alwaysUsePipeline"` | ||
| } | ||
|
|
||
| type Trigger struct { | ||
| // Configuration in case changes on commit are found. | ||
| OnCommit OnCommitConfig `json:"onCommit"` | ||
| } | ||
|
|
||
| type OnCommitConfig struct { | ||
| // Control trigger new deployment on Git change or not. | ||
| Disable bool `json:"disable,omitempty"` | ||
|
||
| // List of directories or files where their changes will trigger the deployment. | ||
| // Regular expression can be used. | ||
| Paths []string `json:"paths,omitempty"` | ||
| } | ||
|
|
||
| func (s *GenericDeploymentSpec) Validate() error { | ||
| if s.Pipeline != nil { | ||
| for _, stage := range s.Pipeline.Stages { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: pipecd.dev/v1beta1 | ||
| kind: KubernetesApp | ||
| spec: | ||
| trigger: | ||
| onCommit: | ||
| paths: | ||
| - deployment.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving
ignoreUserConfigto Determiner while initializing it? In that way, we can keep this function simple as it is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, lets me adopt that 🙆♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed by 8dffc8d