pipeline

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 80 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesSecret  string = "KubernetesSecret"
	AWSSecretsManager string = "AWSSecretsManager"
	AWSSystemManager  string = "AWSSystemManager"
	HashiCorpVault    string = "HashiCorpVault"
)
View Source
const AFTER_DOCKER_BUILD string = "AFTER_DOCKER_BUILD"
View Source
const BEFORE_DOCKER_BUILD string = "BEFORE_DOCKER_BUILD"
View Source
const BLOB_STORAGE_AZURE = "AZURE"
View Source
const BLOB_STORAGE_GCP = "GCP"
View Source
const BLOB_STORAGE_MINIO = "MINIO"
View Source
const BLOB_STORAGE_S3 = "S3"
View Source
const BULK_DEPLOY_DURABLE = "ORCHESTRATOR.CD.BULK.DURABLE-1"
View Source
const BULK_DEPLOY_GROUP = "ORCHESTRATOR.CD.BULK.GROUP-1"
View Source
const BULK_DEPLOY_TOPIC = "ORCHESTRATOR.CD.BULK"
View Source
const BULK_HIBERNATE_DURABLE = "ORCHESTRATOR.CD.BULK-HIBERNATE.DURABLE-1"
View Source
const BULK_HIBERNATE_GROUP = "ORCHESTRATOR.CD.BULK-HIBERNATE.GROUP-1"
View Source
const BULK_HIBERNATE_TOPIC = "ORCHESTRATOR.CD.BULK-HIBERNATE"
View Source
const CD_COMPLETE_DURABLE = "CI-RUNNER.CD-COMPLETE_DURABLE-1"
View Source
const CD_COMPLETE_GROUP = "CI-RUNNER.CD-COMPLETE_GROUP-1"
View Source
const CD_STAGE_COMPLETE_TOPIC = "CI-RUNNER.CD-STAGE-COMPLETE"
View Source
const CD_WORKFLOW_NAME = "cd"
View Source
const DevMode = "DEV"
View Source
const ExternalCiWebhookPath = "orchestrator/webhook/ext-ci"
View Source
const POST = "POST"
View Source
const PRE = "PRE"
View Source
const ProdMode = "PROD"
View Source
const WorkflowAborted = "Aborted"
View Source
const WorkflowCancel = "CANCELLED"
View Source
const WorkflowFailed = "Failed"
View Source
const WorkflowStarting = "Starting"

Variables

View Source
var DefaultPipelineValue = []byte(`{"ConfigMaps":{"enabled":false},"ConfigSecrets":{"enabled":false},"ContainerPort":[],"EnvVariables":[],"GracePeriod":30,"LivenessProbe":{},"MaxSurge":1,"MaxUnavailable":0,"MinReadySeconds":60,"ReadinessProbe":{},"Spec":{"Affinity":{"Values":"nodes","key":""}},"app":"13","appMetrics":false,"args":{},"autoscaling":{},"command":{"enabled":false,"value":[]},"containers":[],"dbMigrationConfig":{"enabled":false},"deployment":{"strategy":{"rolling":{"maxSurge":"25%","maxUnavailable":1}}},"deploymentType":"ROLLING","env":"1","envoyproxy":{"configMapName":"","image":"","resources":{"limits":{"cpu":"50m","memory":"50Mi"},"requests":{"cpu":"50m","memory":"50Mi"}}},"image":{"pullPolicy":"IfNotPresent"},"ingress":{},"ingressInternal":{"annotations":{},"enabled":false,"host":"","path":"","tls":[]},"initContainers":[],"pauseForSecondsBeforeSwitchActive":30,"pipelineName":"","prometheus":{"release":"monitoring"},"rawYaml":[],"releaseVersion":"1","replicaCount":1,"resources":{"limits":{"cpu":"0.05","memory":"50Mi"},"requests":{"cpu":"0.01","memory":"10Mi"}},"secret":{"data":{},"enabled":false},"server":{"deployment":{"image":"","image_tag":""}},"service":{"annotations":{},"type":"ClusterIP"},"servicemonitor":{"additionalLabels":{}},"tolerations":[],"volumeMounts":[],"volumes":[],"waitForSecondsBeforeScalingDown":30}`)

Functions

This section is empty.

Types

type AppBean

type AppBean struct {
	Id     int    `json:"id"`
	Name   string `json:"name,notnull"`
	TeamId int    `json:"teamId,omitempty"`
}

type AppConfigResponse

type AppConfigResponse struct {
	//DefaultAppConfig  json.RawMessage `json:"defaultAppConfig"`
	//AppConfig         TemplateRequest            `json:"appConfig"`
	LatestAppConfig   TemplateRequest `json:"latestAppConfig"`
	PreviousAppConfig TemplateRequest `json:"previousAppConfig"`
}

type AppMetricEnableDisableRequest

type AppMetricEnableDisableRequest struct {
	AppId               int   `json:"appId,omitempty"`
	EnvironmentId       int   `json:"environmentId,omitempty"`
	IsAppMetricsEnabled bool  `json:"isAppMetricsEnabled"`
	UserId              int32 `json:"-"`
}

type AppMetricsEnabled

type AppMetricsEnabled struct {
	AppMetrics bool `json:"app-metrics"`
}

type AzureBlob

type AzureBlob struct {
	// contains filtered or unexported fields
}

func (*AzureBlob) DownloadBlob

func (impl *AzureBlob) DownloadBlob(context context.Context, blobName string, config *AzureBlobConfig, file *os.File) error

func (*AzureBlob) UploadBlob

func (impl *AzureBlob) UploadBlob(context context.Context, blobName string, config *AzureBlobConfig, cacheFileName string) error

type AzureBlobConfig

type AzureBlobConfig struct {
	Enabled              bool   `json:"enabled"`
	AccountName          string `json:"accountName"`
	BlobContainerCiLog   string `json:"blobContainerCiLog"`
	BlobContainerCiCache string `json:"blobContainerCiCache"`
	AccountKey           string `json:"accountKey"`
}

type BlueGreen

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

type BulkPatchFilter

type BulkPatchFilter struct {
	AppNameIncludes string `json:"appNameIncludes,omitempty"`
	AppNameExcludes string `json:"appNameExcludes,omitempty"`
	EnvId           int    `json:"envId,omitempty"`
}

type BulkPatchPayload

type BulkPatchPayload struct {
	AppId int `json:"appId"`
	EnvId int `json:"envId"`
}

type BulkPatchRequest

type BulkPatchRequest struct {
	Payload     []*BulkPatchPayload `json:"payload"`
	Filter      *BulkPatchFilter    `json:"filter,omitempty"`
	ProjectId   int                 `json:"projectId"`
	Global      bool                `json:"global"`
	Type        string              `json:"type"`
	Name        string              `json:"name"`
	Key         string              `json:"key"`
	Value       string              `json:"value"`
	PatchAction int                 `json:"patchAction"` // 1=add, 2=update, 0=delete
	UserId      int32               `json:"-"`
}

type BulkTriggerRequest

type BulkTriggerRequest struct {
	CiArtifactId int `sql:"ci_artifact_id"`
	PipelineId   int `sql:"pipeline_id"`
}

type Canary

type Canary struct {
	MaxSurge       string       `json:"maxSurge,omitempty"`
	MaxUnavailable int          `json:"maxUnavailable,omitempty"`
	Steps          []CanaryStep `json:"steps,omitempty"`
}

type CanaryStep

type CanaryStep struct {
	// SetWeight sets what percentage of the newRS should receive
	SetWeight *int32 `json:"setWeight,omitempty"`
	// Pause freezes the rollout by setting spec.Paused to true.
	// A Rollout will resume when spec.Paused is reset to false.
	// +optional
	Pause *RolloutPause `json:"pause,omitempty"`
}

type CdConfig

type CdConfig struct {
	Mode                      string `env:"MODE" envDefault:"DEV"`
	LimitCpu                  string `env:"CD_LIMIT_CI_CPU" envDefault:"0.5"`
	LimitMem                  string `env:"CD_LIMIT_CI_MEM" envDefault:"3G"`
	ReqCpu                    string `env:"CD_REQ_CI_CPU" envDefault:"0.5"`
	ReqMem                    string `env:"CD_REQ_CI_MEM" envDefault:"3G"`
	TaintKey                  string `env:"CD_NODE_TAINTS_KEY" envDefault:"dedicated"`
	WorkflowServiceAccount    string `env:"CD_WORKFLOW_SERVICE_ACCOUNT" envDefault:"cd-runner"`
	DefaultBuildLogsKeyPrefix string `env:"DEFAULT_BUILD_LOGS_KEY_PREFIX" `
	DefaultArtifactKeyPrefix  string `env:"DEFAULT_CD_ARTIFACT_KEY_LOCATION" `
	TaintValue                string `env:"CD_NODE_TAINTS_VALUE" envDefault:"ci"`
	DefaultBuildLogsBucket    string `env:"DEFAULT_BUILD_LOGS_BUCKET" `
	CdArtifactLocationFormat  string `env:"CD_ARTIFACT_LOCATION_FORMAT" `
	DefaultNamespace          string `env:"DEFAULT_CD_NAMESPACE"`
	DefaultImage              string `env:"DEFAULT_CI_IMAGE" `
	DefaultTimeout            int64  `env:"DEFAULT_CD_TIMEOUT" envDefault:"3600"`
	DefaultCdLogsBucketRegion string `env:"DEFAULT_CD_LOGS_BUCKET_REGION" `
	WfControllerInstanceID    string `env:"WF_CONTROLLER_INSTANCE_ID" envDefault:"devtron-runner"`
	OrchestratorHost          string `env:"ORCH_HOST" envDefault:"http://devtroncd-orchestrator-service-prod.devtroncd/webhook/msg/nats"`
	OrchestratorToken         string `env:"ORCH_TOKEN" envDefault:""`
	ClusterConfig             *rest.Config
}

func GetCdConfig

func GetCdConfig() (*CdConfig, error)

type CdHandler

type CdHandler interface {
	UpdateWorkflow(workflowStatus v1alpha1.WorkflowStatus) (int, string, error)
	GetCdBuildHistory(appId int, environmentId int, pipelineId int, offset int, size int) ([]pipelineConfig.CdWorkflowWithArtifact, error)
	GetRunningWorkflowLogs(environmentId int, pipelineId int, workflowId int) (*bufio.Reader, func() error, error)
	FetchCdWorkflowDetails(appId int, environmentId int, pipelineId int, buildId int) (WorkflowResponse, error)
	DownloadCdWorkflowArtifacts(pipelineId int, buildId int) (*os.File, error)
	FetchCdPrePostStageStatus(pipelineId int) ([]pipelineConfig.CdWorkflowWithArtifact, error)
	CancelStage(workflowRunnerId int) (int, error)
	FetchAppWorkflowStatusForTriggerView(pipelineId int) ([]*pipelineConfig.CdWorkflowStatus, error)
}

type CdHandlerImpl

type CdHandlerImpl struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewCdHandlerImpl

func NewCdHandlerImpl(Logger *zap.SugaredLogger, cdConfig *CdConfig, userService user.UserService,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	cdWorkflowService CdWorkflowService,
	ciLogService CiLogService,
	ciArtifactRepository repository.CiArtifactRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	envRepository cluster.EnvironmentRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	ciConfig *CiConfig) *CdHandlerImpl

