v1

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Index

Constants

View Source
const (
	Clone     Operation = "clone"
	Create    Operation = "create"
	Delete    Operation = "delete"
	Edit      Operation = "edit"
	Append    Operation = "append"
	Undefined Operation = "undefined"

	Automatic Trigger = "automatic"
	Manual    Trigger = "manual"

	Secret    string = "secret"
	ConfigMap string = "configmap"

	BranchFixed string = "BranchFixed"
	BranchRegex string = "BranchRegex"
	TagAny      string = "TagAny"
	TagRegex    string = "TagRegex"

	OperationUndefinedError     string = "undefined operator for %s"
	OperationUnimplementedError string = "unimplemented operator %s for %s"
	UnsupportedVersion          string = "unsupported version %s for %s"

	SourceNotSame         string = "source not same for %s and %s"
	DestinationNotSame    string = "destination not same for %s and %s"
	SourceNotUnique       string = "source not unique for %s"
	DestinationNotUnique  string = "destination not unique for %s"
	SourceDestinationSame string = "source and destination cannot be same for %s clone"

	NameEmpty        string = "name of %s cannot be empty"
	EnvironmentEmpty string = "environment cannot be empty for %s %s"
	DataEmpty        string = "data cannot be empty for %s %s"

	StagesMissing string = "task size cannot be zero"
	ScriptMissing string = "script is mandatory"
)

Variables

This section is empty.

Functions

func CompareResourcePath

func CompareResourcePath(first, second *ResourcePath) bool

Types

type App

type App struct {

	// API version of this configuration
	ApiVersion string       `json:"apiVersion"`
	ConfigMaps []DataHolder `json:"configMaps"`

	// Unique identification of resource
	Destination    *ResourcePath `json:"destination,omitempty"`
	DockerConfig   DockerConfig  `json:"dockerConfig"`
	DockerRegistry string        `json:"dockerRegistry"`
	DockerRepo     string        `json:"dockerRepo"`

	// Action to be taken on the component
	Operation Operation    `json:"operation"`
	Repo      []Repo       `json:"repo"`
	Secrets   []DataHolder `json:"secrets"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`
	Team   string        `json:"team"`

	// Workflow for app
	Workflow *[]Workflow `json:"workflow,omitempty"`
}

App defines model for app .

type BlueGreenStrategy

type BlueGreenStrategy struct {
	AutoPromotionEnabled  bool  `json:"autoPromotionEnabled"`
	AutoPromotionSeconds  int32 `json:"autoPromotionSeconds"`
	PreviewReplicaCount   int32 `json:"previewReplicaCount"`
	ScaleDownDelaySeconds int32 `json:"scaleDownDelaySeconds"`
}

BlueGreenStrategy defines model for blueGreenStrategy.

type Build

type Build struct {
	AccessKey *string `json:"accessKey,omitempty"`

	// API version of this configuration
	ApiVersion     string          `json:"apiVersion"`
	BuildMaterials []BuildMaterial `json:"buildMaterials"`

	// Unique identification of resource
	Destination     *ResourcePath          `json:"destination,omitempty"`
	DockerArguments map[string]interface{} `json:"dockerArguments"`
	NextPipeline    *Pipeline              `json:"nextPipeline,omitempty"`

	// Action to be taken on the component
	Operation Operation `json:"operation"`
	Payload   *string   `json:"payload,omitempty"`
	PostBuild *Task     `json:"postBuild,omitempty"`
	PreBuild  *Task     `json:"preBuild,omitempty"`
	Repo      []Repo    `json:"repo"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`

	// How will this action be initiated
	Trigger    Trigger `json:"trigger"`
	WebHookUrl *string `json:"webHookUrl,omitempty"`
}

Build defines model for build.

func (*Build) GetOperation

func (o *Build) GetOperation() Operation

func (*Build) GetProps

func (o *Build) GetProps() InheritedProps

func (*Build) UpdateMissingProps

func (o *Build) UpdateMissingProps(props InheritedProps) error

type BuildMaterial

type BuildMaterial struct {
	GitMaterialUrl string `json:"gitMaterialUrl"`
	Source         struct {
		Type  string `json:"type"`
		Value string `json:"value"`
	} `json:"source"`
}

BuildMaterial defines model for buildMaterial.

type CanaryStrategy

type CanaryStrategy struct {
	MaxSurge       string        `json:"maxSurge"`
	MaxUnavailable int32         `json:"maxUnavailable"`
	Steps          []interface{} `json:"steps"`
}

CanaryStrategy defines model for canaryStrategy.

type Component

type Component interface {
	GetOperation() Operation
	GetProps() InheritedProps
	UpdateMissingProps(props InheritedProps) error
	CompareSource(path *ResourcePath) error
	CompareDestination(path *ResourcePath) error
}

type ConfigMaps

type ConfigMaps DataHolder

ConfigMaps defines model for configMaps.

type DataHolder

