Skip to content

Commit bd4c889

Browse files
sandrogattusoGattuso, Sandro
and
Gattuso, Sandro
authored
Support for Commit status Title and pipeline policies (#26)
* Support for Commit status Title and pipeline policies * Add support for Contexts in triggers * Added support for Triggers attributes: BranchRegexInput, PRTargetBranch, CommentRegex, RuntimeEnvironment * Fix to avoid Triggers Runtime to override back to default with empty value {} * Support for termination policies Co-authored-by: Gattuso, Sandro <[email protected]>
1 parent b174d11 commit bd4c889

File tree

5 files changed

+649
-69
lines changed

5 files changed

+649
-69
lines changed

client/pipeline.go

+31-24
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,24 @@ type SpecTemplate struct {
3535
}
3636

3737
type Trigger struct {
38-
Name string `json:"name,omitempty"`
39-
Description string `json:"description,omitempty"`
40-
Type string `json:"type,omitempty"`
41-
Repo string `json:"repo,omitempty"`
42-
Events []string `json:"events,omitempty"`
43-
BranchRegex string `json:"branchRegex,omitempty"`
44-
ModifiedFilesGlob string `json:"modifiedFilesGlob,omitempty"`
45-
Provider string `json:"provider,omitempty"`
46-
Disabled bool `json:"disabled,omitempty"`
47-
PullRequestAllowForkEvents bool `json:"pullRequestAllowForkEvents,omitempty"`
48-
Context string `json:"context,omitempty"`
49-
Variables []Variable `json:"variables,omitempty"`
38+
Name string `json:"name,omitempty"`
39+
Description string `json:"description,omitempty"`
40+
Type string `json:"type,omitempty"`
41+
Repo string `json:"repo,omitempty"`
42+
Events []string `json:"events,omitempty"`
43+
BranchRegex string `json:"branchRegex,omitempty"`
44+
BranchRegexInput string `json:"branchRegexInput,omitempty"`
45+
PullRequestTargetBranchRegex string `json:"pullRequestTargetBranchRegex,omitempty"`
46+
CommentRegex string `json:"commentRegex,omitempty"`
47+
ModifiedFilesGlob string `json:"modifiedFilesGlob,omitempty"`
48+
Provider string `json:"provider,omitempty"`
49+
Disabled bool `json:"disabled,omitempty"`
50+
PullRequestAllowForkEvents bool `json:"pullRequestAllowForkEvents,omitempty"`
51+
CommitStatusTitle string `json:"commitStatusTitle,omitempty"`
52+
Context string `json:"context,omitempty"`
53+
Contexts []string `json:"contexts,omitempty"`
54+
RuntimeEnvironment *RuntimeEnvironment `json:"runtimeEnvironment,omitempty"`
55+
Variables []Variable `json:"variables,omitempty"`
5056
}
5157

5258
type RuntimeEnvironment struct {
@@ -63,18 +69,19 @@ func (t *Trigger) SetVariables(variables map[string]interface{}) {
6369
}
6470

6571
type Spec struct {
66-
Variables []Variable `json:"variables,omitempty"`
67-
SpecTemplate *SpecTemplate `json:"specTemplate,omitempty"`
68-
Triggers []Trigger `json:"triggers,omitempty"`
69-
Priority int `json:"priority,omitempty"`
70-
Concurrency int `json:"concurrency,omitempty"`
71-
BranchConcurrency int `json:"branchConcurrency,omitempty"`
72-
TriggerConcurrency int `json:"triggerConcurrency,omitempty"`
73-
Contexts []interface{} `json:"contexts,omitempty"`
74-
Steps *Steps `json:"steps,omitempty"`
75-
Stages *Stages `json:"stages,omitempty"`
76-
Mode string `json:"mode,omitempty"`
77-
RuntimeEnvironment RuntimeEnvironment `json:"runtimeEnvironment,omitempty"`
72+
Variables []Variable `json:"variables,omitempty"`
73+
SpecTemplate *SpecTemplate `json:"specTemplate,omitempty"`
74+
Triggers []Trigger `json:"triggers,omitempty"`
75+
Priority int `json:"priority,omitempty"`
76+
Concurrency int `json:"concurrency,omitempty"`
77+
BranchConcurrency int `json:"branchConcurrency,omitempty"`
78+
TriggerConcurrency int `json:"triggerConcurrency,omitempty"`
79+
Contexts []interface{} `json:"contexts,omitempty"`
80+
Steps *Steps `json:"steps,omitempty"`
81+
Stages *Stages `json:"stages,omitempty"`
82+
Mode string `json:"mode,omitempty"`
83+
RuntimeEnvironment RuntimeEnvironment `json:"runtimeEnvironment,omitempty"`
84+
TerminationPolicy []map[string]interface{} `json:"terminationPolicy,omitempty"`
7885
}
7986

8087
type Steps struct {

0 commit comments

Comments
 (0)