func (*CdHandlerImpl) CancelStage

func (impl *CdHandlerImpl) CancelStage(workflowRunnerId int) (int, error)

func (*CdHandlerImpl) DownloadCdWorkflowArtifacts

func (impl *CdHandlerImpl) DownloadCdWorkflowArtifacts(pipelineId int, buildId int) (*os.File, error)

func (*CdHandlerImpl) FetchAppWorkflowStatusForTriggerView

func (impl *CdHandlerImpl) FetchAppWorkflowStatusForTriggerView(appId int) ([]*pipelineConfig.CdWorkflowStatus, error)

func (*CdHandlerImpl) FetchCdPrePostStageStatus

func (impl *CdHandlerImpl) FetchCdPrePostStageStatus(pipelineId int) ([]pipelineConfig.CdWorkflowWithArtifact, error)

func (*CdHandlerImpl) FetchCdWorkflowDetails

func (impl *CdHandlerImpl) FetchCdWorkflowDetails(appId int, environmentId int, pipelineId int, buildId int) (WorkflowResponse, error)

func (*CdHandlerImpl) GetCdBuildHistory

func (impl *CdHandlerImpl) GetCdBuildHistory(appId int, environmentId int, pipelineId int, offset int, size int) ([]pipelineConfig.CdWorkflowWithArtifact, error)

func (*CdHandlerImpl) GetRunningWorkflowLogs

func (impl *CdHandlerImpl) GetRunningWorkflowLogs(environmentId int, pipelineId int, wfrId int) (*bufio.Reader, func() error, error)

func (*CdHandlerImpl) UpdateWorkflow

func (impl *CdHandlerImpl) UpdateWorkflow(workflowStatus v1alpha1.WorkflowStatus) (int, string, error)

type CdStageCompleteEvent

type CdStageCompleteEvent struct {
	CiProjectDetails []CiProjectDetails           `json:"ciProjectDetails"`
	WorkflowId       int                          `json:"workflowId"`
	WorkflowRunnerId int                          `json:"workflowRunnerId"`
	CdPipelineId     int                          `json:"cdPipelineId"`
	TriggeredBy      int32                        `json:"triggeredBy"`
	StageYaml        string                       `json:"stageYaml"`
	ArtifactLocation string                       `json:"artifactLocation"`
	PipelineName     string                       `json:"pipelineName"`
	CiArtifactDTO    pipelineConfig.CiArtifactDTO `json:"ciArtifactDTO"`
}

type CdWorkflowRequest

type CdWorkflowRequest struct {
	AppId                     int                `json:"appId"`
	EnvironmentId             int                `json:"envId"`
	WorkflowId                int                `json:"workflowId"`
	WorkflowRunnerId          int                `json:"workflowRunnerId"`
	CdPipelineId              int                `json:"cdPipelineId"`
	TriggeredBy               int32              `json:"triggeredBy"`
	StageYaml                 string             `json:"stageYaml"`
	ArtifactLocation          string             `json:"artifactLocation"`
	CiProjectDetails          []CiProjectDetails `json:"ciProjectDetails"`
	CiArtifactDTO             CiArtifactDTO      `json:"ciArtifactDTO"`
	Namespace                 string             `json:"namespace"`
	WorkflowNamePrefix        string             `json:"workflowNamePrefix"`
	CdImage                   string             `json:"cdImage"`
	ActiveDeadlineSeconds     int64              `json:"activeDeadlineSeconds"`
	StageType                 string             `json:"stageType"`
	DockerUsername            string             `json:"dockerUsername"`
	DockerPassword            string             `json:"dockerPassword"`
	AwsRegion                 string             `json:"awsRegion"`
	SecretKey                 string             `json:"secretKey"`
	AccessKey                 string             `json:"accessKey"`
	DockerRegistryType        string             `json:"dockerRegistryType"`
	DockerRegistryURL         string             `json:"dockerRegistryURL"`
	OrchestratorHost          string             `json:"orchestratorHost"`
	OrchestratorToken         string             `json:"orchestratorToken"`
	IsExtRun                  bool               `json:"isExtRun"`
	ExtraEnvironmentVariables map[string]string  `json:"extraEnvironmentVariables"`
}

type CdWorkflowService

type CdWorkflowService interface {
	SubmitWorkflow(workflowRequest *CdWorkflowRequest, pipeline *pipelineConfig.Pipeline, env *cluster.Environment) (*v1alpha1.Workflow, error)
	DeleteWorkflow(wfName string, namespace string) error
	GetWorkflow(name string, namespace string, url string, token string, isExtRun bool) (*v1alpha1.Workflow, error)
	ListAllWorkflows(namespace string) (*v1alpha1.WorkflowList, error)
	UpdateWorkflow(wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)
	TerminateWorkflow(name string, namespace string, url string, token string, isExtRun bool) error
}

type CdWorkflowServiceImpl

type CdWorkflowServiceImpl struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewCdWorkflowServiceImpl

func NewCdWorkflowServiceImpl(Logger *zap.SugaredLogger, envRepository cluster.EnvironmentRepository, cdConfig *CdConfig, appService app.AppService) *CdWorkflowServiceImpl

func (*CdWorkflowServiceImpl) DeleteWorkflow

func (impl *CdWorkflowServiceImpl) DeleteWorkflow(wfName string, namespace string) error

func (*CdWorkflowServiceImpl) GetWorkflow

func (impl *CdWorkflowServiceImpl) GetWorkflow(name string, namespace string, url string, token string, isExtRun bool) (*v1alpha1.Workflow, error)

func (*CdWorkflowServiceImpl) ListAllWorkflows

func (impl *CdWorkflowServiceImpl) ListAllWorkflows(namespace string) (*v1alpha1.WorkflowList, error)

func (*CdWorkflowServiceImpl) SubmitWorkflow

func (impl *CdWorkflowServiceImpl) SubmitWorkflow(workflowRequest *CdWorkflowRequest, pipeline *pipelineConfig.Pipeline, env *cluster.Environment) (*v1alpha1.Workflow, error)

func (*CdWorkflowServiceImpl) TerminateWorkflow

func (impl *CdWorkflowServiceImpl) TerminateWorkflow(name string, namespace string, url string, token string, isExtRun bool) error

func (*CdWorkflowServiceImpl) UpdateWorkflow

func (impl *CdWorkflowServiceImpl) UpdateWorkflow(wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)

type ChartService

type ChartService interface {
	Create(templateRequest TemplateRequest, ctx context.Context) (chart *TemplateRequest, err error)
	CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (chart *TemplateRequest, err error)
	FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)
	GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]json.RawMessage, error)
	UpdateAppOverride(templateRequest *TemplateRequest) (*TemplateRequest, error)
	IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)
	ChartRefAutocomplete() ([]chartRef, error)
	ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefResponse, error)
	FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]json.RawMessage, userId int32, ctx context.Context) (bool, error)
	AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)
}

type ChartServiceImpl

type ChartServiceImpl struct {
	// contains filtered or unexported fields
}

func NewChartServiceImpl

func NewChartServiceImpl(chartRepository chartConfig.ChartRepository,
	logger *zap.SugaredLogger,
	chartTemplateService util.ChartTemplateService,
	repoRepository chartConfig.ChartRepoRepository,
	pipelineGroupRepository pipelineConfig.AppRepository,
	refChartDir RefChartDir,
	defaultChart DefaultChart,
	mergeUtil util.MergeUtil,
	repositoryService repository.ServiceClient,
	chartRefRepository chartConfig.ChartRefRepository,
	envOverrideRepository chartConfig.EnvConfigOverrideRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository,
	environmentRepository cluster.EnvironmentRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	appLevelMetricsRepository repository3.AppLevelMetricsRepository,
	client *http.Client,
) *ChartServiceImpl

func (ChartServiceImpl) AppMetricsEnableDisable

func (impl ChartServiceImpl) AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)

func (ChartServiceImpl) ChartRefAutocomplete

func (impl ChartServiceImpl) ChartRefAutocomplete() ([]chartRef, error)

func (ChartServiceImpl) ChartRefAutocompleteForAppOrEnv

func (impl ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefResponse, error)

func (ChartServiceImpl) Create

func (impl ChartServiceImpl) Create(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)

func (ChartServiceImpl) CreateChartFromEnvOverride

func (impl ChartServiceImpl) CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)

func (ChartServiceImpl) FindLatestChartForAppByAppId

func (impl ChartServiceImpl) FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)

func (ChartServiceImpl) FindPreviousChartByAppId

func (impl ChartServiceImpl) FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)

func (ChartServiceImpl) GetAppOverrideForDefaultTemplate

func (impl ChartServiceImpl) GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]json.RawMessage, error)

func (ChartServiceImpl) GetByAppIdAndChartRefId

func (impl ChartServiceImpl) GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)

func (ChartServiceImpl) IsReadyToTrigger

func (impl ChartServiceImpl) IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)

func (ChartServiceImpl) UpdateAppOverride

func (impl ChartServiceImpl) UpdateAppOverride(templateRequest *TemplateRequest) (*TemplateRequest, error)

func (ChartServiceImpl) UpgradeForApp

func (impl ChartServiceImpl) UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]json.RawMessage, userId int32, ctx context.Context) (bool, error)

type ChartUpgradeRequest

type ChartUpgradeRequest struct {
	ChartRefId int   `json:"chartRefId"  validate:"number"`
	All        bool  `json:"all"`
	AppIds     []int `json:"appIds"`
	UserId     int32 `json:"-"`
}

type CiArtifactDTO

type CiArtifactDTO struct {
	Id           int    `json:"id"`
	PipelineId   int    `json:"pipelineId"` //id of the ci pipeline from which this webhook was triggered
	Image        string `json:"image"`
	ImageDigest  string `json:"imageDigest"`
	MaterialInfo string `json:"materialInfo"` //git material metadata json array string
	DataSource   string `json:"dataSource"`
	WorkflowId   *int   `json:"workflowId"`
	// contains filtered or unexported fields
}

type CiArtifactWebhookRequest

type CiArtifactWebhookRequest struct {
	Image        string          `json:"image"`
	ImageDigest  string          `json:"imageDigest"`
	MaterialInfo json.RawMessage `json:"materialInfo"`
	DataSource   string          `json:"dataSource"`
	PipelineName string          `json:"pipelineName"`
	WorkflowId   *int            `json:"workflowId"`
	UserId       int32           `json:"userId"`
}

type CiCdTriggerEvent

type CiCdTriggerEvent struct {
	Type      string             `json:"type"`
	CiRequest *WorkflowRequest   `json:"ciRequest"`
	CdRequest *CdWorkflowRequest `json:"cdRequest"`
}

type CiConfig

