v1alpha1

package
v0.34.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EnvironmentKind = "Environment"
View Source
const ProjectKind = "Project"
View Source
const ReleaseKind = "Release"

Variables

This section is empty.

Functions

func GetEnvironmentNames

func GetEnvironmentNames(environments []*Environment) []string

func IsValidEnvironment

func IsValidEnvironment(apiVersion, kind string) bool

func IsValidProject

func IsValidProject(apiVersion, kind string) bool

func IsValidRelease

func IsValidRelease(apiVersion, kind string) bool

Types

type Environment

type Environment struct {
	// ApiVersion is the API version of the environment.
	ApiVersion string `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty"`

	// Kind is the kind of the environment.
	Kind string `yaml:"kind,omitempty" json:"kind,omitempty"`

	// EnvironmentMetadata is the metadata of the environment.
	EnvironmentMetadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`

	// Spec is the spec of the environment.
	Spec EnvironmentSpec `yaml:"spec,omitempty" json:"spec,omitempty"`

	// File represents the in-memory yaml file of the project.
	File *yml.File `yaml:"-" json:"-"`

	// Dir is the path to the environment directory.
	Dir string `yaml:"-" json:"-"`
}

func GetEnvironmentByName

func GetEnvironmentByName(environments []*Environment, name string) (*Environment, error)

func GetEnvironmentsByNames

func GetEnvironmentsByNames(environments []*Environment, names []string) []*Environment

GetEnvironmentsByNames returns the subset of environments with given names, preserving their order in the original list. If names is empty, all environments are returned.

func NewEnvironment

func NewEnvironment(file *yml.File) (*Environment, error)

NewEnvironment creates a new environment from given yaml file.

func (*Environment) IsPromotableTo

func (e *Environment) IsPromotableTo(targetEnv *Environment) bool

type EnvironmentMetadata

type EnvironmentMetadata struct {
	// Name is the name of the environment.
	Name string `yaml:"name,omitempty" json:"name,omitempty"`

	// Labels is the list of labels for the environment.
	Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`

	// Annotations is the list of annotations for the environment.
	Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
}

type EnvironmentSpec

type EnvironmentSpec struct {
	// Order controls the display order of the environment.
	Order int `yaml:"order,omitempty" json:"order,omitempty"`

	// Promotion controls the promotion of releases to this environment.
	Promotion Promotion `yaml:"promotion,omitempty" json:"promotion,omitempty"`

	// Cluster is the name of environment's cluster.
	Cluster string `yaml:"cluster,omitempty" json:"cluster,omitempty"`

	// Namespace is the name of environment's namespace within cluster.
	Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`

	// Owners is the list of identifiers of owners of the environment.
	// It can be any strings that uniquely identifies the owners, such as email addresses or Jac group identifiers.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`

	// SealedSecretsCert is the public certificate of the Sealed Secrets controller for this environment
	// that can be used to encrypt secrets targeted to this environment using the `joy secret seal` command.
	SealedSecretsCert string `yaml:"sealedSecretsCert,omitempty" json:"sealedSecretsCert,omitempty"`
}

type Project

type Project struct {
	// ApiVersion is the API version of the project.
	ApiVersion string `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty"`

	// Kind is the kind of the project.
	Kind string `yaml:"kind,omitempty" json:"kind,omitempty"`

	// ProjectMetadata is the metadata of the project.
	ProjectMetadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`

	// Spec is the spec of the project.
	Spec ProjectSpec `yaml:"spec,omitempty" json:"spec,omitempty"`

	// File represents the in-memory yaml file of the project.
	File *yml.File `yaml:"-" json:"-"`
}

func NewProject

func NewProject(file *yml.File) (*Project, error)

NewProject creates a new project from given yaml file.

type ProjectMetadata

type ProjectMetadata struct {
	// Name is the name of the project.
	Name string `yaml:"name,omitempty" json:"name,omitempty"`

	// Labels is the list of labels for the project.
	Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`

	// Annotations is the list of annotations for the project.
	Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
}

