Documentation
¶
Index ¶
- Constants
- Variables
- func BuildIsDone(bs string) bool
- func BuildIsFailure(bs string) bool
- func BuildIsQueued(bs string) bool
- func BuildIsSuccess(bs string) bool
- func GetReleaseVersionTag(m *cloudbuild.Build) string
- func GetRepoName(m *cloudbuild.Build) string
- func GetTargetCommitSh(m *cloudbuild.Build) string
- func GetValidTriggeredBranchName(m *cloudbuild.Build) (string, bool)
- func HandleCloudBuildEvent(ctx context.Context, registry *CloudBuildRegistry, build *cloudbuild.Build)
- func IsMissingSourceError(err string) bool
- func IsPublic(ctx context.Context, projectId, repoName string) bool
- func NewCloudBuildClient(ctx context.Context, projectId string) (*cloudbuild.Service, error)
- func NewPubSubClient(ctx context.Context, projectId string) (*pubsub.Client, error)
- func NewStorageClient(ctx context.Context, projectId string) (*storage.Client, error)
- type BuildStatus
- type CloudBot
- type CloudBuildEventHandler
- type CloudBuildRegistry
- type CloudSubscriber
- type SplitRepoName
- type Tags
- func (t Tags) AddInstallationIdTag(instId int64) Tags
- func (t Tags) AddPRTag(pr int) Tags
- func (t Tags) AddRefTag(ref string) Tags
- func (t Tags) AddReleaseTag(tag string) Tags
- func (t Tags) AddRepoTag(repo string) Tags
- func (t Tags) AddShaTag(sha string) Tags
- func (t Tags) GetInstallationId() int64
- func (t Tags) GetPR() int
- func (t Tags) GetRef() string
- func (t Tags) GetReleaseTag() string
- func (t Tags) GetRepo() string
- func (t Tags) GetSha() string
- func (t Tags) IsReleaseBuild() bool
Constants ¶
View Source
const (
BranchMaster = "master"
CloudbuildFile = "cloudbuild.yaml"
MissingSourceError = "unable to resolve source"
)
View Source
const (
StatusUnknown BuildStatus = "STATUS_UNKNOWN"
StatusQueued = "QUEUED"
StatusWorking = "WORKING"
StatusSuccess = "SUCCESS"
StatusFailure = "FAILURE"
StatusInternalError = "INTERNAL_ERROR"
StatusTimeout = "TIMEOUT"
StatusCancelled = "CANCELLED"
)
View Source
const (
TOPIC = "cloud-builds"
)
Variables ¶
View Source
var (
DefaultRoot = "/etc/gce"
)
Functions ¶
func BuildIsDone ¶
func BuildIsDone(bs string) bool
func BuildIsFailure ¶
func BuildIsFailure(bs string) bool
func BuildIsQueued ¶
func BuildIsQueued(bs string) bool
func BuildIsSuccess ¶
func BuildIsSuccess(bs string) bool
func GetReleaseVersionTag ¶
func GetReleaseVersionTag(m *cloudbuild.Build) string
attempts to valid release tag returns empty string if none exists
func GetRepoName ¶
func GetRepoName(m *cloudbuild.Build) string
attempts to return repo name returns empty string if none exists
func GetTargetCommitSh ¶
func GetTargetCommitSh(m *cloudbuild.Build) string
func GetValidTriggeredBranchName ¶
func GetValidTriggeredBranchName(m *cloudbuild.Build) (string, bool)
Used by slack listener to see if the current branch is a valid branch to respond to
func HandleCloudBuildEvent ¶
func HandleCloudBuildEvent(ctx context.Context, registry *CloudBuildRegistry, build *cloudbuild.Build)
func IsMissingSourceError ¶
func IsMissingSourceError(err string) bool
func IsPublic ¶ added in v0.9.14
func IsPublic(ctx context.Context, projectId, repoName string) bool
func NewCloudBuildClient ¶
func NewCloudBuildClient(ctx context.Context, projectId string) (*cloudbuild.Service, error)
func NewPubSubClient ¶
func NewPubSubClient(ctx context.Context, projectId string) (*pubsub.Client, error)
func NewStorageClient ¶
func NewStorageClient(ctx context.Context, projectId string) (*storage.Client, error)
Types ¶
type BuildStatus ¶
type BuildStatus string
type CloudBot ¶
type CloudBot struct {
// contains filtered or unexported fields
}
func NewCloudBot ¶
func NewCloudBot(ctx context.Context, projectIds []string, subscriberId string, handlers ...CloudBuildEventHandler) (*CloudBot, error)
type CloudBuildEventHandler ¶
type CloudBuildEventHandler interface {
CloudBuild(ctx context.Context, build *cloudbuild.Build) error
}
type CloudBuildRegistry ¶
type CloudBuildRegistry struct {
// contains filtered or unexported fields
}
func (*CloudBuildRegistry) AddEventHandler ¶
func (r *CloudBuildRegistry) AddEventHandler(handler CloudBuildEventHandler)
type CloudSubscriber ¶
type CloudSubscriber struct {
// contains filtered or unexported fields
}
func NewCloudSubscriber ¶
func NewCloudSubscriber(ctx context.Context, projectId string, subscriptionId string) (*CloudSubscriber, error)
func (*CloudSubscriber) GetProjectId ¶
func (cs *CloudSubscriber) GetProjectId() string
func (*CloudSubscriber) RegisterHandler ¶
func (cs *CloudSubscriber) RegisterHandler(handler CloudBuildEventHandler)
type SplitRepoName ¶
type SplitRepoName struct {
Host string
Org string
Repo string
}
func GetRepoNameFromRepoSource ¶
func GetRepoNameFromRepoSource(rs *cloudbuild.RepoSource) *SplitRepoName
repo source name start as <source>_<owner>_<repo> github_solo-io_solobot transforms the above into the sum of it's parts
func GetSplitRepoName ¶
func GetSplitRepoName(m *cloudbuild.Build) *SplitRepoName
type Tags ¶
type Tags []string
func InitializeTags ¶
func InitializeTags(input []string) Tags
func (Tags) AddInstallationIdTag ¶
func (t Tags) AddInstallationIdTag(instId int64) Tags
func (Tags) AddReleaseTag ¶
func (t Tags) AddReleaseTag(tag string) Tags
func (Tags) AddRepoTag ¶
func (t Tags) AddRepoTag(repo string) Tags
func (Tags) GetInstallationId ¶
func (t Tags) GetInstallationId() int64
func (Tags) IsReleaseBuild ¶
func (t Tags) IsReleaseBuild() bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.