type DataHolder struct {

	// API version of this configuration
	ApiVersion string `json:"apiVersion"`

	// If operation is clone, leaving value empty results in deletion of key in destination.
	Data map[string]interface{} `json:"data"`

	// Unique identification of resource
	Destination  *ResourcePath `json:"destination,omitempty"`
	External     bool          `json:"external"`
	ExternalType string        `json:"externalType"`
	Global       bool          `json:"global"`
	MountPath    string        `json:"mountPath"`

	// Action to be taken on the component
	Operation Operation `json:"operation"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`
	Type   string        `json:"type"`
}

DataHolder defines model for dataHolder.

func (*DataHolder) GetOperation

func (o *DataHolder) GetOperation() Operation

func (*DataHolder) GetProps

func (o *DataHolder) GetProps() InheritedProps

func (*DataHolder) UpdateMissingProps

func (o *DataHolder) UpdateMissingProps(props InheritedProps) error

type Deployment

type Deployment struct {

	// API version of this configuration
	ApiVersion string `json:"apiVersion"`

	// These are applied for environment
	ConfigMaps []DataHolder `json:"configMaps"`

	// Unique identification of resource
	Destination  *ResourcePath `json:"destination,omitempty"`
	NextPipeline *Pipeline     `json:"nextPipeline,omitempty"`

	// Action to be taken on the component
	Operation         Operation `json:"operation"`
	PostDeployment    *Task     `json:"postDeployment,omitempty"`
	PreDeployment     *Task     `json:"preDeployment,omitempty"`
	PreviousPipeline  *Pipeline `json:"previousPipeline,omitempty"`
	RunPostStageInEnv bool      `json:"runPostStageInEnv"`
	RunPreStageInEnv  bool      `json:"runPreStageInEnv"`

	// These are applied for environment
	Secrets []DataHolder `json:"secrets"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`

	// Strategy as defined by devtron template, this overrides at environment level
	Strategy DeploymentStrategy  `json:"strategy"`
	Template *DeploymentTemplate `json:"template,omitempty"`

	// How will this action be initiated
	Trigger *Trigger `json:"trigger,omitempty"`
}

Deployment defines model for deployment.

func (*Deployment) CompareDestination

func (o *Deployment) CompareDestination(with *ResourcePath) error

func (*Deployment) CompareSource

func (o *Deployment) CompareSource(with *ResourcePath) error

func (*Deployment) GetOperation

func (o *Deployment) GetOperation() Operation

func (*Deployment) GetProps

func (o *Deployment) GetProps() InheritedProps

func (*Deployment) UpdateMissingProps

func (o *Deployment) UpdateMissingProps(props InheritedProps) error

type DeploymentStrategy

type DeploymentStrategy struct {
	BlueGreen *BlueGreenStrategy `json:"blueGreen,omitempty"`
	Canary    *CanaryStrategy    `json:"canary,omitempty"`
	Default   string             `json:"default"`
	Recreate  *RecreateStrategy  `json:"recreate,omitempty"`
	Rolling   *RollingStrategy   `json:"rolling,omitempty"`
}

DeploymentStrategy defines model for deploymentStrategy.

type DeploymentTemplate

type DeploymentTemplate struct {

	// API version of this configuration
	ApiVersion         string                 `json:"apiVersion"`
	ChartRefId         int32                  `json:"chartRefId"`
	DefaultAppOverride map[string]interface{} `json:"defaultAppOverride"`

	// Unique identification of resource
	Destination         *ResourcePath `json:"destination,omitempty"`
	IsAppMetricsEnabled bool          `json:"isAppMetricsEnabled"`

	// Action to be taken on the component
	Operation               Operation `json:"operation"`
	RefChartTemplate        string    `json:"refChartTemplate"`
	RefChartTemplateVersion string    `json:"refChartTemplateVersion"`

	// Unique identification of resource
	Source         *ResourcePath          `json:"source,omitempty"`
	ValuesOverride map[string]interface{} `json:"valuesOverride"`
}

DeploymentTemplate defines model for deploymentTemplate.

func (*DeploymentTemplate) CompareDestination

func (o *DeploymentTemplate) CompareDestination(with *ResourcePath) error

func (*DeploymentTemplate) CompareSource

func (o *DeploymentTemplate) CompareSource(with *ResourcePath) error

func (*DeploymentTemplate) GetOperation

func (o *DeploymentTemplate) GetOperation() Operation

func (*DeploymentTemplate) GetProps

func (o *DeploymentTemplate) GetProps() InheritedProps

func (*DeploymentTemplate) UpdateMissingProps

func (o *DeploymentTemplate) UpdateMissingProps(props InheritedProps) error

type DockerConfig

type DockerConfig struct {
	Args                   map[string]interface{} `json:"args"`
	DockerFilePath         string                 `json:"dockerFilePath"`
	DockerFileRelativePath string                 `json:"dockerFileRelativePath"`
	DockerFileRepository   string                 `json:"dockerFileRepository"`
	GitMaterial            string                 `json:"gitMaterial"`
}

