Documentation ¶
Index ¶
- Variables
- func NotifyCommitter(ctx context.Context, configRepoURL, artifactFileName, sshPrivateKeyPath string, ...) error
- func Promote(ctx context.Context, ...) (string, error)
- func ReleaseArtifactID(ctx context.Context, ...) (string, error)
- func ReleaseBranch(ctx context.Context, ...) (string, error)
- type Environment
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
var (
ErrUnknownEnvironment = errors.New("unknown environment")
)
Functions ¶
func NotifyCommitter ¶
func Promote ¶
func Promote(ctx context.Context, configRepoURL, artifactFileName, service, env, committerName, committerEmail, sshPrivateKeyPath string) (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 ReleaseArtifactID ¶
func ReleaseArtifactID(ctx context.Context, configRepoURL, artifactFileName, service, env, artifactID, committerName, committerEmail, sshPrivateKeyPath string) (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, configRepoURL, artifactFileName, service, env, branch, committerName, committerEmail, sshPrivateKeyPath string) (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 StatusResponse ¶
type StatusResponse struct { Dev Environment `json:"dev,omitempty"` Staging Environment `json:"staging,omitempty"` Prod Environment `json:"prod,omitempty"` }