flow

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Actor added in v0.0.15

type Actor struct {
	Email string
	Name  string
}

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 NotifyReleaseOptions struct {
	Environment   string
	Namespace     string
	Service       string
	ArtifactID    string
	Squad         string
	CommitAuthor  string
	CommitMessage string
	CommitSHA     string
	CommitLink    string
	Releaser      string
}

type PromoteResult added in v0.0.18

type PromoteResult struct {
	ReleaseID            string
	OverwritingNamespace string
}

type RollbackResult added in v0.0.10

type RollbackResult struct {
	Previous             string
	New                  string
	OverwritingNamespace string
}

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
}

func (*Service) NotifyCommitter added in v0.0.15

func (s *Service) NotifyCommitter(ctx context.Context, event *http.PodNotifyRequest) error

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.

func (*Service) Rollback added in v0.0.15

func (s *Service) Rollback(ctx context.Context, actor Actor, environment, namespace, service string) (RollbackResult, error)

func (*Service) Status added in v0.0.15

func (s *Service) Status(ctx context.Context, namespace, service string) (StatusResponse, error)

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"`
}

Jump to

Keyboard shortcuts

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