Documentation ¶
Index ¶
- Variables
- func NotifyCommitter(ctx context.Context, configRepoURL, artifactFileName, sshPrivateKeyPath string, ...) error
- func Promote(ctx context.Context, opts FlowOptions) (string, error)
- func PushArtifact(ctx context.Context, ...) (string, error)
- func ReleaseArtifactID(ctx context.Context, opts FlowOptions) (string, error)
- func ReleaseBranch(ctx context.Context, opts FlowOptions) (string, error)
- type Environment
- type FlowOptions
- type NotifyReleaseOptions
- type RollbackResult
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
var (
ErrUnknownEnvironment = errors.New("unknown environment")
)
Functions ¶
func NotifyCommitter ¶
func Promote ¶
func Promote(ctx context.Context, opts FlowOptions) (string, error)
Promote promotes a specific service to environment env.
By convention, promotion means:
Move released version of the previous environment into this environment
Promotion follows this convention
master -> dev -> staging -> prod
Flow ¶
Checkout the current kubernetes configuration status and find the artifact.json spec for the service and previous environment. Use the artifact ID as a key for locating the artifacts.
Find the commit with the artifact ID and checkout the config repository at this point.
Copy artifacts from the current release into the new environment and commit the changes
func PushArtifact ¶ added in v0.0.4
func PushArtifact(ctx context.Context, configRepoURL, artifactFileName, resourceRoot, sshPrivateKeyPath string) (string, error)
PushArtifact pushes an artifact into the configuration repository.
The resourceRoot specifies the path to the artifact files. All files in this path will be pushed.
func ReleaseArtifactID ¶
func ReleaseArtifactID(ctx context.Context, opts FlowOptions) (string, error)
ReleaseArtifactID releases a specific artifact to environment env.
Flow ¶
Locate the commit of the artifact ID and checkout the config repository at this point.
Copy resources from the artifact commit into the environment and commit the changes
func ReleaseBranch ¶
func ReleaseBranch(ctx context.Context, opts FlowOptions) (string, error)
ReleaseBranch releases the latest artifact from a branch of a specific service to environment env.
Flow ¶
Checkout the current kubernetes configuration status and find the artifact spec for the service and branch.
Copy artifacts from the artifacts into the environment and commit the changes.
Types ¶
type Environment ¶
type Environment struct { Tag string `json:"tag,omitempty"` Committer string `json:"committer,omitempty"` Author string `json:"author,omitempty"` Message string `json:"message,omitempty"` Date time.Time `json:"date,omitempty"` BuildURL string `json:"buildUrl,omitempty"` HighVulnerabilities int64 `json:"highVulnerabilities,omitempty"` MediumVulnerabilities int64 `json:"mediumVulnerabilities,omitempty"` LowVulnerabilities int64 `json:"lowVulnerabilities,omitempty"` }
type FlowOptions ¶ added in v0.0.12
type NotifyReleaseOptions ¶ added in v0.0.12
type RollbackResult ¶ added in v0.0.10
func Rollback ¶ added in v0.0.10
func Rollback(ctx context.Context, opts FlowOptions) (RollbackResult, error)
type StatusResponse ¶
type StatusResponse struct { Dev Environment `json:"dev,omitempty"` Staging Environment `json:"staging,omitempty"` Prod Environment `json:"prod,omitempty"` }