-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.go
40 lines (35 loc) · 1.84 KB
/
release.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
package contracts
import (
"fmt"
"time"
manifest "github.com/estafette/estafette-ci-manifest"
)
// Release represents a release of a pipeline
type Release struct {
Name string `json:"name"`
Action string `json:"action,omitempty"`
ID string `json:"id,omitempty"`
RepoSource string `json:"repoSource,omitempty"`
RepoOwner string `json:"repoOwner,omitempty"`
RepoName string `json:"repoName,omitempty"`
ReleaseVersion string `json:"releaseVersion,omitempty"`
ReleaseStatus Status `json:"releaseStatus,omitempty"`
Events []manifest.EstafetteEvent `json:"triggerEvents,omitempty"`
InsertedAt *time.Time `json:"insertedAt,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
Duration *time.Duration `json:"duration,omitempty"`
PendingDuration *time.Duration `json:"pendingDuration,omitempty"`
ExtraInfo *ReleaseExtraInfo `json:"extraInfo,omitempty"`
Groups []*Group `json:"groups,omitempty"`
Organizations []*Organization `json:"organizations,omitempty"`
}
// ReleaseExtraInfo contains extra information like aggregates over the last x releases
type ReleaseExtraInfo struct {
MedianPendingDuration time.Duration `json:"medianPendingDuration"`
MedianDuration time.Duration `json:"medianDuration"`
}
// GetFullRepoPath returns the full path of the release repository with source, owner and name
func (release *Release) GetFullRepoPath() string {
return fmt.Sprintf("%v/%v/%v", release.RepoSource, release.RepoOwner, release.RepoName)
}