flow

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 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")
)

Functions

func NotifyCommitter

func NotifyCommitter(ctx context.Context, configRepoURL, artifactFileName, sshPrivateKeyPath string, event *http.PodNotifyRequest, client *slack.Client) error

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 FlowOptions struct {
	ConfigRepoURL     string
	ArtifactFileName  string
	Service           string
	Environment       string
	CommitterName     string
	CommitterEmail    string
	SSHPrivateKeyPath string
	SlackToken        string
	GrafanaAPIKey     string
	GrafanaUrl        string
	Branch            string
	ArtifactID        string
}

type NotifyReleaseOptions added in v0.0.12

type NotifyReleaseOptions struct {
	GrafanaBaseUrl string
	GrafanaApiKey  string
	SlackToken     string
	Environment    string
	Service        string
	ArtifactID     string
	Squad          string
	CommitAuthor   string
	CommitMessage  string
	CommitSHA      string
	CommitLink     string
	Releaser       string
}

type RollbackResult added in v0.0.10

type RollbackResult struct {
	Previous string
	New      string
}

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

func Status

func Status(ctx context.Context, configRepoURL, artifactFileName, service, sshPrivateKeyPath string) (StatusResponse, error)

Jump to

Keyboard shortcuts

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