Documentation ¶
Index ¶
- Constants
- Variables
- type BuildContext
- type CloudFormationEvent
- type CloudFormationResponse
- type ECSEvent
- type GitHubEvent
- type GitHubStatus
- type LambdaManager
- type Parameter
- type ParameterManifest
- type PipelineManager
- type PipelineStageDetail
- type RepoNotFoundError
- type Repository
- type SecureStore
- type StackManager
Constants ¶
const ( CloudFormationRequestDelete = "Delete" CloudFormationResponseSuccess = "SUCCESS" CloudFormationResponseFailed = "FAILED" DynamoDBEventInsert = "INSERT" EcsStateRunning = "RUNNING" EcsStateStopped = "STOPPED" EcsFailureReason = "Essential container in task exited" EventTypePush = "push" GitContextPrep = "build/0-prep" GitRefBranch = "branch" GitRefMaster = "master" GitRefTag = "tag" GitStateError = "error" GitStateFailure = "failure" GitStatePending = "pending" GitStateSuccess = "success" KeyHmac = "opolis.github.hmac" KeyToken = "opolis.github.token" PipelineStateStarted = "STARTED" PipelineStateResumed = "RESUMED" PipelineStateSucceeded = "SUCCEEDED" PipelineStateFailed = "FAILED" )
Variables ¶
var ( RegexTagRef = regexp.MustCompile(`v[0-9]+\.[0-9]+\.[0-9]+$`) RegexCompleted = regexp.MustCompile(`.*_COMPLETE`) RegexInProgress = regexp.MustCompile(`.*_IN_PROGRESS`) RegexFailed = regexp.MustCompile(`.*_FAILED`) RegexRollback = regexp.MustCompile(`.*ROLLBACK.*`) )
Functions ¶
This section is empty.
Types ¶
type BuildContext ¶
BuildContext represents the template and parameters required to deploy a pipeline.
type CloudFormationEvent ¶
type CloudFormationEvent struct { RequestId string `json:"RequestId"` StackId string `json:"StackId"` RequestType string `json:"RequestType"` ResourceType string `json:"ResourceType"` LogicalResourceId string `json:"LogicalResourceId"` PhysicalResourceId string `json:"PhysicalResourceId"` ResourceProperties json.RawMessage `json:"ResourceProperties"` OldResourceProperties json.RawMessage `json:"OldResourceProperties"` ResponseURL string `json:"ResponseURL"` ServiceToken string `json:"ServiceToken"` }
CloudFormationEvent
type CloudFormationResponse ¶
type CloudFormationResponse struct { Status string `json:"Status"` Reason string `json:"Reason"` StackId string `json:"StackId"` RequestId string `json:"RequestId"` LogicalResourceId string `json:"LogicalResourceId"` PhysicalResourceId string `json:"PhysicalResourceId"` }
CloudFormationResponse
type ECSEvent ¶
type ECSEvent struct { Containers []struct { Name string `json:"name"` ContainerArn string `json:"containerArn"` LastStatus string `json:"lastStatus"` } `json:"containers"` StoppedReason string `json:"stoppedReason,omitempty"` TaskArn string `json:"taskArn"` }
ECSEvent
type GitHubEvent ¶
type GitHubEvent struct { Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"` Created bool `json:"created"` Deleted bool `json:"deleted"` Repository struct { Name string `json:"name"` Owner struct { Name string `json:"name"` } `json:"owner"` } `json:"repository"` }
GitHubEvent references relevant fields from the push event.
type GitHubStatus ¶
type GitHubStatus struct { State string `json:"state"` TargetUrl string `json:"target_url"` Description string `json:"description"` Context string `json:"context"` }
GitHubStatus stores status context for a particular repo commit hash
type LambdaManager ¶
type Parameter ¶
type Parameter struct { ParameterKey string `json:"ParameterKey"` ParameterValue string `json:"ParameterValue"` }
Parameter defines a common format for expressing stack parameters.
type ParameterManifest ¶
type ParameterManifest struct { Development []Parameter `json:"development"` Staging []Parameter `json:"staging"` Production []Parameter `json:"production"` }
ParameterManifest defines a common format for expressing a _set_ of stack parameters.
type PipelineManager ¶
type PipelineManager interface { GetRepoInfo(name string) (string, string, error) GetRevision(execId, name string) (string, error) JobSuccess(id string) error JobFailure(id, message string) error }
PipelineManger provides a means of interacting with and querying active CI/CD pipelines.
type PipelineStageDetail ¶
type PipelineStageDetail struct { Version float32 `json:"version"` Pipeline string `json:"pipeline"` ExecutionId string `json:"execution-id"` Stage string `json:"stage"` State string `json:"state"` }
PipelineStageDetail represents a stage change event metadata
type RepoNotFoundError ¶
type RepoNotFoundError struct{}
RepoNotFoundError - semantic type to represent '404' from a repo fetch
func (RepoNotFoundError) Error ¶
func (e RepoNotFoundError) Error() string
type Repository ¶
type Repository interface { Get(ref string, path string) ([]byte, error) Status(sha string, status GitHubStatus) error }
Repository provides a means to fetch data from the version control repository.
type SecureStore ¶
SecureStore accesses secure parameters.
type StackManager ¶
type StackManager interface { Create(name string, parameters []Parameter, template []byte) error Update(name string, parameters []Parameter, template []byte) error Delete(name string) error Status(name string) (bool, string, error) LastUpdated(name string) (*time.Time, error) StartBuild(name string) error UpdateBuild(name, ref string) error CancelUpdate(name string) error }
StackManager provides a means of managing infrastructure 'stacks' A stack is a collection of resources typically specified by a version controlled file.