codebuild

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildStatusSubmitted  = "SUBMITTED"
	BuildStatusInProgress = "IN_PROGRESS"
	BuildStatusSucceeded  = "SUCCEEDED"
	BuildStatusFailed     = "FAILED"
	BuildStatusStopped    = "STOPPED"
)

Build status constants.

Variables

This section is empty.

Functions

func AllPhaseNames

func AllPhaseNames() []string

AllPhaseNames returns phase names as strings (for log generation).

Types

type Build

type Build struct {
	ID            string
	ARN           string
	ProjectName   string
	BuildNumber   int64
	BuildStatus   string
	CurrentPhase  string
	Phases        []BuildPhase
	StartTime     time.Time
	EndTime       *time.Time
	Source        ProjectSource
	Artifacts     ProjectArtifacts
	Environment   ProjectEnvironment
	ServiceRole   string
	TimeoutInMins int
	Logs          BuildLogs
	// contains filtered or unexported fields
}

Build represents a single build execution.

type BuildLogs

type BuildLogs struct {
	GroupName  string
	StreamName string
	DeepLink   string
}

BuildLogs holds build log references.

type BuildPhase

type BuildPhase struct {
	PhaseType     BuildPhaseType
	PhaseStatus   string // SUCCEEDED, FAILED, TIMED_OUT, IN_PROGRESS
	StartTime     time.Time
	EndTime       *time.Time
	DurationInSec int64
}

BuildPhase represents the state of a single build phase.

func GenerateCompletedPhases

func GenerateCompletedPhases(baseTime time.Time) []BuildPhase

GenerateCompletedPhases creates a set of build phases as if the build completed successfully. Each phase gets a start/end time offset from baseTime.

func GenerateFailedPhases

func GenerateFailedPhases(baseTime time.Time) []BuildPhase

GenerateFailedPhases creates phases where the BUILD phase fails.

type BuildPhaseType

type BuildPhaseType string

BuildPhaseType represents a CodeBuild build phase.

const (
	PhaseSubmitted       BuildPhaseType = "SUBMITTED"
	PhaseQueued          BuildPhaseType = "QUEUED"
	PhaseProvisioning    BuildPhaseType = "PROVISIONING"
	PhaseDownloadSource  BuildPhaseType = "DOWNLOAD_SOURCE"
	PhaseInstall         BuildPhaseType = "INSTALL"
	PhasePreBuild        BuildPhaseType = "PRE_BUILD"
	PhaseBuild           BuildPhaseType = "BUILD"
	PhasePostBuild       BuildPhaseType = "POST_BUILD"
	PhaseUploadArtifacts BuildPhaseType = "UPLOAD_ARTIFACTS"
	PhaseFinalizing      BuildPhaseType = "FINALIZING"
	PhaseCompleted       BuildPhaseType = "COMPLETED"
)

func AllPhases

func AllPhases() []BuildPhaseType

AllPhases returns the ordered list of build phases that a build progresses through.

type CodeBuildService

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

CodeBuildService is the cloudmock implementation of the AWS CodeBuild API.

func New

func New(accountID, region string) *CodeBuildService

New returns a new CodeBuildService for the given AWS account ID and region.

func NewWithLocator

func NewWithLocator(accountID, region string, locator ServiceLocator) *CodeBuildService

NewWithLocator returns a new CodeBuildService with a ServiceLocator for cross-service integration.

func (*CodeBuildService) Actions

func (s *CodeBuildService) Actions() []service.Action

Actions returns the list of CodeBuild API actions supported.

func (*CodeBuildService) HandleRequest