type ProjectSpec

type ProjectSpec struct {
	// Owners is the list of identifiers of owners of the project.
	// It can be any string that uniquely identifies the owners, such as email addresses or Jac group identifiers.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`

	// CodeOwners is the list of GitHub Code Owners of the project.
	// This gets added to the CODEOWNERS file from the repository.
	// Unlike Owners above which are based on Jac, they are GitHub usernames or teams.
	CodeOwners []string `yaml:"codeOwners,omitempty" json:"codeOwners,omitempty"`

	// Git repository of the project.
	Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`

	// Location of the project files in the repository. Should be empty if the whole repository is the project.
	// If there is more than one location, specify the main subdirectory of the project first.
	RepositorySubpaths []string `yaml:"repositorySubpaths,omitempty" json:"repositorySubpaths,omitempty"`

	// GitTagTemplate allows you to configure what your git tag look like relative to a release via go templates
	// example: gitTagTemplate: api/v{{ .Release.Spec.Version }}
	GitTagTemplate string `yaml:"gitTagTemplate,omitempty" json:"gitTagTemplate,omitempty"`
}

type Promotion

type Promotion struct {
	AllowAutoMerge   bool     `yaml:"allowAutoMerge,omitempty" json:"allowAutoMerge,omitempty"`
	FromPullRequests bool     `yaml:"fromPullRequests,omitempty" json:"fromPullRequests,omitempty"`
	FromEnvironments []string `yaml:"fromEnvironments,omitempty" json:"fromEnvironments,omitempty"`
}

type Release

type Release struct {
	// ApiVersion is the API version of the release.
	ApiVersion string `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty"`

	// Kind is the kind of the release.
	Kind string `yaml:"kind,omitempty" json:"kind,omitempty"`

	// ReleaseMetadata is the metadata of the release.
	ReleaseMetadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`

	// Spec is the spec of the release.
	Spec ReleaseSpec `yaml:"spec,omitempty" json:"spec,omitempty"`

	// File represents the in-memory yaml file of the release.
	File *yml.File `yaml:"-" json:"-"`

	// Project is the project that the release belongs to.
	Project *Project `yaml:"-" json:"-"`

	// Environment is the environment that the release is deployed to.
	Environment *Environment `yaml:"-" json:"-"`
}

func LoadRelease

func LoadRelease(file *yml.File) (*Release, error)

LoadRelease loads a release from the given release file.

func (*Release) UnmarshalYAML added in v0.20.3

func (release *Release) UnmarshalYAML(node *yaml.Node) error

type ReleaseChart

type ReleaseChart struct {
	// Name is the name of the chart.
	Name string `yaml:"name,omitempty" json:"name,omitempty"`

	// RepoUrl is the url of the chart repository.
	RepoUrl string `yaml:"repoUrl,omitempty" json:"repoUrl,omitempty"`

	// Version of the chart.
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

type ReleaseMetadata

type ReleaseMetadata struct {
	// Name is the name of the release.
	Name string `yaml:"name,omitempty" json:"name,omitempty"`

	// Labels is the list of labels for the release.
	Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`

	// Annotations is the list of annotations for the release.
	Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
}

type ReleaseSpec

type ReleaseSpec struct {
	// Project is the name of the project that the release belongs to.
	Project string `yaml:"project,omitempty" json:"project,omitempty"`

	// Version of the release, typically corresponding to the image build version being deployed.
	Version string `yaml:"version,omitempty" json:"version,omitempty"`

	// Chart is the chart that the release is based on.
	Chart ReleaseChart `yaml:"chart,omitempty" json:"chart,omitempty"`

	// Values is the values to use to render the chart.
	Values map[string]interface{} `yaml:"values,omitempty" json:"values,omitempty"`
}

Jump to

Keyboard shortcuts

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