DockerConfig defines model for dockerConfig.

type InheritedProps

type InheritedProps struct {

	// Unique identification of resource
	Destination *ResourcePath `json:"destination,omitempty"`

	// Action to be taken on the component
	Operation Operation `json:"operation"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`
}

InheritedProps defines model for inheritedProps.

type Operation

type Operation string

Operation defines model for operation.

type Pipeline

type Pipeline struct {
	Build      *Build      `json:"build,omitempty"`
	Deployment *Deployment `json:"deployment,omitempty"`
}

Pipeline defines model for pipeline.

type PipelineRequest

type PipelineRequest struct {

	// API version of this configuration
	ApiVersion string `json:"apiVersion"`

	// Entries can be of type build or deployment
	Pipelines []Pipeline `json:"pipelines"`
}

PipelineRequest defines model for pipelineRequest.

type PostBuild

type PostBuild Task

PostBuild defines model for postBuild.

type PostDeployment

type PostDeployment Task

PostDeployment defines model for postDeployment.

type PreBuild

type PreBuild Task

PreBuild defines model for preBuild.

type PreDeployment

type PreDeployment Task

PreDeployment defines model for preDeployment.

type RecreateStrategy

type RecreateStrategy map[string]interface{}

RecreateStrategy defines model for recreateStrategy.

type Repo

type Repo struct {

	// branch to build
	Branch *string `json:"branch,omitempty"`

	// path to checkout
	Path *string `json:"path,omitempty"`

	// git url
	Url *string `json:"url,omitempty"`
}

Repo defines model for repo.

type ResourcePath

type ResourcePath struct {
	App         *string `json:"app,omitempty"`
	ConfigMap   *string `json:"configMap,omitempty"`
	Environment *string `json:"environment,omitempty"`
	Pipeline    *string `json:"pipeline,omitempty"`
	Secret      *string `json:"secret,omitempty"`
	Uid         *string `json:"uid,omitempty"`
	Workflow    *string `json:"workflow,omitempty"`
}

ResourcePath defines model for resourcePath.

type RollingStrategy

type RollingStrategy struct {
	MaxSurge       string `json:"maxSurge"`
	MaxUnavailable int32  `json:"maxUnavailable"`
}

RollingStrategy defines model for rollingStrategy.

type Secrets

type Secrets DataHolder

Secrets defines model for secrets.

type Stage

type Stage struct {
	Name string `json:"name"`

	// Action to be taken on the component
	Operation      Operation `json:"operation"`
	OutputLocation *string   `json:"outputLocation,omitempty"`
	Position       *int32    `json:"position,omitempty"`
	Script         *string   `json:"script,omitempty"`
}

Stage defines model for stage.

type Task

type Task struct {

	// API version of this configuration
	ApiVersion string   `json:"apiVersion"`
	ConfigMaps []string `json:"configMaps"`

	// Unique identification of resource
	Destination *ResourcePath `json:"destination,omitempty"`

	// Action to be taken on the component
	Operation Operation `json:"operation"`
	Secrets   []string  `json:"secrets"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`

	// Different stages in this step
	Stages []Stage `json:"stages"`

	// How will this action be initiated
	Trigger *Trigger `json:"trigger,omitempty"`
}

Task defines model for task.

func (*Task) CompareDestination

func (o *Task) CompareDestination(with *ResourcePath) error

func (*Task) CompareSource

func (o *Task) CompareSource(with *ResourcePath) error

func (*Task) GetOperation

func (o *Task) GetOperation() Operation

func (*Task) GetProps

func (o *Task) GetProps() InheritedProps

func (*Task) UpdateMissingProps

func (o *Task) UpdateMissingProps(props InheritedProps) error

type Trigger

type Trigger string

Trigger defines model for trigger.

type Workflow

type Workflow struct {

	// API version of this configuration
	ApiVersion string `json:"apiVersion"`

	// Unique identification of resource
	Destination *ResourcePath `json:"destination,omitempty"`

	// Action to be taken on the component
	Operation Operation `json:"operation"`

	// Entries can be of type build or deployment
	Pipelines *[]Pipeline `json:"pipelines,omitempty"`

	// Unique identification of resource
	Source *ResourcePath `json:"source,omitempty"`
}

Workflow defines model for workflow.

func (*Workflow) CompareDestination

func (o *Workflow) CompareDestination(with *ResourcePath) error

func (*Workflow) CompareSource

func (o *Workflow) CompareSource(with *ResourcePath) error

func (*Workflow) GetOperation

func (o *Workflow) GetOperation() Operation

func (*Workflow) GetProps

func (o *Workflow) GetProps() InheritedProps

func (*Workflow) UpdateMissingProps

func (o *Workflow) UpdateMissingProps(props InheritedProps) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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