func (s *CodeBuildService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming CodeBuild request to the appropriate handler.

func (*CodeBuildService) HealthCheck

func (s *CodeBuildService) HealthCheck() error

HealthCheck always returns nil.

func (*CodeBuildService) Name

func (s *CodeBuildService) Name() string

Name returns the AWS service name used for routing.

func (*CodeBuildService) SetLocator

func (s *CodeBuildService) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service calls.

type EnvironmentVariable

type EnvironmentVariable struct {
	Name  string
	Value string
	Type  string
}

EnvironmentVariable is a name/value pair for build environments.

type Project

type Project struct {
	Name          string
	ARN           string
	Description   string
	Source        ProjectSource
	Artifacts     ProjectArtifacts
	Environment   ProjectEnvironment
	ServiceRole   string
	TimeoutInMins int
	Tags          map[string]string
	CreatedAt     time.Time
	LastModified  time.Time
}

Project represents a CodeBuild project.

type ProjectArtifacts

type ProjectArtifacts struct {
	Type     string
	Location string
}

ProjectArtifacts describes the build output.

type ProjectEnvironment

type ProjectEnvironment struct {
	Type            string
	Image           string
	ComputeType     string
	EnvironmentVars []EnvironmentVariable
}

ProjectEnvironment describes the build environment.

type ProjectSource

type ProjectSource struct {
	Type     string
	Location string
}

ProjectSource describes the build source.

type ReportExportConfig

type ReportExportConfig struct {
	ExportConfigType string
	S3Destination    *S3ReportExportConfig
}

ReportExportConfig describes where reports are exported.

type ReportGroup

type ReportGroup struct {
	ARN          string
	Name         string
	Type         string
	ExportConfig ReportExportConfig
	CreatedAt    time.Time
	Tags         map[string]string
}

ReportGroup represents a CodeBuild report group.

type S3ReportExportConfig

type S3ReportExportConfig struct {
	Bucket string
	Path   string
}

S3ReportExportConfig describes S3 export configuration.

type ServiceLocator

type ServiceLocator interface {
	Lookup(name string) (service.Service, error)
}

ServiceLocator resolves other services for cross-service integration.

type Store

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

Store is the in-memory store for all CodeBuild resources.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty CodeBuild store.

func (*Store) BatchGetBuilds

func (s *Store) BatchGetBuilds(ids []string) ([]*Build, []string)

func (*Store) BatchGetProjects

func (s *Store) BatchGetProjects(names []string) ([]*Project, []string)

func (*Store) BatchGetReportGroups

func (s *Store) BatchGetReportGroups(names []string) ([]*ReportGroup, []string)

func (*Store) CreateProject

func (s *Store) CreateProject(p *Project) (*Project, *service.AWSError)

func (*Store) CreateReportGroup

func (s *Store) CreateReportGroup(name, reportType string, exportConfig ReportExportConfig, tags map[string]string) (*ReportGroup, *service.AWSError)

func (*Store) DeleteProject

func (s *Store) DeleteProject(name string) *service.AWSError

func (*Store) DeleteReportGroup

func (s *Store) DeleteReportGroup(name string) *service.AWSError

func (*Store) GetBuild

func (s *Store) GetBuild(buildID string) (*Build, *service.AWSError)

func (*Store) GetProject

func (s *Store) GetProject(name string) (*Project, *service.AWSError)

func (*Store) ListBuilds

func (s *Store) ListBuilds() []string

func (*Store) ListBuildsForProject

func (s *Store) ListBuildsForProject(projectName string) []string

func (*Store) ListProjects

func (s *Store) ListProjects() []string

func (*Store) ListReportGroups

func (s *Store) ListReportGroups() []string

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) map[string]string

func (*Store) StartBuild

func (s *Store) StartBuild(projectName string, envOverrides *ProjectEnvironment) (*Build, *service.AWSError)

func (*Store) StopBuild

func (s *Store) StopBuild(buildID string) (*Build, *service.AWSError)

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string) *service.AWSError

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string) *service.AWSError

func (*Store) UpdateProject

func (s *Store) UpdateProject(name string, updates map[string]any) (*Project, *service.AWSError)

Jump to

Keyboard shortcuts

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