type CiConfig struct {
	DefaultCacheBucket        string   `env:"DEFAULT_CACHE_BUCKET" envDefault:"ci-caching"`
	DefaultCacheBucketRegion  string   `env:"DEFAULT_CACHE_BUCKET_REGION" envDefault:"us-east-2"`
	CiLogsKeyPrefix           string   `env:"CI_LOGS_KEY_PREFIX" envDefault:"my-artifacts"`
	DefaultImage              string   `env:"DEFAULT_CI_IMAGE" envDefault:"686244538589.dkr.ecr.us-east-2.amazonaws.com/cirunner:47"`
	DefaultNamespace          string   `env:"DEFAULT_NAMESPACE" envDefault:"devtron-ci"`
	DefaultTimeout            int64    `env:"DEFAULT_TIMEOUT" envDefault:"3600"`
	Mode                      string   `env:"MODE" envDefault:"DEV"`
	DefaultBuildLogsBucket    string   `env:"DEFAULT_BUILD_LOGS_BUCKET" envDefault:"devtron-pro-ci-logs"`
	LimitCpu                  string   `env:"LIMIT_CI_CPU" envDefault:"0.5"`
	LimitMem                  string   `env:"LIMIT_CI_MEM" envDefault:"3G"`
	ReqCpu                    string   `env:"REQ_CI_CPU" envDefault:"0.5"`
	ReqMem                    string   `env:"REQ_CI_MEM" envDefault:"3G"`
	TaintKey                  string   `env:"CI_NODE_TAINTS_KEY" envDefault:""`
	TaintValue                string   `env:"CI_NODE_TAINTS_VALUE" envDefault:""`
	NodeLabelSelector         []string `env:"CI_NODE_LABEL_SELECTOR"`
	CacheLimit                int64    `env:"CACHE_LIMIT" envDefault:"5000000000"` // TODO: Add to default db config also
	DefaultBuildLogsKeyPrefix string   `env:"DEFAULT_BUILD_LOGS_KEY_PREFIX" envDefault:"arsenal-v1"`
	DefaultArtifactKeyPrefix  string   `env:"DEFAULT_ARTIFACT_KEY_LOCATION" envDefault:"arsenal-v1/ci-artifacts"`
	WorkflowServiceAccount    string   `env:"WORKFLOW_SERVICE_ACCOUNT" envDefault:"ci-runner"`
	ExternalCiApiSecret       string   `env:"EXTERNAL_CI_API_SECRET" envDefault:"devtroncd-secret"`
	ExternalCiWebhookUrl      string   `env:"EXTERNAL_CI_WEB_HOOK_URL" envDefault:""`
	ExternalCiPayload         string   `` /* 504-byte string literal not displayed */
	CiArtifactLocationFormat  string   `env:"CI_ARTIFACT_LOCATION_FORMAT" envDefault:"%d/%d.zip"`
	ImageScannerEndpoint      string   `env:"IMAGE_SCANNER_ENDPOINT" envDefault:"http://image-scanner-new-demo-devtroncd-service.devtroncd:80"`
	CloudProvider             string   `env:"BLOB_STORAGE_PROVIDER" envDefault:"S3"`
	AzureAccountName          string   `env:"AZURE_ACCOUNT_NAME"`
	AzureBlobContainerCiLog   string   `env:"AZURE_BLOB_CONTAINER_CI_LOG"`
	AzureBlobContainerCiCache string   `env:"AZURE_BLOB_CONTAINER_CI_CACHE"`
	MinioEndpoint             string   `env:"MINIO_ENDPOINT"`
	MinioAccessKey            string   `env:"MINIO_ACCESS_KEY"`
	MinioSecretKey            string   `env:"MINIO_SECRET_KEY"`

	AzureAccountKey string `env:"AZURE_ACCOUNT_KEY"`
	ClusterConfig   *rest.Config
	NodeLabel       map[string]string
}

func GetCiConfig

func GetCiConfig() (*CiConfig, error)

type CiHandler

type CiHandler interface {
	HandleCIWebhook(gitCiTriggerRequest bean.GitCiTriggerRequest) (int, error)
	HandleCIManual(ciTriggerRequest bean.CiTriggerRequest) (int, error)
	HandleGitCiTrigger(ciGitTriggerRequest bean.CiGitWebhookTriggerRequest) error

	FetchMaterialsByPipelineId(pipelineId int) ([]CiPipelineMaterialResponse, error)
	FetchWorkflowDetails(appId int, pipelineId int, buildId int) (WorkflowResponse, error)

	//FetchBuildById(appId int, pipelineId int) (WorkflowResponse, error)
	CancelBuild(workflowId int) (int, error)

	GetRunningWorkflowLogs(pipelineId int, workflowId int) (*bufio.Reader, func() error, error)
	GetHistoricBuildLogs(pipelineId int, workflowId int, ciWorkflow *pipelineConfig.CiWorkflow) (map[string]string, error)

	GetBuildHistory(pipelineId int, offset int, size int) ([]WorkflowResponse, error)
	DownloadCiWorkflowArtifacts(pipelineId int, buildId int) (*os.File, error)
	UpdateWorkflow(workflowStatus v1alpha1.WorkflowStatus) (int, error)

	FetchCiStatusForTriggerView(appId int) ([]*pipelineConfig.CiWorkflowStatus, error)
	RefreshMaterialByCiPipelineMaterialId(gitMaterialId int) (refreshRes *gitSensor.RefreshGitMaterialResponse, err error)
	FetchMaterialInfoByArtifactId(ciArtifactId int) (*GitTriggerInfoResponse, error)
	WriteToCreateTestSuites(pipelineId int, buildId int, triggeredBy int)
}

type CiHandlerImpl

type CiHandlerImpl struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewCiHandlerImpl

func NewCiHandlerImpl(Logger *zap.SugaredLogger, ciService CiService, ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	gitSensorClient gitSensor.GitSensorClient, ciWorkflowRepository pipelineConfig.CiWorkflowRepository, workflowService WorkflowService,
	ciLogService CiLogService, ciConfig *CiConfig, ciArtifactRepository repository.CiArtifactRepository, userService user.UserService, eventClient client.EventClient,
	eventFactory client.EventFactory, ciPipelineRepository pipelineConfig.CiPipelineRepository, appListingRepository repository.AppListingRepository) *CiHandlerImpl

func (*CiHandlerImpl) BuildPayload

func (impl *CiHandlerImpl) BuildPayload(ciWorkflow *pipelineConfig.CiWorkflow) *client.Payload

func (*CiHandlerImpl) CancelBuild

func (impl *CiHandlerImpl) CancelBuild(workflowId int) (int, error)

func (*CiHandlerImpl) DownloadCiWorkflowArtifacts

func (impl *CiHandlerImpl) DownloadCiWorkflowArtifacts(pipelineId int, buildId int) (*os.File, error)

func (*CiHandlerImpl) FetchCiStatusForTriggerView

func (impl *CiHandlerImpl) FetchCiStatusForTriggerView(appId int) ([]*pipelineConfig.CiWorkflowStatus, error)

func (*CiHandlerImpl) FetchMaterialInfoByArtifactId

func (impl *CiHandlerImpl) FetchMaterialInfoByArtifactId(ciArtifactId int) (*GitTriggerInfoResponse, error)

func (*CiHandlerImpl) FetchMaterialsByPipelineId

func (impl *CiHandlerImpl) FetchMaterialsByPipelineId(pipelineId int) ([]CiPipelineMaterialResponse, error)

func (*CiHandlerImpl) FetchWorkflowDetails

func (impl *CiHandlerImpl) FetchWorkflowDetails(appId int, pipelineId int, buildId int) (WorkflowResponse, error)

func (*CiHandlerImpl) GetBuildHistory

func (impl *CiHandlerImpl) GetBuildHistory(pipelineId int, offset int, size int) ([]WorkflowResponse, error)

func (*CiHandlerImpl) GetCiPipeline

func (impl *CiHandlerImpl) GetCiPipeline(ciMaterialId int) (*pipelineConfig.CiPipeline, error)

func (*CiHandlerImpl) GetHistoricBuildLogs

func (impl *CiHandlerImpl) GetHistoricBuildLogs(pipelineId int, workflowId int, ciWorkflow *pipelineConfig.CiWorkflow) (map[string]string, error)

func (*CiHandlerImpl) GetRunningWorkflowLogs

func (impl *CiHandlerImpl) GetRunningWorkflowLogs(pipelineId int, workflowId int) (*bufio.Reader, func() error, error)

func (*CiHandlerImpl) HandleCIManual

func (impl *CiHandlerImpl) HandleCIManual(ciTriggerRequest bean.CiTriggerRequest) (int, error)

func (*CiHandlerImpl) HandleCIWebhook

func (impl *CiHandlerImpl) HandleCIWebhook(gitCiTriggerRequest bean.GitCiTriggerRequest) (int, error)

func (*CiHandlerImpl) HandleGitCiTrigger

func (impl *CiHandlerImpl) HandleGitCiTrigger(ciGitTriggerRequest bean.CiGitWebhookTriggerRequest) error

func (*CiHandlerImpl) RefreshMaterialByCiPipelineMaterialId

func (impl *CiHandlerImpl) RefreshMaterialByCiPipelineMaterialId(gitMaterialId int) (refreshRes *gitSensor.RefreshGitMaterialResponse, err error)

func (*CiHandlerImpl) UpdateWorkflow

func (impl *CiHandlerImpl) UpdateWorkflow(workflowStatus v1alpha1.WorkflowStatus) (int, error)

func (*CiHandlerImpl) WriteCIFailEvent

func (impl *CiHandlerImpl) WriteCIFailEvent(ciWorkflow *pipelineConfig.CiWorkflow, ciImage string)

func (*CiHandlerImpl) WriteToCreateTestSuites

func (impl *CiHandlerImpl) WriteToCreateTestSuites(pipelineId int, buildId int, triggeredBy int)

type CiLogRequest

type CiLogRequest struct {
	PipelineId      int
	WorkflowId      int
	WorkflowName    string
	AccessKey       string
	SecretKet       string
	Region          string
	LogsBucket      string
	LogsFilePath    string
	Namespace       string
	CloudProvider   string
	AzureBlobConfig *AzureBlobConfig
	MinioEndpoint   string
}

type CiLogService

type CiLogService interface {
	FetchRunningWorkflowLogs(ciLogRequest CiLogRequest, token string, host string, isExt bool) (io.ReadCloser, func() error, error)
	FetchLogs(ciLogRequest CiLogRequest) (*os.File, func() error, error)
}

type CiLogServiceImpl

type CiLogServiceImpl struct {
	// contains filtered or unexported fields
}

func NewCiLogServiceImpl

func NewCiLogServiceImpl(logger *zap.SugaredLogger, ciService CiService, ciConfig *CiConfig) *CiLogServiceImpl

func (*CiLogServiceImpl) FetchLogs

func (impl *CiLogServiceImpl) FetchLogs(ciLogRequest CiLogRequest) (*os.File, func() error, error)

func (*CiLogServiceImpl) FetchRunningWorkflowLogs

func (impl *CiLogServiceImpl) FetchRunningWorkflowLogs(ciLogRequest CiLogRequest, token string, host string, isExt bool) (io.ReadCloser, func() error, error)

type CiPipelineMaterialResponse

type CiPipelineMaterialResponse struct {
	Id              int                    `json:"id"`
	GitMaterialId   int                    `json:"gitMaterialId"`
	GitMaterialUrl  string                 `json:"gitMaterialUrl"`
	GitMaterialName string                 `json:"gitMaterialName"`
	Type            string                 `json:"type"`
	Value           string                 `json:"value"`
	Active          bool                   `json:"active"`
	History         []*gitSensor.GitCommit `json:"history,omitempty"`
	LastFetchTime   time.Time              `json:"lastFetchTime"`
	IsRepoError     bool                   `json:"isRepoError"`
	RepoErrorMsg    string                 `json:"repoErrorMsg"`
	IsBranchError   bool                   `json:"isBranchError"`
	BranchErrorMsg  string                 `json:"branchErrorMsg"`
	Url             string                 `json:"url"`
}

