Documentation
¶
Index ¶
- Constants
- func ExitCodeForError(err error) int
- func ExitCodeForStatus(status string) int
- func NewBuildResultError(buildID, status string) error
- func NewConfigError(message string, cause error) error
- func NewServiceError(message string, cause error) error
- type Backoff
- type BuildResultError
- type CloudBuildSubmit
- type Config
- type ConfigError
- type GcsPath
- type ServiceError
Constants ¶
const ( // ExitCodeResultSuccess is the exit code for scceeded builds ExitCodeResultSuccess = 0 // ExitCodeResultUnknown is the exit code for builds with unexpected or unknown statuses. ExitCodeResultUnknown = 10 // ExitCodeResultFailure is the exit code for failed builds ExitCodeResultFailure = 11 // ExitCodeResultInternalError is the exit code for builds failed for internal errors ExitCodeResultInternalError = 12 // ExitCodeResultTimeout is the exit code for timed-out builds ExitCodeResultTimeout = 13 // ExitCodeResultCancelled is the exit code for cancelled builds ExitCodeResultCancelled = 14 // ExitCodeUnexpectedError is the exit code for unexpected errors. ExitCodeUnexpectedError = 100 // ExitCodeConfigurationError is the exit code for configuration errors. ExitCodeConfigurationError = 101 // ExitCodeServiceError is the exit code for service errors such as Google Cloud Platform services. ExitCodeServiceError = 102 )
Variables ¶
This section is empty.
Functions ¶
func ExitCodeForError ¶
ExitCodeForError returns the exit code appropriate for the passed error.
func ExitCodeForStatus ¶
ExitCodeForStatus returns the exit code for the build status.
func NewBuildResultError ¶
NewBuildResultError create a new BuildResultError
func NewConfigError ¶
NewConfigError creates a new ConfigError
func NewServiceError ¶
NewServiceError creates a new ConfigError
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
Backoff calculates sleep time for back off
type BuildResultError ¶
BuildResultError indicates build failures.
func (*BuildResultError) Error ¶
func (err *BuildResultError) Error() string
type CloudBuildSubmit ¶
type CloudBuildSubmit struct {
Config
// contains filtered or unexported fields
}
CloudBuildSubmit holds running state of build submission
func (*CloudBuildSubmit) Cancel ¶ added in v0.2.0
func (s *CloudBuildSubmit) Cancel() error
Cancel cancels running build
func (*CloudBuildSubmit) Execute ¶
func (s *CloudBuildSubmit) Execute() error
Execute performs the sequence to submit a build to CloudBuild
type Config ¶
type Config struct {
// SourceDir is the source directory to archive.
SourceDir string
// Project is the ID of Google Cloud Project
Project string
// GcsSourceStagingDir is the directory on the Google Cloud Storage
// to upload source archives.
GcsSourceStagingDir string
// IgnoreFile is the ignore file to use instead of .gcloudignore
IgnoreFile string
// Config is the file to use instead of cloudbuild.yaml
Config string
// Substitutions is the key=value expressions to replace keywords in cloudbuild.yaml
Substitutions []string
// PollingIntervalMsec is the interval for polling build statuses and logs.
PollingIntervalMsec int
// UploadTimeoutMsec is the milliseconds to consider the upload is timed out.
UploadTimeoutMsec int
// MaxUploadTryCount is the maximum number to give up uploading source arvhive. 0 is infinite
MaxUploadTryCount int
// CloudBuildTimeoutMsec is the millieseconds to consider Cloud Build operations are timed out.
CloudBuildTimeoutMsec int
// MaxStartBuildTryCount is the maximum number to give up starting Cloud Build. 0 is infinite
MaxStartBuildTryCount int
// MaxGetBuildTryCount is the maximum number to give up to get build informations. 0 is infinite
MaxGetBuildTryCount int
// ReadLogTimeoutMsec is the milliseconds to consider fetching logs from Cloud Storage is timed out.
ReadLogTimeoutMsec int
// MaxReadLogErrorCount is the maximum number to give up to read logs. 0 is infinite
MaxReadLogTryCount int
}
Config holds the configuration for cloudbuild
func (*Config) ResolveDefaults ¶
ResolveDefaults fills default values for configurations.
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
ConfigError indicates error caused for configuration issues.
func (ConfigError) FormatError ¶
type GcsPath ¶
type GcsPath struct {
// Bucket is the bucket name
Bucket string
// Object is the path to the object in the bucket
Object string
}
GcsPath represents the location of the object on Google Cloud Storage
func ParseGcsURL ¶
ParseGcsURL parses gs://... URL and returns the bucket name and the object name
type ServiceError ¶
type ServiceError struct {
// contains filtered or unexported fields
}
ServiceError indicates error caused for external services like Google Cloud Platform.