builders

package
v0.20.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROJECT_ID  subscription = "PROJECT_ID"
	BUILD_ID                 = "BUILD_ID"
	COMMIT_SHA               = "COMMIT_SHA"
	SHORT_SHA                = "SHORT_SHA"
	REPO_NAME                = "REPO_NAME"
	BRANCH_NAME              = "BRANCH_NAME"
	TAG_NAME                 = "TAG_NAME"
	REVISION_ID              = "REVISION_ID"
)

Variables

This section is empty.

Functions

func DefaultMockBuilderContext

func DefaultMockBuilderContext(ctx context.Context) (*mockBuilderContext, error)

func DescribeBuild

func DescribeBuild(ctx context.Context, builderCtx BuildContext, id string) (*cloudbuild.Build, error)

func NewMockBuilderContext

func NewMockBuilderContext(sharedContext *sharedContext, tag string, sha string) *mockBuilderContext

func NewSharedContext

func NewSharedContext(projectId string, installationId int64, client *github.Client, service *cloudbuild.Service, owner string, repo string) *sharedContext

func ToEnv

func ToEnv(s subscription) string

Types

type BuildContext

type BuildContext interface {
	Client() *github.Client
	Service() *cloudbuild.Service
	Owner() string
	Repo() string
	ProjectId() string
	InstallationId() int64
	Builder() string
}

type BuildInfo

type BuildInfo struct {
	LogUrl string
}

func StartBuildWithSha

func StartBuildWithSha(ctx context.Context, builderCtx ShaBuildContext) (*BuildInfo, error)

func StartBuildWithTag

func StartBuildWithTag(ctx context.Context, builderCtx TagBuildContext) (*BuildInfo, error)

func StartPRBuild added in v0.10.6

func StartPRBuild(ctx context.Context, buildContext *PullRequestContext) (*BuildInfo, error)

type Builder

type Builder interface {
	InitBuildWithSha(ctx context.Context, builderCtx ShaBuildContext) (*cloudbuild.Build, error)
	InitBuildWithTag(ctx context.Context, builderCtx TagBuildContext) (*cloudbuild.Build, error)
}

type CommentBuildContext

type CommentBuildContext interface {
	ShaBuildContext
	Body() string
}

type CommitCommentContext

type CommitCommentContext struct {
	// contains filtered or unexported fields
}

func NewCommitCommentContext

func NewCommitCommentContext(sharedContext *sharedContext, commit *github.CommitCommentEvent) *CommitCommentContext

func (*CommitCommentContext) Body

func (ctx *CommitCommentContext) Body() string

func (CommitCommentContext) Builder added in v0.10.10

func (ctx CommitCommentContext) Builder() string

func (CommitCommentContext) Client

func (ctx CommitCommentContext) Client() *github.Client

func (*CommitCommentContext) CommentEvent

func (ctx *CommitCommentContext) CommentEvent() *github.CommitCommentEvent

func (CommitCommentContext) InstallationId

func (ctx CommitCommentContext) InstallationId() int64

func (*CommitCommentContext) Owner

func (ctx *CommitCommentContext) Owner() string

func (CommitCommentContext) ProjectId

func (ctx CommitCommentContext) ProjectId() string

func (*CommitCommentContext) Ref

func (ctx *CommitCommentContext) Ref() string

func (*CommitCommentContext) Repo

func (ctx *CommitCommentContext) Repo() string

func (CommitCommentContext) Service

func (ctx CommitCommentContext) Service() *cloudbuild.Service

func (CommitCommentContext) SetBuilder added in v0.10.10

func (ctx CommitCommentContext) SetBuilder(builder string)

func (*CommitCommentContext) Sha

func (ctx *CommitCommentContext) Sha() string

type IssueCommentContext

type IssueCommentContext struct {
	// contains filtered or unexported fields
}

func NewIssueCommentContext

func NewIssueCommentContext(sharedContext *sharedContext, pullRequest *github.PullRequest,
	comment *github.IssueCommentEvent) *IssueCommentContext

func (*IssueCommentContext) Author

func (ctx *IssueCommentContext) Author() string

func (*IssueCommentContext) Body

func (ctx *IssueCommentContext) Body() string

func (IssueCommentContext) Builder added in v0.10.10

func (ctx IssueCommentContext) Builder() string

func (IssueCommentContext) Client

func (ctx IssueCommentContext) Client() *github.Client

func (*IssueCommentContext) CommentEvent

func (ctx *IssueCommentContext) CommentEvent() *github.IssueCommentEvent

func (IssueCommentContext) InstallationId

func (ctx IssueCommentContext) InstallationId() int64

func (*IssueCommentContext) Number