type CiProjectDetails

type CiProjectDetails struct {
	GitRepository string    `json:"gitRepository"`
	MaterialName  string    `json:"materialName"`
	CheckoutPath  string    `json:"checkoutPath"`
	CommitHash    string    `json:"commitHash"`
	GitTag        string    `json:"gitTag"`
	CommitTime    time.Time `json:"commitTime"`
	//Branch        string          `json:"branch"`
	Type        string                    `json:"type"`
	Message     string                    `json:"message"`
	Author      string                    `json:"author"`
	GitOptions  GitOptions                `json:"gitOptions"`
	SourceType  pipelineConfig.SourceType `json:"sourceType"`
	SourceValue string                    `json:"sourceValue"`
}

type CiService

type CiService interface {
	TriggerCiPipeline(trigger Trigger) (int, error)
	GetCiMaterials(pipelineId int, ciMaterials []*pipelineConfig.CiPipelineMaterial) ([]*pipelineConfig.CiPipelineMaterial, error)
}

type CiServiceImpl

type CiServiceImpl struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewCiServiceImpl

func NewCiServiceImpl(Logger *zap.SugaredLogger, workflowService WorkflowService, ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository, ciConfig *CiConfig, eventClient client.EventClient, eventFactory client.EventFactory, mergeUtil *util.MergeUtil, ciPipelineRepository pipelineConfig.CiPipelineRepository) *CiServiceImpl

func (*CiServiceImpl) BuildPayload

func (impl *CiServiceImpl) BuildPayload(trigger Trigger, pipeline *pipelineConfig.CiPipeline, workflowRequest *WorkflowRequest) *client.Payload

TODO: Send all trigger data

func (*CiServiceImpl) GetCiMaterials

func (impl *CiServiceImpl) GetCiMaterials(pipelineId int, ciMaterials []*pipelineConfig.CiPipelineMaterial) ([]*pipelineConfig.CiPipelineMaterial, error)

func (*CiServiceImpl) TriggerCiPipeline

func (impl *CiServiceImpl) TriggerCiPipeline(trigger Trigger) (int, error)

func (*CiServiceImpl) WriteCITriggerEvent

func (impl *CiServiceImpl) WriteCITriggerEvent(trigger Trigger, pipeline *pipelineConfig.CiPipeline, workflowRequest *WorkflowRequest)

type ConfigData

type ConfigData struct {
	Name                  string           `json:"name"`
	Type                  string           `json:"type"`
	External              bool             `json:"external"`
	MountPath             string           `json:"mountPath,omitempty"`
	Data                  json.RawMessage  `json:"data"`
	DefaultData           json.RawMessage  `json:"defaultData,omitempty"`
	DefaultMountPath      string           `json:"defaultMountPath,omitempty"`
	Global                bool             `json:"global"`
	ExternalSecretType    string           `json:"externalType"`
	ExternalSecret        []ExternalSecret `json:"secretData"`
	DefaultExternalSecret []ExternalSecret `json:"defaultSecretData,omitempty"`
	RoleARN               string           `json:"roleARN"`
}

type ConfigDataRequest

type ConfigDataRequest struct {
	Id            int           `json:"id"`
	AppId         int           `json:"appId"`
	EnvironmentId int           `json:"environmentId,omitempty"`
	ConfigData    []*ConfigData `json:"configData"`
	UserId        int32         `json:"-"`
}

type ConfigMapRequest

type ConfigMapRequest struct {
	Id            int             `json:"id"`
	AppId         int             `json:"app_id"`
	EnvironmentId int             `json:"environment_id"`
	PipelineId    int             `json:"pipeline_id"`
	ConfigMapData json.RawMessage `json:"config_map_data"`
	SecretData    json.RawMessage `json:"secret_data"`
	UserId        int32           `json:"-"`
}

type ConfigMapSecretsResponse

type ConfigMapSecretsResponse struct {
	Maps    []bean2.Map `json:"maps"`
	Secrets []bean2.Map `json:"secrets"`
}

type ConfigMapService

type ConfigMapService interface {
	CMGlobalAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)
	CMGlobalFetch(appId int) (*ConfigDataRequest, error)
	CMEnvironmentAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)
	CMEnvironmentFetch(appId int, envId int) (*ConfigDataRequest, error)

	CSGlobalAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)
	CSGlobalFetch(appId int) (*ConfigDataRequest, error)
	CSEnvironmentAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)
	CSEnvironmentFetch(appId int, envId int) (*ConfigDataRequest, error)

	CMGlobalDelete(name string, id int, userId int32) (bool, error)
	CMEnvironmentDelete(name string, id int, userId int32) (bool, error)
	CSGlobalDelete(name string, id int, userId int32) (bool, error)
	CSEnvironmentDelete(name string, id int, userId int32) (bool, error)

	CMGlobalDeleteByAppId(name string, appId int, userId int32) (bool, error)
	CMEnvironmentDeleteByAppIdAndEnvId(name string, appId int, envId int, userId int32) (bool, error)
	CSGlobalDeleteByAppId(name string, appId int, userId int32) (bool, error)
	CSEnvironmentDeleteByAppIdAndEnvId(name string, appId int, envId int, userId int32) (bool, error)

	CSGlobalFetchForEdit(name string, id int, userId int32) (*ConfigDataRequest, error)
	CSEnvironmentFetchForEdit(name string, id int, appId int, envId int, userId int32) (*ConfigDataRequest, error)
	ConfigSecretGlobalBulkPatch(bulkPatchRequest *BulkPatchRequest) (*BulkPatchRequest, error)
	ConfigSecretEnvironmentBulkPatch(bulkPatchRequest *BulkPatchRequest) (*BulkPatchRequest, error)
}

type ConfigMapServiceImpl

type ConfigMapServiceImpl struct {
	// contains filtered or unexported fields
}

func NewConfigMapServiceImpl

func NewConfigMapServiceImpl(chartRepository chartConfig.ChartRepository,
	logger *zap.SugaredLogger,
	repoRepository chartConfig.ChartRepoRepository,
	mergeUtil util.MergeUtil,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository, environmentConfigRepository chartConfig.EnvConfigOverrideRepository,
	commonService commonService.CommonService, appRepository pipelineConfig.AppRepository) *ConfigMapServiceImpl

func (ConfigMapServiceImpl) CMEnvironmentAddUpdate

func (impl ConfigMapServiceImpl) CMEnvironmentAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CMEnvironmentDelete

