Documentation ¶
Index ¶
- Variables
- func PushArtifact(ctx context.Context, gitSvc *git.Service, ...) (string, error)
- type Actor
- type DescribeReleaseResponse
- type Environment
- type NotifyReleaseOptions
- type PromoteResult
- type RollbackResult
- type Service
- func (s *Service) DescribeArtifact(ctx context.Context, service string, n int) ([]artifact.Spec, error)
- func (s *Service) DescribeRelease(ctx context.Context, namespace, environment, service string) (DescribeReleaseResponse, error)
- func (s *Service) NotifyCommitter(ctx context.Context, event *http.PodNotifyRequest) error
- func (s *Service) Promote(ctx context.Context, actor Actor, environment, namespace, service string) (PromoteResult, error)
- func (s *Service) ReleaseArtifactID(ctx context.Context, actor Actor, environment, service, artifactID string) (string, error)
- func (s *Service) ReleaseBranch(ctx context.Context, actor Actor, environment, service, branch string) (string, error)
- func (s *Service) Rollback(ctx context.Context, actor Actor, environment, namespace, service string) (RollbackResult, error)
- func (s *Service) Status(ctx context.Context, namespace, service string) (StatusResponse, error)
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownEnvironment = errors.New("unknown environment") ErrNamespaceNotAllowedByArtifact = errors.New("namespace not allowed by artifact") )
Functions ¶
func PushArtifact ¶ added in v0.0.4
func PushArtifact(ctx context.Context, gitSvc *git.Service, artifactFileName, resourceRoot 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.
Types ¶
type DescribeReleaseResponse ¶ added in v0.0.33
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 NotifyReleaseOptions ¶ added in v0.0.12
type PromoteResult ¶ added in v0.0.18
type RollbackResult ¶ added in v0.0.10
type Service ¶ added in v0.0.15
type Service struct { ArtifactFileName string UserMappings map[string]string Slack *slack.Client Grafana *grafana.Service Git *git.Service Tracer tracing.Tracer MaxRetries int }
func (*Service) DescribeArtifact ¶ added in v0.0.33
func (s *Service) DescribeArtifact(ctx context.Context, service string, n int) ([]artifact.Spec, error)
DescribeArtifact returns n artifacts for a service.
func (*Service) DescribeRelease ¶ added in v0.0.33
func (s *Service) DescribeRelease(ctx context.Context, namespace, environment, service string) (DescribeReleaseResponse, error)
DescribeRelease returns information about a specific release in an environment.
func (*Service) NotifyCommitter ¶ added in v0.0.15
func (*Service) Promote ¶ added in v0.0.15
func (s *Service) Promote(ctx context.Context, actor Actor, environment, namespace, service string) (PromoteResult, 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 (*Service) ReleaseArtifactID ¶ added in v0.0.15
func (s *Service) ReleaseArtifactID(ctx context.Context, actor Actor, environment, service, artifactID 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 (*Service) ReleaseBranch ¶ added in v0.0.15
func (s *Service) ReleaseBranch(ctx context.Context, actor Actor, environment, service, branch 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.
type StatusResponse ¶
type StatusResponse struct { DefaultNamespaces bool `json:"defaultNamespaces,omitempty"` Dev Environment `json:"dev,omitempty"` Staging Environment `json:"staging,omitempty"` Prod Environment `json:"prod,omitempty"` }