func (ctx *IssueCommentContext) Number() int

func (*IssueCommentContext) Owner

func (ctx *IssueCommentContext) Owner() string

func (IssueCommentContext) ProjectId

func (ctx IssueCommentContext) ProjectId() string

func (*IssueCommentContext) PullRequest

func (ctx *IssueCommentContext) PullRequest() *github.PullRequest

func (*IssueCommentContext) Ref

func (ctx *IssueCommentContext) Ref() string

func (*IssueCommentContext) Repo

func (ctx *IssueCommentContext) Repo() string

func (IssueCommentContext) Service

func (ctx IssueCommentContext) Service() *cloudbuild.Service

func (IssueCommentContext) SetBuilder added in v0.10.10

func (ctx IssueCommentContext) SetBuilder(builder string)

func (*IssueCommentContext) Sha

func (ctx *IssueCommentContext) Sha() string

type OperationBuildMetadata

type OperationBuildMetadata struct {
	Type  string            `json:"@type"`
	Build *cloudbuild.Build `json:"build"`
}

type PullRequestContext

type PullRequestContext struct {
	// contains filtered or unexported fields
}

func NewPullRequestContext

func NewPullRequestContext(sharedContext *sharedContext, pr *github.PullRequest) *PullRequestContext

func (PullRequestContext) Builder added in v0.10.10

func (ctx PullRequestContext) Builder() string

func (PullRequestContext) Client

func (ctx PullRequestContext) Client() *github.Client

func (PullRequestContext) InstallationId

func (ctx PullRequestContext) InstallationId() int64

func (*PullRequestContext) Owner

func (ctx *PullRequestContext) Owner() string

func (PullRequestContext) ProjectId

func (ctx PullRequestContext) ProjectId() string

func (*PullRequestContext) PullRequest

func (ctx *PullRequestContext) PullRequest() *github.PullRequest

func (*PullRequestContext) Ref

func (ctx *PullRequestContext) Ref() string

func (*PullRequestContext) Repo

func (ctx *PullRequestContext) Repo() string

func (PullRequestContext) Service

func (ctx PullRequestContext) Service() *cloudbuild.Service

func (PullRequestContext) SetBuilder added in v0.10.10

func (ctx PullRequestContext) SetBuilder(builder string)

func (*PullRequestContext) Sha

func (ctx *PullRequestContext) Sha() string

type RefBuildContext

type RefBuildContext interface {
	BuildContext
	Ref() string
}

type ReleaseContext

type ReleaseContext struct {
	// contains filtered or unexported fields
}

func NewReleaseContext

func NewReleaseContext(ctx context.Context, sharedContext *sharedContext, release *github.ReleaseEvent) (*ReleaseContext, error)

func (ReleaseContext) Builder added in v0.10.10

func (ctx ReleaseContext) Builder() string

func (ReleaseContext) Client

func (ctx ReleaseContext) Client() *github.Client

func (ReleaseContext) InstallationId

func (ctx ReleaseContext) InstallationId() int64

func (*ReleaseContext) Owner

func (ctx *ReleaseContext) Owner() string

func (ReleaseContext) ProjectId

func (ctx ReleaseContext) ProjectId() string

func (*ReleaseContext) Ref

func (ctx *ReleaseContext) Ref() string

func (*ReleaseContext) Release

func (ctx *ReleaseContext) Release() *github.ReleaseEvent

func (*ReleaseContext) Repo

func (ctx *ReleaseContext) Repo() string

func (ReleaseContext) Service

func (ctx ReleaseContext) Service() *cloudbuild.Service

func (ReleaseContext) SetBuilder added in v0.10.10

func (ctx ReleaseContext) SetBuilder(builder string)

func (*ReleaseContext) Sha

func (ctx *ReleaseContext) Sha() string

func (*ReleaseContext) Tag

func (ctx *ReleaseContext) Tag() string

type ShaBuildContext

type ShaBuildContext interface {
	BuildContext
	Sha() string
}

type StorageBuilder

type StorageBuilder struct {
	// contains filtered or unexported fields
}

func NewStorageBuilder

func NewStorageBuilder(ctx context.Context, projectId string) (*StorageBuilder, error)

func (*StorageBuilder) InitBuildWithSha

func (sb *StorageBuilder) InitBuildWithSha(ctx context.Context, builderCtx ShaBuildContext) (*cloudbuild.Build, error)

func (*StorageBuilder) InitBuildWithTag

func (sb *StorageBuilder) InitBuildWithTag(ctx context.Context, builderCtx TagBuildContext) (*cloudbuild.Build, error)

type TagBuildContext

type TagBuildContext interface {
	ShaBuildContext
	Tag() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL