gcp

package
v0.0.0-...-0c9e1e3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusQueued    = "QUEUED"
	StatusWorking   = "WORKING"
	StatusSuccess   = "SUCCESS"
	StatusFailure   = "FAILURE"
	StatusCancelled = "CANCELLED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GCP

type GCP struct {
	Runf func(t testing.TB, cmd string, args ...interface{}) gjson.Result
	// contains filtered or unexported fields
}

func NewGCP

func NewGCP() GCP

NewGCP creates a new wrapper for Google Cloud Platform CLI.

func (GCP) EnableApis

func (g GCP) EnableApis(t testing.TB, project string, apis []string)

EnableApis enables the apis in the given project

func (GCP) GetBuildStatus

func (g GCP) GetBuildStatus(t testing.TB, projectID, region, buildID string) string

GetBuildStatus gets the status of the given build

func (GCP) GetBuilds

func (g GCP) GetBuilds(t testing.TB, projectID, region, filter string) map[string]string

GetBuilds gets all Cloud Build builds form a project and region that satisfy the given filter.

func (GCP) GetFinalBuildState

func (g GCP) GetFinalBuildState(t testing.TB, projectID, region, buildID string, maxRetry int) (string, error)

GetFinalBuildState gets the terminal status of the given build. It will wait if build is not finished.

func (GCP) GetLastBuildStatus

func (g GCP) GetLastBuildStatus(t testing.TB, projectID, region, filter string) string

GetLastBuildStatus gets the status of the last build form a project and region that satisfy the given filter.

func (GCP) GetRunningBuildID

func (g GCP) GetRunningBuildID(t testing.TB, projectID, region, filter string) string

GetRunningBuildID gets the current build running for the given project, region, and filter

func (GCP) HasSccNotification

func (g GCP) HasSccNotification(t testing.TB, orgID, sccName string) bool

HasSccNotification checks if a Security Command Center notification exists

func (GCP) HasTagKey

func (g GCP) HasTagKey(t testing.TB, orgID, tag string) bool

HasTagKey checks if a Tag Key exists

func (GCP) IsApiEnabled

func (g GCP) IsApiEnabled(t testing.TB, project, api string) bool

IsApiEnabled checks if the api is enabled in the given project

func (GCP) WaitBuildSuccess

func (g GCP) WaitBuildSuccess(t testing.TB, project, region, repo, commitSha, failureMsg string, maxRetry int) error

WaitBuildSuccess waits for the current build in a repo to finish.

Jump to

Keyboard shortcuts

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