dx

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneChartFromRepo

func CloneChartFromRepo(m Manifest, privateKeyPath string) (string, error)

func HelmTemplate

func HelmTemplate(m Manifest) (string, error)

func SplitHelmOutput

func SplitHelmOutput(input map[string]string) map[string]string

Types

type Artifact

type Artifact struct {
	ID string `json:"id,omitempty"`

	Created int64 `json:"created,omitempty"`

	// The releasable version
	Version Version `json:"version,omitempty"`

	// Arbitrary environment variables from CI
	Context map[string]string `json:"context,omitempty"`

	// The complete set of Gimlet environments from the Gimlet environment files
	Environments []*Manifest `json:"environments,omitempty"`

	// CI job information, test results, Docker image information, etc
	Items []map[string]interface{} `json:"items,omitempty"`
}

Artifact that contains all metadata that can be later used for releasing and auditing

type Chart

type Chart struct {
	Repository string `yaml:"repository" json:"repository"`
	Name       string `yaml:"name" json:"name"`
	Version    string `yaml:"version" json:"version"`
}

type Deploy

type Deploy struct {
	Tag    string    `yaml:"tag,omitempty" json:"tag,omitempty"`
	Branch string    `yaml:"branch,omitempty" json:"branch,omitempty"`
	Event  *GitEvent `yaml:"event,omitempty" json:"event,omitempty"`
}

type GitEvent

type GitEvent int

GitEvent represents the git event that produced the artifact

const (
	// Push artifact is produced by a git push event
	Push GitEvent = iota
	// Tag artifact is produced by a git tag event
	Tag
	// PR artifact is produced by a pull request event
	PR
)

func PRPtr

func PRPtr() *GitEvent

func PushPtr

func PushPtr() *GitEvent

func TagPtr

func TagPtr() *GitEvent

func (GitEvent) MarshalJSON

func (s GitEvent) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (GitEvent) MarshalYAML

func (s GitEvent) MarshalYAML() (interface{}, error)

MarshalYAML marshals the enum as a quoted yaml string

func (GitEvent) String

func (s GitEvent) String() string

func (*GitEvent) UnmarshalJSON

func (s *GitEvent) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshalls a quoted json string to the enum value

func (*GitEvent) UnmarshalYAML

func (s *GitEvent) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML unmarshalls a quoted yaml string to the enum value

type Manifest

type Manifest struct {
	App       string                 `yaml:"app" json:"app"`
	Env       string                 `yaml:"env" json:"env"`
	Namespace string                 `yaml:"namespace" json:"namespace"`
	Deploy    *Deploy                `yaml:"deploy,omitempty" json:"deploy,omitempty"`
	Chart     Chart                  `yaml:"chart" json:"chart"`
	Values    map[string]interface{} `yaml:"values" json:"values"`
}

func (*Manifest) ResolveVars

func (m *Manifest) ResolveVars(vars map[string]string) error

type Release

type Release struct {
	App string `json:"app"`
	Env string `json:"env"`

	ArtifactID  string `json:"artifactId"`
	TriggeredBy string `json:"triggeredBy"`

	Version *Version `json:"version"`

	GitopsRef  string `json:"gitopsRef"`
	GitopsRepo string `json:"gitopsRepo"`
	Created    int64  `json:"created,omitempty"`

	RolledBack bool `json:"rolledBack,omitempty"`
}

Release contains all metadata about a release event

type ReleaseRequest

type ReleaseRequest struct {
	Env         string `json:"env"`
	ArtifactID  string `json:"artifactId"`
	TriggeredBy string `json:"triggeredBy"`
}

ReleaseRequest contains all metadata about the release intent

type RollbackRequest

type RollbackRequest struct {
	Env         string `json:"env"`
	App         string `json:"app"`
	TargetSHA   string `json:"targetSHA"`
	TriggeredBy string `json:"triggeredBy"`
}

RollbackRequest contains all metadata about the rollback intent

type Version

type Version struct {
	RepositoryName string   `json:"repositoryName,omitempty"`
	SHA            string   `json:"sha,omitempty"`
	Created        int64    `json:"created,omitempty"`
	Branch         string   `json:"branch,omitempty"`
	Event          GitEvent `json:"event,omitempty"`
	SourceBranch   string   `json:"sourceBranch,omitempty"`
	TargetBranch   string   `json:"targetBranch,omitempty"`
	Tag            string   `json:"tag,omitempty"`
	AuthorName     string   `json:"authorName,omitempty"`
	AuthorEmail    string   `json:"authorEmail,omitempty"`
	CommitterName  string   `json:"committerName,omitempty"`
	CommitterEmail string   `json:"committerEmail,omitempty"`
	Message        string   `json:"message,omitempty"`
	URL            string   `json:"url,omitempty"`
}

Jump to

Keyboard shortcuts

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