-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.go
89 lines (78 loc) · 4.42 KB
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package manifest
import "time"
// EstafettePipelineEvent fires for pipeline changes
type EstafettePipelineEvent struct {
BuildVersion string `yaml:"buildVersion,omitempty" json:"buildVersion,omitempty"`
RepoSource string `yaml:"repoSource,omitempty" json:"repoSource,omitempty"`
RepoOwner string `yaml:"repoOwner,omitempty" json:"repoOwner,omitempty"`
RepoName string `yaml:"repoName,omitempty" json:"repoName,omitempty"`
Branch string `yaml:"repoBranch,omitempty" json:"repoBranch,omitempty"`
Status string `yaml:"status,omitempty" json:"status,omitempty"`
Event string `yaml:"event,omitempty" json:"event,omitempty"`
}
// EstafetteReleaseEvent fires for pipeline releases
type EstafetteReleaseEvent struct {
ReleaseVersion string `yaml:"releaseVersion,omitempty" json:"releaseVersion,omitempty"`
RepoSource string `yaml:"repoSource,omitempty" json:"repoSource,omitempty"`
RepoOwner string `yaml:"repoOwner,omitempty" json:"repoOwner,omitempty"`
RepoName string `yaml:"repoName,omitempty" json:"repoName,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
Status string `yaml:"status,omitempty" json:"status,omitempty"`
Event string `yaml:"event,omitempty" json:"event,omitempty"`
}
// EstafetteGitEvent fires for git repository changes
type EstafetteGitEvent struct {
Event string `yaml:"event,omitempty" json:"event,omitempty"`
Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`
Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
}
// EstafetteDockerEvent fires for docker image changes
type EstafetteDockerEvent struct {
Event string `yaml:"event,omitempty" json:"event,omitempty"`
Image string `yaml:"image,omitempty" json:"image,omitempty"`
Tag string `yaml:"tag,omitempty" json:"tag,omitempty"`
}
// EstafetteCronEvent fires at intervals specified by the cron expression
type EstafetteCronEvent struct {
Time time.Time `yaml:"time,omitempty" json:"time,omitempty"`
}
// EstafetteManualEvent fires when a user manually triggers a build or release
type EstafetteManualEvent struct {
UserID string `yaml:"userID,omitempty" json:"userID,omitempty"`
}
// EstafettePubSubEvent fires when a subscribed pubsub topic receives an event
type EstafettePubSubEvent struct {
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Topic string `yaml:"topic,omitempty" json:"topic,omitempty"`
Message PubsubMessage `yaml:"message,omitempty" json:"message,omitempty"`
}
// EstafetteGithubEvent fires for github events
type EstafetteGithubEvent struct {
Event string `yaml:"event,omitempty" json:"event,omitempty"`
Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`
Delivery string `yaml:"delivery,omitempty" json:"delivery,omitempty"`
Payload string `yaml:"payload,omitempty" json:"payload,omitempty"`
}
// EstafetteBitbucketEvent fires for bitbucket events
type EstafetteBitbucketEvent struct {
Event string `yaml:"event,omitempty" json:"event,omitempty"`
Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`
HookUUID string `yaml:"hookUUID,omitempty" json:"hookUUID,omitempty"`
RequestUUID string `yaml:"requestUUID,omitempty" json:"requestUUID,omitempty"`
AttemptNumber string `yaml:"attemptNumber,omitempty" json:"attemptNumber,omitempty"`
Payload string `yaml:"payload,omitempty" json:"payload,omitempty"`
}
// EstafetteEvent is a container for any trigger event
type EstafetteEvent struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Fired bool `yaml:"fired,omitempty" json:"fired,omitempty"`
Pipeline *EstafettePipelineEvent `yaml:"pipeline,omitempty" json:"pipeline,omitempty"`
Release *EstafetteReleaseEvent `yaml:"release,omitempty" json:"release,omitempty"`
Git *EstafetteGitEvent `yaml:"git,omitempty" json:"git,omitempty"`
Docker *EstafetteDockerEvent `yaml:"docker,omitempty" json:"docker,omitempty"`
Cron *EstafetteCronEvent `yaml:"cron,omitempty" json:"cron,omitempty"`
PubSub *EstafettePubSubEvent `yaml:"pubsub,omitempty" json:"pubsub,omitempty"`
Github *EstafetteGithubEvent `yaml:"github,omitempty" json:"github,omitempty"`
Bitbucket *EstafetteBitbucketEvent `yaml:"bitbucket,omitempty" json:"bitbucket,omitempty"`
Manual *EstafetteManualEvent `yaml:"manual,omitempty" json:"manual,omitempty"`
}