func (impl ConfigMapServiceImpl) CMEnvironmentDelete(name string, id int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CMEnvironmentDeleteByAppIdAndEnvId

func (impl ConfigMapServiceImpl) CMEnvironmentDeleteByAppIdAndEnvId(name string, appId int, envId int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CMEnvironmentFetch

func (impl ConfigMapServiceImpl) CMEnvironmentFetch(appId int, envId int) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CMGlobalAddUpdate

func (impl ConfigMapServiceImpl) CMGlobalAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CMGlobalDelete

func (impl ConfigMapServiceImpl) CMGlobalDelete(name string, id int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CMGlobalDeleteByAppId

func (impl ConfigMapServiceImpl) CMGlobalDeleteByAppId(name string, appId int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CMGlobalFetch

func (impl ConfigMapServiceImpl) CMGlobalFetch(appId int) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSEnvironmentAddUpdate

func (impl ConfigMapServiceImpl) CSEnvironmentAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSEnvironmentDelete

func (impl ConfigMapServiceImpl) CSEnvironmentDelete(name string, id int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CSEnvironmentDeleteByAppIdAndEnvId

func (impl ConfigMapServiceImpl) CSEnvironmentDeleteByAppIdAndEnvId(name string, appId int, envId int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CSEnvironmentFetch

func (impl ConfigMapServiceImpl) CSEnvironmentFetch(appId int, envId int) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSEnvironmentFetchForEdit

func (impl ConfigMapServiceImpl) CSEnvironmentFetchForEdit(name string, id int, appId int, envId int, userId int32) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSGlobalAddUpdate

func (impl ConfigMapServiceImpl) CSGlobalAddUpdate(configMapRequest *ConfigDataRequest) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSGlobalDelete

func (impl ConfigMapServiceImpl) CSGlobalDelete(name string, id int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CSGlobalDeleteByAppId

func (impl ConfigMapServiceImpl) CSGlobalDeleteByAppId(name string, appId int, userId int32) (bool, error)

func (ConfigMapServiceImpl) CSGlobalFetch

func (impl ConfigMapServiceImpl) CSGlobalFetch(appId int) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSGlobalFetchForEdit

func (impl ConfigMapServiceImpl) CSGlobalFetchForEdit(name string, id int, userId int32) (*ConfigDataRequest, error)

func (ConfigMapServiceImpl) ConfigSecretEnvironmentBulkPatch

func (impl ConfigMapServiceImpl) ConfigSecretEnvironmentBulkPatch(bulkPatchRequest *BulkPatchRequest) (*BulkPatchRequest, error)

func (ConfigMapServiceImpl) ConfigSecretGlobalBulkPatch

func (impl ConfigMapServiceImpl) ConfigSecretGlobalBulkPatch(bulkPatchRequest *BulkPatchRequest) (*BulkPatchRequest, error)

type ConfigsList

type ConfigsList struct {
	ConfigData []*ConfigData `json:"maps"`
}

type ContainerResources

type ContainerResources struct {
	MinCpu        string `json:"minCpu"`
	MaxCpu        string `json:"maxCpu"`
	MinStorage    string `json:"minStorage"`
	MaxStorage    string `json:"maxStorage"`
	MinEphStorage string `json:"minEphStorage"`
	MaxEphStorage string `json:"maxEphStorage"`
	MinMem        string `json:"minMem"`
	MaxMem        string `json:"maxMem"`
}

type DbConfigBean

type DbConfigBean struct {
	Id       int    `json:"id,omitempty" validate:"number"`
	Name     string `json:"name,omitempty" validate:"required"` //name by which user identifies this db
	Type     string `json:"type,omitempty" validate:"required"` //type of db, PG, MYsql, MariaDb
	Host     string `json:"host,omitempty" validate:"host"`
	Port     string `json:"port,omitempty" validate:"max=4"`
	DbName   string `json:"dbName,omitempty" validate:"required"` //name of database inside PG
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
	Active   bool   `json:"active,omitempty"`
	UserId   int32  `json:"-"`
}

type DbConfigService

type DbConfigService interface {
	Save(dbConfigBean *DbConfigBean) (dbConfig *DbConfigBean, err error)
	GetAll() (dbConfigs []*DbConfigBean, err error)
	GetById(id int) (dbConfig *DbConfigBean, err error)
	Update(dbConfigBean *DbConfigBean) (dbConfig *DbConfigBean, err error)
	GetForAutocomplete() (dbConfigs []*DbConfigBean, err error)
}

type DbConfigServiceImpl

type DbConfigServiceImpl struct {
	// contains filtered or unexported fields
}

func NewDbConfigService

func NewDbConfigService(configRepo repository.DbConfigRepository,
	logger *zap.SugaredLogger) *DbConfigServiceImpl

func (DbConfigServiceImpl) GetAll

func (impl DbConfigServiceImpl) GetAll() (dbConfigs []*DbConfigBean, err error)

func (DbConfigServiceImpl) GetById

func (impl DbConfigServiceImpl) GetById(id int) (dbConfig *DbConfigBean, err error)

func (DbConfigServiceImpl) GetForAutocomplete

func (impl DbConfigServiceImpl) GetForAutocomplete() (dbConfigs []*DbConfigBean, err error)

func (DbConfigServiceImpl) Save

func (impl DbConfigServiceImpl) Save(dbConfigBean *DbConfigBean) (dbConfig *DbConfigBean, err error)

func (DbConfigServiceImpl) Update

func (impl DbConfigServiceImpl) Update(dbConfigBean *DbConfigBean) (dbConfig *DbConfigBean, err error)

type DbMigrationConfigBean

type DbMigrationConfigBean struct {
	Id            int    `json:"id"`
	DbConfigId    int    `json:"dbConfigId"`
	PipelineId    int    `json:"pipelineId"`
	GitMaterialId int    `json:"gitMaterialId"`
	ScriptSource  string `json:"scriptSource"` //location of file in git. relative to git root
	MigrationTool string `json:"migrationTool"`
	Active        bool   `json:"active"`
	UserId        int32  `json:"-"`
}

type DbMigrationService

type DbMigrationService interface {
	Save(bean *DbMigrationConfigBean) (*DbMigrationConfigBean, error)
	Update(bean *DbMigrationConfigBean) (*DbMigrationConfigBean, error)
	GetByPipelineId(pipelineId int) (*DbMigrationConfigBean, error)
}

type DbMigrationServiceImpl

type DbMigrationServiceImpl struct {
	// contains filtered or unexported fields
}

func NewDbMogrationService

func NewDbMogrationService(logger *zap.SugaredLogger,
	dbMigrationConfigRepository pipelineConfig.DbMigrationConfigRepository) *DbMigrationServiceImpl

func (DbMigrationServiceImpl) GetByPipelineId

func (impl DbMigrationServiceImpl) GetByPipelineId(pipelineId int) (*DbMigrationConfigBean, error)

func (DbMigrationServiceImpl) Save

func (DbMigrationServiceImpl) Update

type DbPipelineOrchestrator

type DbPipelineOrchestrator interface {
	CreateApp(createRequest *bean.CreateAppDTO) (*bean.CreateAppDTO, error)
	DeleteApp(appId int, userId int32) error
	CreateMaterials(createMaterialRequest *bean.CreateMaterialDTO) (*bean.CreateMaterialDTO, error)
	UpdateMaterial(updateMaterialRequest *bean.UpdateMaterialDTO) (*bean.UpdateMaterialDTO, error)
	CreateCiConf(createRequest *bean.CiConfigRequest, templateId int) (*bean.CiConfigRequest, error)
	CreateCDPipelines(pipelineRequest *bean.CDPipelineConfigObject, appId int, userId int32, tx *pg.Tx) (pipelineId int, err error)
	UpdateCDPipeline(pipelineRequest *bean.CDPipelineConfigObject, userId int32, tx *pg.Tx) (err error)
	DeleteCiPipeline(pipeline *pipelineConfig.CiPipeline, userId int32, tx *pg.Tx) error
	DeleteCdPipeline(pipelineId int, tx *pg.Tx) error
	PatchMaterialValue(createRequest *bean.CiPipeline, userId int32) (*bean.CiPipeline, error)
	PipelineExists(name string) (bool, error)
	GetCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err error)
	GetCdPipelinesForAppAndEnv(appId int, envId int) (cdPipelines *bean.CdPipelines, err error)
	GetByEnvOverrideId(envOverrideId int) (*bean.CdPipelines, error)
}

type DbPipelineOrchestratorImpl

type DbPipelineOrchestratorImpl struct {
	CiPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository
	GitSensorClient              gitSensor.GitSensorClient
	// contains filtered or unexported fields
}

func NewDbPipelineOrchestrator

func NewDbPipelineOrchestrator(
	pipelineGroupRepository pipelineConfig.AppRepository,
	logger *zap.SugaredLogger,
	materialRepository pipelineConfig.MaterialRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	CiPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	GitSensorClient gitSensor.GitSensorClient, ciConfig *CiConfig,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	envRepository cluster.EnvironmentRepository,
	attributesService attributes.AttributesService,
) *DbPipelineOrchestratorImpl

func (DbPipelineOrchestratorImpl) CreateApp

func (impl DbPipelineOrchestratorImpl) CreateApp(createRequest *bean.CreateAppDTO) (*bean.CreateAppDTO, error)

func (DbPipelineOrchestratorImpl) CreateCDPipelines

func (impl DbPipelineOrchestratorImpl) CreateCDPipelines(pipelineRequest *bean.CDPipelineConfigObject, appId int, userId int32, tx *pg.Tx) (pipelineId int, err error)

func (DbPipelineOrchestratorImpl) CreateCiConf

func (impl DbPipelineOrchestratorImpl) CreateCiConf(createRequest *bean.CiConfigRequest, templateId int) (*bean.CiConfigRequest, error)

func (DbPipelineOrchestratorImpl) CreateMaterials

func (impl DbPipelineOrchestratorImpl) CreateMaterials(createMaterialRequest *bean.CreateMaterialDTO) (*bean.CreateMaterialDTO, error)

func (DbPipelineOrchestratorImpl) DeleteApp

func (impl DbPipelineOrchestratorImpl) DeleteApp(appId int, userId int32) error

func (DbPipelineOrchestratorImpl) DeleteCdPipeline

func (impl DbPipelineOrchestratorImpl) DeleteCdPipeline(pipelineId int, tx *pg.Tx) error

func (DbPipelineOrchestratorImpl) DeleteCiPipeline

func (impl DbPipelineOrchestratorImpl) DeleteCiPipeline(pipeline *pipelineConfig.CiPipeline, userId int32, tx *pg.Tx) error

func (DbPipelineOrchestratorImpl) GetByEnvOverrideId

func (impl DbPipelineOrchestratorImpl) GetByEnvOverrideId(envOverrideId int) (*bean.CdPipelines, error)

func (DbPipelineOrchestratorImpl) GetCdPipelinesForApp

func (impl DbPipelineOrchestratorImpl) GetCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err error)

func (DbPipelineOrchestratorImpl) GetCdPipelinesForAppAndEnv

func (impl DbPipelineOrchestratorImpl) GetCdPipelinesForAppAndEnv(appId int, envId int) (cdPipelines *bean.CdPipelines, err error)

func (DbPipelineOrchestratorImpl) PatchMaterialValue

func (impl DbPipelineOrchestratorImpl) PatchMaterialValue(createRequest *bean.CiPipeline, userId int32) (*bean.CiPipeline, error)

func (DbPipelineOrchestratorImpl) PipelineExists

func (impl DbPipelineOrchestratorImpl) PipelineExists(name string) (bool, error)

func (DbPipelineOrchestratorImpl) UpdateCDPipeline

func (impl DbPipelineOrchestratorImpl) UpdateCDPipeline(pipelineRequest *bean.CDPipelineConfigObject, userId int32, tx *pg.Tx) (err error)

func (DbPipelineOrchestratorImpl) UpdateMaterial

func (impl DbPipelineOrchestratorImpl) UpdateMaterial(updateMaterialDTO *bean.UpdateMaterialDTO) (*bean.UpdateMaterialDTO, error)

type DefaultChart

type DefaultChart string

type Deployment

type Deployment struct {
	Strategy Strategy `json:"strategy"`
}

type DeploymentGroupAppWithEnv

type DeploymentGroupAppWithEnv struct {
	EnvironmentId     int         `json:"environmentId"`
	DeploymentGroupId int         `json:"deploymentGroupId"`
	AppId             int         `json:"appId"`
	Active            bool        `json:"active"`
	UserId            int32       `json:"userId"`
	RequestType       RequestType `json:"requestType" validate:"oneof=START STOP"`
}

type DeploymentType

type DeploymentType struct {
	Deployment Deployment `json:"deployment"`
}

type DockerArtifactStoreBean

type DockerArtifactStoreBean struct {
	Id                 string                  `json:"id,omitempty" validate:"required"`
	PluginId           string                  `json:"pluginId,omitempty" validate:"required"`
	RegistryURL        string                  `json:"registryUrl,omitempty"`
	RegistryType       repository.RegistryType `json:"registryType,omitempty" validate:"required"`
	AWSAccessKeyId     string                  `json:"awsAccessKeyId,omitempty"`
	AWSSecretAccessKey string                  `json:"awsSecretAccessKey,omitempty"`
	AWSRegion          string                  `json:"awsRegion,omitempty"`
	Username           string                  `json:"username,omitempty"`
	Password           string                  `json:"password,omitempty"`
	IsDefault          bool                    `json:"isDefault"`
	Active             bool                    `json:"active"`
	User               int32                   `json:"-"`
}

type DockerRegistryConfig

type DockerRegistryConfig interface {
	Create(bean *DockerArtifactStoreBean) (*DockerArtifactStoreBean, error)
	ListAllActive() ([]DockerArtifactStoreBean, error)
	FetchAllDockerAccounts() ([]DockerArtifactStoreBean, error)
	FetchOneDockerAccount(storeId string) (*DockerArtifactStoreBean, error)
	Update(bean *DockerArtifactStoreBean) (*DockerArtifactStoreBean, error)
	Delete(storeId string) (string, error)
}

type DockerRegistryConfigImpl

type DockerRegistryConfigImpl struct {
	// contains filtered or unexported fields
}

func NewDockerRegistryConfigImpl

func NewDockerRegistryConfigImpl(dockerArtifactStoreRepository repository.DockerArtifactStoreRepository, logger *zap.SugaredLogger) *DockerRegistryConfigImpl

func (DockerRegistryConfigImpl) Create

func (DockerRegistryConfigImpl) Delete

func (impl DockerRegistryConfigImpl) Delete(storeId string) (string, error)

func (DockerRegistryConfigImpl) FetchAllDockerAccounts

func (impl DockerRegistryConfigImpl) FetchAllDockerAccounts() ([]DockerArtifactStoreBean, error)

* this method used for getting all the docker account details

func (DockerRegistryConfigImpl) FetchOneDockerAccount

func (impl DockerRegistryConfigImpl) FetchOneDockerAccount(storeId string) (*DockerArtifactStoreBean, error)

* this method used for getting all the docker account details

func (DockerRegistryConfigImpl) ListAllActive

func (impl DockerRegistryConfigImpl) ListAllActive() ([]DockerArtifactStoreBean, error)

list all active artifact store

func (DockerRegistryConfigImpl) Update

type EcrConfig

type EcrConfig struct {
	EcrPrefix string `env:"ECR_REPO_NAME_PREFIX" envDefault:"test/"`
}

func GetEcrConfig

func GetEcrConfig() (*EcrConfig, error)

type EnvironmentProperties

type EnvironmentProperties struct {
	Id                int                `json:"id"`
	EnvOverrideValues json.RawMessage    `json:"envOverrideValues"`
	Status            models.ChartStatus `json:"status" validate:"number,required"` //default new, when its ready for deployment CHARTSTATUS_SUCCESS
	ManualReviewed    bool               `json:"manualReviewed" validate:"required"`
	Active            bool               `json:"active" validate:"required"`
	Namespace         string             `json:"namespace" validate:"name-component,required"`
	EnvironmentId     int                `json:"environmentId"`
	EnvironmentName   string             `json:"environmentName"`
	Latest            bool               `json:"latest"`
	UserId            int32              `json:"-"`
	AppMetrics        *bool              `json:"appMetrics"`
	ChartRefId        int                `json:"chartRefId,omitempty"  validate:"number"`
	IsOverride        bool               `sql:"isOverride"`
}

type EnvironmentPropertiesResponse

type EnvironmentPropertiesResponse struct {
	EnvironmentConfig EnvironmentProperties `json:"environmentConfig"`
	GlobalConfig      json.RawMessage       `json:"globalConfig"`
	AppMetrics        *bool                 `json:"appMetrics"`
	IsOverride        bool                  `sql:"is_override"`
	GlobalChartRefId  int                   `json:"globalChartRefId,omitempty"  validate:"number"`
	ChartRefId        int                   `json:"chartRefId,omitempty"  validate:"number"`
	Namespace         string                `json:"namespace" validate:"name-component"`
}

type ExternalSecret

type ExternalSecret struct {
	Key      string `json:"key"`
	Name     string `json:"name"`
	Property string `json:"property,omitempty"`
	IsBinary bool   `json:"isBinary"`
}

type GitOptions

type GitOptions struct {
	UserName    string              `json:"userName"`
	Password    string              `json:"password"`
	SSHKey      string              `json:"sshKey"`
	AccessToken string              `json:"accessToken"`
	AuthMode    repository.AuthMode `json:"authMode"`
}

type GitRegistryConfig

type GitRegistryConfig interface {
	Create(request *GitRegistryRequest) (*GitRegistryRequest, error)
	GetAll() ([]GitRegistryRequest, error)
	FetchAllGitProviders() ([]GitRegistryRequest, error)
	FetchOneGitProvider(id string) (*GitRegistryRequest, error)
	Update(request *GitRegistryRequest) (*GitRegistryRequest, error)
}

type GitRegistryConfigImpl

type GitRegistryConfigImpl struct {
	GitSensorClient gitSensor.GitSensorClient
	// contains filtered or unexported fields
}

func NewGitRegistryConfigImpl

func NewGitRegistryConfigImpl(logger *zap.SugaredLogger, gitProviderRepo repository.GitProviderRepository, GitSensorClient gitSensor.GitSensorClient) *GitRegistryConfigImpl

func (GitRegistryConfigImpl) Create

func (GitRegistryConfigImpl) FetchAllGitProviders

func (impl GitRegistryConfigImpl) FetchAllGitProviders() ([]GitRegistryRequest, error)

func (GitRegistryConfigImpl) FetchOneGitProvider

func (impl GitRegistryConfigImpl) FetchOneGitProvider(providerId string) (*GitRegistryRequest, error)

func (GitRegistryConfigImpl) GetAll

func (impl GitRegistryConfigImpl) GetAll() ([]GitRegistryRequest, error)

get all active git providers

func (GitRegistryConfigImpl) Update

func (GitRegistryConfigImpl) UpdateGitSensor

func (impl GitRegistryConfigImpl) UpdateGitSensor(provider *repository.GitProvider) error

type GitRegistryRequest

type GitRegistryRequest struct {
	Id          int                 `json:"id,omitempty" validate:"number"`
	Name        string              `json:"name,omitempty" validate:"required"`
	Url         string              `json:"url,omitempty"`
	UserName    string              `json:"userName,omitempty"`
	Password    string              `json:"password,omitempty"`
	SshKey      string              `json:"sshKey,omitempty"`
	AccessToken string              `json:"accessToken,omitempty"`
	AuthMode    repository.AuthMode `json:"authMode,omitempty" validate:"required"`
	Active      bool                `json:"active"`
	UserId      int32               `json:"-"`
}

type GitTriggerInfoResponse

type GitTriggerInfoResponse struct {
	CiMaterials      []CiPipelineMaterialResponse `json:"ciMaterials"`
	TriggeredByEmail string                       `json:"triggeredByEmail"`
	LastDeployedTime string                       `json:"lastDeployedTime,omitempty"`
	AppId            int                          `json:"appId"`
	AppName          string                       `json:"appName"`
	EnvironmentId    int                          `json:"environmentId"`
	EnvironmentName  string                       `json:"environmentName"`
	Default          bool                         `json:"default,omitempty"`
}

type IsReady

type IsReady struct {
	Flag    bool   `json:"flag"`
	Message string `json:"message"`
}

type PipelineBuilder

type PipelineBuilder interface {
	CreateCiPipeline(createRequest *bean.CiConfigRequest) (*bean.PipelineCreateResponse, error)
	CreateApp(request *bean.CreateAppDTO) (*bean.CreateAppDTO, error)
	CreateMaterialsForApp(request *bean.CreateMaterialDTO) (*bean.CreateMaterialDTO, error)
	UpdateMaterialsForApp(request *bean.UpdateMaterialDTO) (*bean.UpdateMaterialDTO, error)
	DeleteApp(appId int, userId int32) error
	GetCiPipeline(appId int) (ciConfig *bean.CiConfigRequest, err error)
	UpdateCiTemplate(updateRequest *bean.CiConfigRequest) (*bean.CiConfigRequest, error)
	PatchCiPipeline(request *bean.CiPatchRequest) (ciConfig *bean.CiConfigRequest, err error)
	CreateCdPipelines(cdPipelines *bean.CdPipelines, ctx context.Context) (*bean.CdPipelines, error)
	GetApp(appId int) (application *bean.CreateAppDTO, err error)
	PatchCdPipelines(cdPipelines *bean.CDPatchRequest, ctx context.Context) (*bean.CdPipelines, error)
	GetCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err error)
	GetCdPipelinesForAppAndEnv(appId int, envId int) (cdPipelines *bean.CdPipelines, err error)
	/*	CreateCdPipelines(cdPipelines bean.CdPipelines) (*bean.CdPipelines, error)*/
	GetArtifactsByCDPipeline(cdPipelineId int, stage bean2.CdWorkflowType) (bean.CiArtifactResponse, error)
	FetchArtifactForRollback(cdPipelineId int) (bean.CiArtifactResponse, error)
	FindAppsByTeamId(teamId int) ([]AppBean, error)
	GetAppListByTeamIds(teamIds []int) ([]*TeamAppBean, error)
	FindAppsByTeamName(teamName string) ([]AppBean, error)
	FindPipelineById(cdPipelineId int) (*pipelineConfig.Pipeline, error)
	GetAppList() ([]AppBean, error)
	GetCiPipelineMin(appId int) ([]*bean.CiPipelineMin, error)

	FetchCDPipelineStrategy(appId int) (PipelineStrategiesResponse, error)
	GetCdPipelineById(pipelineId int) (cdPipeline *bean.CDPipelineConfigObject, err error)

	FetchConfigmapSecretsForCdStages(appId, envId, cdPipelineId int) (ConfigMapSecretsResponse, error)
	FindByIds(ids []*int) ([]*AppBean, error)
	GetCiPipelineById(pipelineId int) (ciPipeline *bean.CiPipeline, err error)
}

type PipelineBuilderImpl

type PipelineBuilderImpl struct {
	GitFactory    *util.GitFactory
	ArgoK8sClient argocdServer.ArgoK8sClient
	// contains filtered or unexported fields
}

func NewPipelineBuilderImpl

func NewPipelineBuilderImpl(logger *zap.SugaredLogger,
	dbPipelineOrchestrator DbPipelineOrchestrator,
	dockerArtifactStoreRepository repository.DockerArtifactStoreRepository,
	materialRepo pipelineConfig.MaterialRepository,
	pipelineGroupRepo pipelineConfig.AppRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	propertiesConfigService PropertiesConfigService,
	ciTemplateRepository pipelineConfig.CiTemplateRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	application application.ServiceClient,
	chartRepository chartConfig.ChartRepository,
	ciArtifactRepository repository.CiArtifactRepository,
	ecrConfig *EcrConfig,
	envConfigOverrideRepository chartConfig.EnvConfigOverrideRepository,
	environmentRepository cluster.EnvironmentRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	mergeUtil util.MergeUtil,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	ciConfig *CiConfig,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	appService app.AppService,
	imageScanResultRepository security.ImageScanResultRepository,
	ArgoK8sClient argocdServer.ArgoK8sClient,
	GitFactory *util.GitFactory, attributesService attributes.AttributesService,
) *PipelineBuilderImpl

func (PipelineBuilderImpl) CreateApp

func (impl PipelineBuilderImpl) CreateApp(request *bean.CreateAppDTO) (*bean.CreateAppDTO, error)

func (PipelineBuilderImpl) CreateCdPipelines

func (impl PipelineBuilderImpl) CreateCdPipelines(cdPipelines *bean.CdPipelines, ctx context.Context) (*bean.CdPipelines, error)

func (PipelineBuilderImpl) CreateCiPipeline

func (impl PipelineBuilderImpl) CreateCiPipeline(createRequest *bean.CiConfigRequest) (*bean.PipelineCreateResponse, error)

func (PipelineBuilderImpl) CreateMaterialsForApp

func (impl PipelineBuilderImpl) CreateMaterialsForApp(request *bean.CreateMaterialDTO) (*bean.CreateMaterialDTO, error)

func (PipelineBuilderImpl) DeleteApp

func (impl PipelineBuilderImpl) DeleteApp(appId int, userId int32) error

func (PipelineBuilderImpl) FetchArtifactForRollback

func (impl PipelineBuilderImpl) FetchArtifactForRollback(cdPipelineId int) (bean.CiArtifactResponse, error)

func (PipelineBuilderImpl) FetchCDPipelineStrategy

func (impl PipelineBuilderImpl) FetchCDPipelineStrategy(appId int) (PipelineStrategiesResponse, error)

func (PipelineBuilderImpl) FetchConfigmapSecretsForCdStages

func (impl PipelineBuilderImpl) FetchConfigmapSecretsForCdStages(appId, envId, cdPipelineId int) (ConfigMapSecretsResponse, error)

func (PipelineBuilderImpl) FindAppsByTeamId

func (impl PipelineBuilderImpl) FindAppsByTeamId(teamId int) ([]AppBean, error)

func (PipelineBuilderImpl) FindAppsByTeamName

func (impl PipelineBuilderImpl) FindAppsByTeamName(teamName string) ([]AppBean, error)

func (PipelineBuilderImpl) FindByIds

func (impl PipelineBuilderImpl) FindByIds(ids []*int) ([]*AppBean, error)

func (PipelineBuilderImpl) FindPipelineById

func (impl PipelineBuilderImpl) FindPipelineById(cdPipelineId int) (*pipelineConfig.Pipeline, error)

func (PipelineBuilderImpl) GetApp

func (impl PipelineBuilderImpl) GetApp(appId int) (application *bean.CreateAppDTO, err error)

func (PipelineBuilderImpl) GetAppList

func (impl PipelineBuilderImpl) GetAppList() ([]AppBean, error)

func (PipelineBuilderImpl) GetAppListByTeamIds

func (impl PipelineBuilderImpl) GetAppListByTeamIds(teamIds []int) ([]*TeamAppBean, error)

func (PipelineBuilderImpl) GetArtifactsByCDPipeline

func (impl PipelineBuilderImpl) GetArtifactsByCDPipeline(cdPipelineId int, stage bean2.CdWorkflowType) (bean.CiArtifactResponse, error)

func (PipelineBuilderImpl) GetCdPipelineById

func (impl PipelineBuilderImpl) GetCdPipelineById(pipelineId int) (cdPipeline *bean.CDPipelineConfigObject, err error)

func (PipelineBuilderImpl) GetCdPipelinesForApp

func (impl PipelineBuilderImpl) GetCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err error)

func (PipelineBuilderImpl) GetCdPipelinesForAppAndEnv

func (impl PipelineBuilderImpl) GetCdPipelinesForAppAndEnv(appId int, envId int) (cdPipelines *bean.CdPipelines, err error)

func (PipelineBuilderImpl) GetCiPipeline

func (impl PipelineBuilderImpl) GetCiPipeline(appId int) (ciConfig *bean.CiConfigRequest, err error)

func (PipelineBuilderImpl) GetCiPipelineById

func (impl PipelineBuilderImpl) GetCiPipelineById(pipelineId int) (ciPipeline *bean.CiPipeline, err error)

func (PipelineBuilderImpl) GetCiPipelineMin

func (impl PipelineBuilderImpl) GetCiPipelineMin(appId int) ([]*bean.CiPipelineMin, error)

func (PipelineBuilderImpl) PatchCdPipelines

func (impl PipelineBuilderImpl) PatchCdPipelines(cdPipelines *bean.CDPatchRequest, ctx context.Context) (*bean.CdPipelines, error)

func (PipelineBuilderImpl) PatchCiPipeline

func (impl PipelineBuilderImpl) PatchCiPipeline(request *bean.CiPatchRequest) (ciConfig *bean.CiConfigRequest, err error)

func (PipelineBuilderImpl) UpdateCiTemplate

func (impl PipelineBuilderImpl) UpdateCiTemplate(updateRequest *bean.CiConfigRequest) (*bean.CiConfigRequest, error)

func (PipelineBuilderImpl) UpdateMaterialsForApp

func (impl PipelineBuilderImpl) UpdateMaterialsForApp(request *bean.UpdateMaterialDTO) (*bean.UpdateMaterialDTO, error)

type PipelineConfigRequest

type PipelineConfigRequest struct {
	Id                   int             `json:"id"  validate:"number"`
	AppId                int             `json:"appId,omitempty"  validate:"number,required"`
	EnvConfigOverrideId  int             `json:"envConfigOverrideId,omitempty"`
	PipelineConfigValues json.RawMessage `json:"pipelineConfigValues,omitempty" validate:"required"` //json format user value
	PipelineId           int             `json:"PipelineId,omitempty"`
	Latest               bool            `json:"latest"`
	Previous             bool            `json:"previous"`
	EnvId                int             `json:"envId,omitempty"`
	ManualReviewed       bool            `json:"manualReviewed" validate:"required"`
	UserId               int32           `json:"-"`
}

type PipelineConfigRequestResponse

type PipelineConfigRequestResponse struct {
	LatestPipelineConfigRequest   PipelineConfigRequest `json:"latestPipelineConfigRequest"`
	PreviousPipelineConfigRequest PipelineConfigRequest `json:"previousPipelineConfigRequest"`
}

type PipelineStrategiesResponse

type PipelineStrategiesResponse struct {
	PipelineStrategy []PipelineStrategy `json:"pipelineStrategy"`
}

type PipelineStrategy

type PipelineStrategy struct {
	DeploymentTemplate pipelineConfig.DeploymentTemplate `json:"deploymentTemplate,omitempty" validate:"oneof=BLUE-GREEN ROLLING"` //
	Config             json.RawMessage                   `json:"config"`
	Default            bool                              `json:"default"`
}

type PropertiesConfigService

type PropertiesConfigService interface {
	CreateEnvironmentProperties(appId int, propertiesRequest *EnvironmentProperties) (*EnvironmentProperties, error)
	UpdateEnvironmentProperties(appId int, propertiesRequest *EnvironmentProperties, userId int32) (*EnvironmentProperties, error)
	//create environment entry for each new environment
	CreateIfRequired(chart *chartConfig.Chart, environmentId int, userId int32, manualReviewed bool, chartStatus models.ChartStatus, isOverride bool, namespace string) (*chartConfig.EnvConfigOverride, error)
	GetEnvironmentProperties(appId, environmentId int, chartRefId int) (environmentPropertiesResponse *EnvironmentPropertiesResponse, err error)
	GetEnvironmentPropertiesById(environmentId int) ([]EnvironmentProperties, error)

	GetAppIdByChartEnvId(chartEnvId int) (*chartConfig.EnvConfigOverride, error)
	GetLatestEnvironmentProperties(appId, environmentId int) (*EnvironmentProperties, error)
	ResetEnvironmentProperties(id int) (bool, error)
	CreateEnvironmentPropertiesWithNamespace(appId int, propertiesRequest *EnvironmentProperties) (*EnvironmentProperties, error)

	EnvMetricsEnableDisable(appMetricRequest *AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)
}

type PropertiesConfigServiceImpl

type PropertiesConfigServiceImpl struct {
	// contains filtered or unexported fields
}

func NewPropertiesConfigServiceImpl

func NewPropertiesConfigServiceImpl(logger *zap.SugaredLogger,
	envConfigRepo chartConfig.EnvConfigOverrideRepository,
	chartRepo chartConfig.ChartRepository,
	mergeUtil util.MergeUtil,
	environmentRepository cluster.EnvironmentRepository,
	dbPipelineOrchestrator DbPipelineOrchestrator,
	application application.ServiceClient,
	envLevelAppMetricsRepository repository.EnvLevelAppMetricsRepository,
	appLevelMetricsRepository repository.AppLevelMetricsRepository,
) *PropertiesConfigServiceImpl

func (PropertiesConfigServiceImpl) CreateEnvironmentProperties

func (impl PropertiesConfigServiceImpl) CreateEnvironmentProperties(appId int, environmentProperties *EnvironmentProperties) (*EnvironmentProperties, error)

func (PropertiesConfigServiceImpl) CreateEnvironmentPropertiesWithNamespace

func (impl PropertiesConfigServiceImpl) CreateEnvironmentPropertiesWithNamespace(appId int, environmentProperties *EnvironmentProperties) (*EnvironmentProperties, error)

func (PropertiesConfigServiceImpl) CreateIfRequired

func (impl PropertiesConfigServiceImpl) CreateIfRequired(chart *chartConfig.Chart, environmentId int, userId int32, manualReviewed bool, chartStatus models.ChartStatus, isOverride bool, namespace string) (*chartConfig.EnvConfigOverride, error)

func (PropertiesConfigServiceImpl) EnvMetricsEnableDisable

func (impl PropertiesConfigServiceImpl) EnvMetricsEnableDisable(appMetricRequest *AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)

func (PropertiesConfigServiceImpl) GetAppIdByChartEnvId

func (impl PropertiesConfigServiceImpl) GetAppIdByChartEnvId(chartEnvId int) (*chartConfig.EnvConfigOverride, error)

func (PropertiesConfigServiceImpl) GetEnvironmentProperties

func (impl PropertiesConfigServiceImpl) GetEnvironmentProperties(appId, environmentId int, chartRefId int) (environmentPropertiesResponse *EnvironmentPropertiesResponse, err error)

func (PropertiesConfigServiceImpl) GetEnvironmentPropertiesById

func (impl PropertiesConfigServiceImpl) GetEnvironmentPropertiesById(envId int) ([]EnvironmentProperties, error)

func (PropertiesConfigServiceImpl) GetLatestEnvironmentProperties

func (impl PropertiesConfigServiceImpl) GetLatestEnvironmentProperties(appId, environmentId int) (environmentProperties *EnvironmentProperties, err error)

func (PropertiesConfigServiceImpl) ResetEnvironmentProperties

func (impl PropertiesConfigServiceImpl) ResetEnvironmentProperties(id int) (bool, error)

func (PropertiesConfigServiceImpl) UpdateEnvironmentProperties

func (impl PropertiesConfigServiceImpl) UpdateEnvironmentProperties(appId int, propertiesRequest *EnvironmentProperties, userId int32) (*EnvironmentProperties, error)

type Recreate

type Recreate struct {
}

type RefChartDir

type RefChartDir string

type RequestType

type RequestType string
const START RequestType = "START"
const STOP RequestType = "STOP"

type Rolling

type Rolling struct {
	MaxSurge       string `json:"maxSurge"`
	MaxUnavailable int    `json:"maxUnavailable"`
}

type RolloutPause

type RolloutPause struct {
	// Duration the amount of time to wait before moving to the next step.
	// +optional
	Duration *int32 `json:"duration,omitempty"`
}

type SecretsList

type SecretsList struct {
	ConfigData []*ConfigData `json:"secrets"`
}

type StopAppRequest

type StopAppRequest struct {
	AppId         int         `json:"appId" validate:"required"`
	EnvironmentId int         `json:"environmentId" validate:"required"`
	UserId        int32       `json:"userId"`
	RequestType   RequestType `json:"requestType" validate:"oneof=START STOP"`
}

type StopDeploymentGroupRequest

type StopDeploymentGroupRequest struct {
	DeploymentGroupId int         `json:"deploymentGroupId" validate:"required"`
	UserId            int32       `json:"userId"`
	RequestType       RequestType `json:"requestType" validate:"oneof=START STOP"`
}

type Strategy

type Strategy struct {
	BlueGreen *BlueGreen `json:"blueGreen,omitempty"`
	Rolling   *Rolling   `json:"rolling,omitempty"`
	Canary    *Canary    `json:"canary,omitempty"`
	Recreate  *Recreate  `json:"recreate,omitempty"`
}

type TeamAppBean

type TeamAppBean struct {
	ProjectId   int        `json:"projectId"`
	ProjectName string     `json:"projectName"`
	AppList     []*AppBean `json:"appList"`
}

type TemplateRequest

type TemplateRequest struct {
	Id                      int             `json:"id"  validate:"number"`
	AppId                   int             `json:"appId,omitempty"  validate:"number,required"`
	RefChartTemplate        string          `json:"refChartTemplate,omitempty"`
	RefChartTemplateVersion string          `json:"refChartTemplateVersion,omitempty"`
	ChartRepositoryId       int             `json:"chartRepositoryId,omitempty"`
	ValuesOverride          json.RawMessage `json:"valuesOverride,omitempty" validate:"required"` //json format user value
	DefaultAppOverride      json.RawMessage `json:"defaultAppOverride,omitempty"`                 //override values available
	ChartRefId              int             `json:"chartRefId,omitempty"  validate:"number"`
	Latest                  bool            `json:"latest"`
	IsAppMetricsEnabled     bool            `json:"isAppMetricsEnabled"`
	UserId                  int32           `json:"-"`
}

type Trigger

type Trigger struct {
	PipelineId      int
	CommitHashes    map[int]bean.GitCommit
	CiMaterials     []*pipelineConfig.CiPipelineMaterial
	TriggeredBy     int32
	InvalidateCache bool
}

type WebhookService

type WebhookService interface {
	AuthenticateExternalCiWebhook(apiKey string) (int, error)
	SaveCiArtifactWebhook(ciPipelineId int, request *CiArtifactWebhookRequest) (id int, err error)
}

type WebhookServiceImpl

type WebhookServiceImpl struct {
	// contains filtered or unexported fields
}

func NewWebhookServiceImpl

func NewWebhookServiceImpl(
	ciArtifactRepository repository.CiArtifactRepository,
	logger *zap.SugaredLogger,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	appService app.AppService, eventClient client.EventClient,
	eventFactory client.EventFactory,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	workflowDagExecutor WorkflowDagExecutor, ciHandler CiHandler) *WebhookServiceImpl

func (WebhookServiceImpl) AuthenticateExternalCiWebhook

func (impl WebhookServiceImpl) AuthenticateExternalCiWebhook(apiKey string) (int, error)

func (*WebhookServiceImpl) BuildPayload

func (impl *WebhookServiceImpl) BuildPayload(request *CiArtifactWebhookRequest, pipeline *pipelineConfig.CiPipeline) *client.Payload

func (WebhookServiceImpl) SaveCiArtifactWebhook

func (impl WebhookServiceImpl) SaveCiArtifactWebhook(ciPipelineId int, request *CiArtifactWebhookRequest) (id int, err error)

func (*WebhookServiceImpl) WriteCISuccessEvent

func (impl *WebhookServiceImpl) WriteCISuccessEvent(request *CiArtifactWebhookRequest, pipeline *pipelineConfig.CiPipeline, artifact *repository.CiArtifact)

type WorkflowDagExecutor

type WorkflowDagExecutor interface {
	HandleCiSuccessEvent(artifact *repository.CiArtifact, applyAuth bool, async bool, triggeredBy int32) error
	HandlePreStageSuccessEvent(cdStageCompleteEvent CdStageCompleteEvent) error
	HandleDeploymentSuccessEvent(gitHash string) error
	Subscribe() error
	TriggerPostStage(cdWf *pipelineConfig.CdWorkflow, cdPipeline *pipelineConfig.Pipeline, triggeredBy int32) error
	TriggerDeployment(cdWf *pipelineConfig.CdWorkflow, artifact *repository.CiArtifact, pipeline *pipelineConfig.Pipeline, applyAuth bool, async bool, triggeredBy int32) error
	ManualCdTrigger(overrideRequest *bean.ValuesOverrideRequest, ctx context.Context) (int, error)
	TriggerBulkDeploymentAsync(requests []*BulkTriggerRequest, UserId int32) (interface{}, error)
	StopStartApp(stopRequest *StopAppRequest, ctx context.Context) (int, error)
	TriggerBulkHibernateAsync(request StopDeploymentGroupRequest, ctx context.Context) (interface{}, error)
}

type WorkflowDagExecutorImpl

type WorkflowDagExecutorImpl struct {
	// contains filtered or unexported fields
}

func NewWorkflowDagExecutorImpl

func NewWorkflowDagExecutorImpl(Logger *zap.SugaredLogger, pipelineRepository pipelineConfig.PipelineRepository,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	pubsubClient *pubsub.PubSubClient,
	appService app.AppService,
	cdWorkflowService CdWorkflowService,
	cdConfig *CdConfig,
	ciArtifactRepository repository.CiArtifactRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	materialRepository pipelineConfig.MaterialRepository,
	pipelineOverrideRepository chartConfig.PipelineOverrideRepository,
	user user.UserService,
	groupRepository repository.DeploymentGroupRepository,
	envRepository cluster.EnvironmentRepository,
	enforcer rbac.Enforcer, enforcerUtil rbac.EnforcerUtil, tokenCache *user.TokenCache,
	acdAuthConfig *user.ACDAuthConfig, eventFactory client.EventFactory,
	eventClient client.EventClient, cvePolicyRepository security.CvePolicyRepository,
	scanResultRepository security.ImageScanResultRepository) *WorkflowDagExecutorImpl

func (*WorkflowDagExecutorImpl) HandleCiSuccessEvent

func (impl *WorkflowDagExecutorImpl) HandleCiSuccessEvent(artifact *repository.CiArtifact, applyAuth bool, async bool, triggeredBy int32) error

func (*WorkflowDagExecutorImpl) HandleDeploymentSuccessEvent

func (impl *WorkflowDagExecutorImpl) HandleDeploymentSuccessEvent(gitHash string) error

func (*WorkflowDagExecutorImpl) HandlePreStageSuccessEvent

func (impl *WorkflowDagExecutorImpl) HandlePreStageSuccessEvent(cdStageCompleteEvent CdStageCompleteEvent) error

func (*WorkflowDagExecutorImpl) ManualCdTrigger

func (impl *WorkflowDagExecutorImpl) ManualCdTrigger(overrideRequest *bean.ValuesOverrideRequest, ctx context.Context) (int, error)

func (*WorkflowDagExecutorImpl) StopStartApp

func (impl *WorkflowDagExecutorImpl) StopStartApp(stopRequest *StopAppRequest, ctx context.Context) (int, error)

func (*WorkflowDagExecutorImpl) Subscribe

func (impl *WorkflowDagExecutorImpl) Subscribe() error

func (*WorkflowDagExecutorImpl) TriggerBulkDeploymentAsync

func (impl *WorkflowDagExecutorImpl) TriggerBulkDeploymentAsync(requests []*BulkTriggerRequest, UserId int32) (interface{}, error)

func (*WorkflowDagExecutorImpl) TriggerBulkHibernateAsync

func (impl *WorkflowDagExecutorImpl) TriggerBulkHibernateAsync(request StopDeploymentGroupRequest, ctx context.Context) (interface{}, error)

func (*WorkflowDagExecutorImpl) TriggerDeployment

func (impl *WorkflowDagExecutorImpl) TriggerDeployment(cdWf *pipelineConfig.CdWorkflow, artifact *repository.CiArtifact, pipeline *pipelineConfig.Pipeline, applyAuth bool, async bool, triggeredBy int32) error

Only used for auto trigger

func (*WorkflowDagExecutorImpl) TriggerPostStage

func (impl *WorkflowDagExecutorImpl) TriggerPostStage(cdWf *pipelineConfig.CdWorkflow, cpipeline *pipelineConfig.Pipeline, triggeredBy int32) error

func (*WorkflowDagExecutorImpl) TriggerPreStage

func (impl *WorkflowDagExecutorImpl) TriggerPreStage(cdWf *pipelineConfig.CdWorkflow, artifact *repository.CiArtifact, pipeline *pipelineConfig.Pipeline, triggeredBy int32, applyAuth bool) error

type WorkflowRequest

type WorkflowRequest struct {
	WorkflowNamePrefix       string             `json:"workflowNamePrefix"`
	PipelineName             string             `json:"pipelineName"`
	PipelineId               int                `json:"pipelineId"`
	DockerImageTag           string             `json:"dockerImageTag"`
	DockerRegistryType       string             `json:"dockerRegistryType"`
	DockerRegistryURL        string             `json:"dockerRegistryURL"`
	DockerBuildArgs          string             `json:"dockerBuildArgs"`
	DockerRepository         string             `json:"dockerRepository"`
	DockerFileLocation       string             `json:"dockerfileLocation"`
	DockerUsername           string             `json:"dockerUsername"`
	DockerPassword           string             `json:"dockerPassword"`
	AwsRegion                string             `json:"awsRegion"`
	AccessKey                string             `json:"accessKey"`
	SecretKey                string             `json:"secretKey"`
	CiCacheLocation          string             `json:"ciCacheLocation"`
	CiCacheRegion            string             `json:"ciCacheRegion"`
	CiCacheFileName          string             `json:"ciCacheFileName"`
	CiProjectDetails         []CiProjectDetails `json:"ciProjectDetails"`
	ContainerResources       ContainerResources `json:"containerResources"`
	ActiveDeadlineSeconds    int64              `json:"activeDeadlineSeconds"`
	CiImage                  string             `json:"ciImage"`
	Namespace                string             `json:"namespace"`
	WorkflowId               int                `json:"workflowId"`
	TriggeredBy              int32              `json:"triggeredBy"`
	CacheLimit               int64              `json:"cacheLimit"`
	BeforeDockerBuildScripts []*bean.CiScript   `json:"beforeDockerBuildScripts"`
	AfterDockerBuildScripts  []*bean.CiScript   `json:"afterDockerBuildScripts"`
	CiArtifactLocation       string             `json:"ciArtifactLocation"`
	InvalidateCache          bool               `json:"invalidateCache"`
	ScanEnabled              bool               `json:"scanEnabled"`
	CloudProvider            string             `json:"cloudProvider"`
	AzureBlobConfig          *AzureBlobConfig   `json:"azureBlobConfig"`
	MinioEndpoint            string             `json:"minioEndpoint"`
}

type WorkflowResponse

type WorkflowResponse struct {
	Id               int                              `json:"id"`
	Name             string                           `json:"name"`
	Status           string                           `json:"status"`
	PodStatus        string                           `json:"podStatus"`
	Message          string                           `json:"message"`
	StartedOn        time.Time                        `json:"startedOn"`
	FinishedOn       time.Time                        `json:"finishedOn"`
	CiPipelineId     int                              `json:"ciPipelineId"`
	Namespace        string                           `json:"namespace"`
	LogLocation      string                           `json:"logLocation"`
	GitTriggers      map[int]pipelineConfig.GitCommit `json:"gitTriggers"`
	CiMaterials      []CiPipelineMaterialResponse     `json:"ciMaterials"`
	TriggeredBy      int32                            `json:"triggeredBy"`
	Artifact         string                           `json:"artifact"`
	TriggeredByEmail string                           `json:"triggeredByEmail"`
	Stage            string                           `json:"stage"`
	ArtifactId       int                              `json:"artifactId"`
}

type WorkflowService

type WorkflowService interface {
	SubmitWorkflow(workflowRequest *WorkflowRequest) (*v1alpha1.Workflow, error)
	DeleteWorkflow(wfName string, namespace string) error
	GetWorkflow(name string, namespace string) (*v1alpha1.Workflow, error)
	ListAllWorkflows(namespace string) (*v1alpha1.WorkflowList, error)
	UpdateWorkflow(wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)
	TerminateWorkflow(name string, namespace string) error
}

type WorkflowServiceImpl

type WorkflowServiceImpl struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewWorkflowServiceImpl

func NewWorkflowServiceImpl(Logger *zap.SugaredLogger, ciConfig *CiConfig) *WorkflowServiceImpl

func (*WorkflowServiceImpl) DeleteWorkflow

func (impl *WorkflowServiceImpl) DeleteWorkflow(wfName string, namespace string) error

func (*WorkflowServiceImpl) GetWorkflow

func (impl *WorkflowServiceImpl) GetWorkflow(name string, namespace string) (*v1alpha1.Workflow, error)

func (*WorkflowServiceImpl) ListAllWorkflows

func (impl *WorkflowServiceImpl) ListAllWorkflows(namespace string) (*v1alpha1.WorkflowList, error)

func (*WorkflowServiceImpl) SubmitWorkflow

func (impl *WorkflowServiceImpl) SubmitWorkflow(workflowRequest *WorkflowRequest) (*v1alpha1.Workflow, error)

func (*WorkflowServiceImpl) TerminateWorkflow

func (impl *WorkflowServiceImpl) TerminateWorkflow(name string, namespace string) error

func (*WorkflowServiceImpl) UpdateWorkflow

func (impl *WorkflowServiceImpl) UpdateWorkflow(wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)

type WorkflowStatus

type WorkflowStatus struct {
	WorkflowName, Status, PodStatus, Message, LogLocation string
}

Jump to

Keyboard shortcuts

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