pipeline

package
v0.6.18-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 94 Imported by: 30

Documentation

Index

Constants

View Source
const (
	STEP_NAME_REGEX     = "create-env-%s-gb-%d"
	TEMPLATE_NAME_REGEX = "%s-gb-%d"
	WORKFLOW_MINIO_CRED = "workflow-minio-cred"
	CRED_ACCESS_KEY     = "accessKey"
	CRED_SECRET_KEY     = "secretKey"
)
View Source
const (
	DEVTRON_APP_HELM_PIPELINE_STATUS_UPDATE_CRON = "DTAppHelmPipelineStatusUpdateCron"
	DEVTRON_APP_ARGO_PIPELINE_STATUS_UPDATE_CRON = "DTAppArgoPipelineStatusUpdateCron"
	HELM_APP_ARGO_PIPELINE_STATUS_UPDATE_CRON    = "HelmAppArgoPipelineStatusUpdateCron"
)
View Source
const (
	CD_WORKFLOW_NAME        = "cd"
	CD_WORKFLOW_WITH_STAGES = "cd-stages-with-env"
)
View Source
const (
	KubernetesSecret  string = "KubernetesSecret"
	AWSSecretsManager string = "AWSSecretsManager"
	AWSSystemManager  string = "AWSSystemManager"
	HashiCorpVault    string = "HashiCorpVault"
)
View Source
const (
	CD_PIPELINE_ENV_NAME_KEY     = "CD_PIPELINE_ENV_NAME"
	CD_PIPELINE_CLUSTER_NAME_KEY = "CD_PIPELINE_CLUSTER_NAME"
	GIT_COMMIT_HASH_PREFIX       = "GIT_COMMIT_HASH"
	GIT_SOURCE_TYPE_PREFIX       = "GIT_SOURCE_TYPE"
	GIT_SOURCE_VALUE_PREFIX      = "GIT_SOURCE_VALUE"
	GIT_SOURCE_COUNT             = "GIT_SOURCE_COUNT"
	APP_LABEL_KEY_PREFIX         = "APP_LABEL_KEY"
	APP_LABEL_VALUE_PREFIX       = "APP_LABEL_VALUE"
	APP_LABEL_COUNT              = "APP_LABEL_COUNT"
	CHILD_CD_ENV_NAME_PREFIX     = "CHILD_CD_ENV_NAME"
	CHILD_CD_CLUSTER_NAME_PREFIX = "CHILD_CD_CLUSTER_NAME"
	CHILD_CD_COUNT               = "CHILD_CD_COUNT"
)
View Source
const (
	BLOB_STORAGE_AZURE             = "AZURE"
	BLOB_STORAGE_S3                = "S3"
	BLOB_STORAGE_GCP               = "GCP"
	BLOB_STORAGE_MINIO             = "MINIO"
	CI_WORKFLOW_NAME               = "ci"
	CI_WORKFLOW_WITH_STAGES        = "ci-stages-with-env"
	CI_NODE_SELECTOR_APP_LABEL_KEY = "devtron.ai/node-selector"
	CI_NODE_PVC_ALL_ENV            = "devtron.ai/ci-pvc-all"
	CI_NODE_PVC_PIPELINE_PREFIX    = "devtron.ai/ci-pvc"
)
View Source
const AFTER_DOCKER_BUILD string = "AFTER_DOCKER_BUILD"
View Source
const BEFORE_DOCKER_BUILD string = "BEFORE_DOCKER_BUILD"
View Source
const CiStageFailErrorCode = 2
View Source
const DefaultCiWorkflowNamespace = "devtron-ci"
View Source
const DevMode = "DEV"
View Source
const ExternalCiWebhookPath = "orchestrator/webhook/ext-ci"
View Source
const NotDeployed = "Not Deployed"
View Source
const NotTriggered string = "Not Triggered"
View Source
const POST = "POST"
View Source
const PRE = "PRE"
View Source
const ProdMode = "PROD"
View Source
const Running = "Running"
View Source
const Starting = "Starting"
View Source
const WorkflowCancel = "CANCELLED"
View Source
const WorklowTypeDeploy = "DEPLOY"
View Source
const WorklowTypePost = "POST"
View Source
const WorklowTypePre = "PRE"

Variables

View Source
var ArgoWorkflowOwnerRef = v1.OwnerReference{APIVersion: "argoproj.io/v1alpha1", Kind: "Workflow", Name: "{{workflow.name}}", UID: "{{workflow.uid}}", BlockOwnerDeletion: &[]bool{true}[0]}
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

func AddTemplatesForGlobalSecretsInWorkflowTemplate added in v0.6.17

func AddTemplatesForGlobalSecretsInWorkflowTemplate(globalCmCsConfigs []*bean.GlobalCMCSDto, steps *[]v1alpha1.ParallelSteps, volumes *[]v12.Volume, templates *[]v1alpha1.Template) error

func ExtractVolumesFromCmCs added in v0.6.17

func ExtractVolumesFromCmCs(configMaps []bean2.ConfigSecretMap, secrets []bean2.ConfigSecretMap) []v12.Volume

func GetConfigMapBody added in v0.6.17

func GetConfigMapBody(configMapSecretDto ConfigMapSecretDto) v12.ConfigMap

func GetConfigMapJson added in v0.6.17

func GetConfigMapJson(configMapSecretDto ConfigMapSecretDto) (string, error)

func GetFromGlobalCmCsDtos added in v0.6.17

func GetFromGlobalCmCsDtos(globalCmCsConfigs []*bean.GlobalCMCSDto) ([]bean2.ConfigSecretMap, []bean2.ConfigSecretMap, error)

func GetSecretBody added in v0.6.17

func GetSecretBody(configMapSecretDto ConfigMapSecretDto) v12.Secret

func GetSecretJson added in v0.6.17

func GetSecretJson(configMapSecretDto ConfigMapSecretDto) (string, error)

func ModifySshPrivateKey added in v0.2.32

func ModifySshPrivateKey(sshPrivateKey string, authMode repository.AuthMode) string

Modifying Ssh Private Key because Ssh key authentication requires a new-line at the end of string & there are chances that user skips sending \n

func NewDockerArtifactStore added in v0.6.15

func NewDockerArtifactStore(bean *DockerArtifactStoreBean, isActive bool, createdOn time.Time, updatedOn time.Time, createdBy int32, updateBy int32) *repository.DockerArtifactStore

func SetGitCommitValuesForBuildingCommitHash added in v0.2.36

func SetGitCommitValuesForBuildingCommitHash(ciMaterial *pipelineConfig.CiPipelineMaterial, oldGitCommit bean.GitCommit) bean.GitCommit

func UpdateContainerEnvsFromCmCs added in v0.6.17

func UpdateContainerEnvsFromCmCs(workflowMainContainer *v12.Container, configMaps []bean2.ConfigSecretMap, secrets []bean2.ConfigSecretMap)

Types

type AppBean

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

type ArgoPipelineStatusSyncEvent added in v0.6.11

type ArgoPipelineStatusSyncEvent struct {
	PipelineId            int   `json:"pipelineId"`
	UserId                int32 `json:"userId"`
	IsAppStoreApplication bool  `json:"isAppStoreApplication"`
}

type ArgoWorkflowExecutor added in v0.6.17

type ArgoWorkflowExecutor interface {
	WorkflowExecutor
}

type ArgoWorkflowExecutorImpl added in v0.6.17

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

func NewArgoWorkflowExecutorImpl added in v0.6.17

func NewArgoWorkflowExecutorImpl(logger *zap.SugaredLogger) *ArgoWorkflowExecutorImpl

func (*ArgoWorkflowExecutorImpl) ExecuteWorkflow added in v0.6.17

func (impl *ArgoWorkflowExecutorImpl) ExecuteWorkflow(workflowTemplate bean.WorkflowTemplate) error

type BuildLogRequest added in v0.6.0

type BuildLogRequest struct {
	PipelineId        int
	WorkflowId        int
	PodName           string
	LogsFilePath      string
	Namespace         string
	CloudProvider     blob_storage.BlobStorageType
	AwsS3BaseConfig   *blob_storage.AwsS3BaseConfig
	AzureBlobConfig   *blob_storage.AzureBlobBaseConfig
	GcpBlobBaseConfig *blob_storage.GcpBlobBaseConfig
	MinioEndpoint     string
}

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 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" `
	NodeLabelSelector                []string `env:"CD_NODE_LABEL_SELECTOR"`
	CdArtifactLocationFormat         string   `env:"CD_ARTIFACT_LOCATION_FORMAT" envDefault:"%d/%d.zip"`
	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
	NodeLabel                        map[string]string
	CloudProvider                    blob_storage.BlobStorageType        `env:"BLOB_STORAGE_PROVIDER" envDefault:"S3"`
	BlobStorageEnabled               bool                                `env:"BLOB_STORAGE_ENABLED" envDefault:"false"`
	BlobStorageS3AccessKey           string                              `env:"BLOB_STORAGE_S3_ACCESS_KEY"`
	BlobStorageS3SecretKey           string                              `env:"BLOB_STORAGE_S3_SECRET_KEY"`
	BlobStorageS3Endpoint            string                              `env:"BLOB_STORAGE_S3_ENDPOINT"`
	BlobStorageS3EndpointInsecure    bool                                `env:"BLOB_STORAGE_S3_ENDPOINT_INSECURE" envDefault:"false"`
	BlobStorageS3BucketVersioned     bool                                `env:"BLOB_STORAGE_S3_BUCKET_VERSIONED" envDefault:"true"`
	BlobStorageGcpCredentialJson     string                              `env:"BLOB_STORAGE_GCP_CREDENTIALS_JSON"`
	AzureAccountName                 string                              `env:"AZURE_ACCOUNT_NAME"`
	AzureGatewayUrl                  string                              `env:"AZURE_GATEWAY_URL" envDefault:"http://devtron-minio.devtroncd:9000"`
	AzureGatewayConnectionInsecure   bool                                `env:"AZURE_GATEWAY_CONNECTION_INSECURE" envDefault:"true"`
	AzureBlobContainerCiLog          string                              `env:"AZURE_BLOB_CONTAINER_CI_LOG"`
	AzureBlobContainerCiCache        string                              `env:"AZURE_BLOB_CONTAINER_CI_CACHE"`
	AzureAccountKey                  string                              `env:"AZURE_ACCOUNT_KEY"`
	BuildLogTTLValue                 int                                 `env:"BUILD_LOG_TTL_VALUE_IN_SECS" envDefault:"3600"`
	DefaultAddressPoolBaseCidr       string                              `env:"CD_DEFAULT_ADDRESS_POOL_BASE_CIDR"`
	DefaultAddressPoolSize           int                                 `env:"CD_DEFAULT_ADDRESS_POOL_SIZE"`
	ExposeCDMetrics                  bool                                `env:"EXPOSE_CD_METRICS" envDefault:"false"`
	UseBlobStorageConfigInCdWorkflow bool                                `env:"USE_BLOB_STORAGE_CONFIG_IN_CD_WORKFLOW" envDefault:"true"`
	BaseLogLocationPath              string                              `env:"BASE_LOG_LOCATION_PATH" envDefault:"/home/devtron/"`
	CdWorkflowExecutorType           pipelineConfig.WorkflowExecutorType `env:"CD_WORKFLOW_EXECUTOR_TYPE" envDefault:"AWF"`
	InAppLoggingEnabled              bool                                `env:"IN_APP_LOGGING_ENABLED" envDefault:"false"`
}

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, userId int32) (int, error)
	FetchAppWorkflowStatusForTriggerView(appId int) ([]*pipelineConfig.CdWorkflowStatus, error)
	CheckHelmAppStatusPeriodicallyAndUpdateInDb(helmPipelineStatusCheckEligibleTime int) error
	CheckArgoAppStatusPeriodicallyAndUpdateInDb(getPipelineDeployedBeforeMinutes int, getPipelineDeployedWithinHours int) error
	CheckArgoPipelineTimelineStatusPeriodicallyAndUpdateInDb(pendingSinceSeconds int, timeForDegradation int) error
	UpdatePipelineTimelineAndStatusByLiveApplicationFetch(pipeline *pipelineConfig.Pipeline, installedApp repository3.InstalledApps, userId int32) (err error, isTimelineUpdated bool)
	CheckAndSendArgoPipelineStatusSyncEventIfNeeded(pipelineId int, userId int32, isAppStoreApplication bool)
	FetchAppWorkflowStatusForTriggerViewForEnvironment(request appGroup2.AppGroupingRequest) ([]*pipelineConfig.CdWorkflowStatus, error)
	FetchAppDeploymentStatusForEnvironments(request appGroup2.AppGroupingRequest) ([]*pipelineConfig.AppDeploymentStatus, 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 repository2.EnvironmentRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	ciConfig *CiConfig, helmAppService client.HelmAppService,
	pipelineOverrideRepository chartConfig.PipelineOverrideRepository, workflowDagExecutor WorkflowDagExecutor,
	appListingService app.AppListingService, appListingRepository repository.AppListingRepository,
	pipelineStatusTimelineRepository pipelineConfig.PipelineStatusTimelineRepository,
	application application.ServiceClient, argoUserService argo.ArgoUserService,
	deploymentEventHandler app.DeploymentEventHandler,
	eventClient client2.EventClient,
	pipelineStatusTimelineResourcesService status.PipelineStatusTimelineResourcesService,
	pipelineStatusSyncDetailService status.PipelineStatusSyncDetailService,
	pipelineStatusTimelineService status.PipelineStatusTimelineService,
	appService app.AppService,
	appStatusService app_status.AppStatusService, enforcerUtil rbac.EnforcerUtil,
	installedAppRepository repository3.InstalledAppRepository,
	installedAppVersionHistoryRepository repository3.InstalledAppVersionHistoryRepository, appRepository app2.AppRepository,
	appGroupService appGroup2.AppGroupService) *CdHandlerImpl

func (*CdHandlerImpl) CancelStage

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

func (*CdHandlerImpl) CheckAndSendArgoPipelineStatusSyncEventIfNeeded added in v0.6.11

func (impl *CdHandlerImpl) CheckAndSendArgoPipelineStatusSyncEventIfNeeded(pipelineId int, userId int32, isAppStoreApplication bool)

func (*CdHandlerImpl) CheckArgoAppStatusPeriodicallyAndUpdateInDb added in v0.5.1

func (impl *CdHandlerImpl) CheckArgoAppStatusPeriodicallyAndUpdateInDb(getPipelineDeployedBeforeMinutes int, getPipelineDeployedWithinHours int) error

func (*CdHandlerImpl) CheckArgoPipelineTimelineStatusPeriodicallyAndUpdateInDb added in v0.6.4

func (impl *CdHandlerImpl) CheckArgoPipelineTimelineStatusPeriodicallyAndUpdateInDb(pendingSinceSeconds int, timeForDegradation int) error

func (*CdHandlerImpl) CheckHelmAppStatusPeriodicallyAndUpdateInDb added in v0.4.17

func (impl *CdHandlerImpl) CheckHelmAppStatusPeriodicallyAndUpdateInDb(helmPipelineStatusCheckEligibleTime int) error

func (*CdHandlerImpl) DownloadCdWorkflowArtifacts

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

func (*CdHandlerImpl) FetchAppDeploymentStatusForEnvironments added in v0.6.13

func (impl *CdHandlerImpl) FetchAppDeploymentStatusForEnvironments(request appGroup2.AppGroupingRequest) ([]*pipelineConfig.AppDeploymentStatus, error)

func (*CdHandlerImpl) FetchAppWorkflowStatusForTriggerView

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

func (*CdHandlerImpl) FetchAppWorkflowStatusForTriggerViewForEnvironment added in v0.6.13

func (impl *CdHandlerImpl) FetchAppWorkflowStatusForTriggerViewForEnvironment(request appGroup2.AppGroupingRequest) ([]*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) UpdatePipelineTimelineAndStatusByLiveApplicationFetch added in v0.6.11

func (impl *CdHandlerImpl) UpdatePipelineTimelineAndStatusByLiveApplicationFetch(pipeline *pipelineConfig.Pipeline, installedApp repository3.InstalledApps, userId int32) (error, bool)

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"`
	ArtifactBucket             string                              `json:"ciArtifactBucket"`
	ArtifactFileName           string                              `json:"ciArtifactFileName"`
	ArtifactRegion             string                              `json:"ciArtifactRegion"`
	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"`
	DockerConnection           string                              `json:"dockerConnection"`
	DockerCert                 string                              `json:"dockerCert"`
	CdCacheLocation            string                              `json:"cdCacheLocation"`
	CdCacheRegion              string                              `json:"cdCacheRegion"`
	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"`
	BlobStorageConfigured      bool                                `json:"blobStorageConfigured"`
	BlobStorageS3Config        *blob_storage.BlobStorageS3Config   `json:"blobStorageS3Config"`
	CloudProvider              blob_storage.BlobStorageType        `json:"cloudProvider"`
	AzureBlobConfig            *blob_storage.AzureBlobConfig       `json:"azureBlobConfig"`
	GcpBlobConfig              *blob_storage.GcpBlobConfig         `json:"gcpBlobConfig"`
	BlobStorageLogsKey         string                              `json:"blobStorageLogsKey"`
	InAppLoggingEnabled        bool                                `json:"inAppLoggingEnabled"`
	WorkflowPrefixForLog       string                              `json:"workflowPrefixForLog"`
	DefaultAddressPoolBaseCidr string                              `json:"defaultAddressPoolBaseCidr"`
	DefaultAddressPoolSize     int                                 `json:"defaultAddressPoolSize"`
	DeploymentTriggeredBy      string                              `json:"deploymentTriggeredBy,omitempty"`
	DeploymentTriggerTime      time.Time                           `json:"deploymentTriggerTime,omitempty"`
	DeploymentReleaseCounter   int                                 `json:"deploymentReleaseCounter,omitempty"`
	WorkflowExecutor           pipelineConfig.WorkflowExecutorType `json:"workflowExecutor"`
}

type CdWorkflowService

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

type CdWorkflowServiceImpl

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

func NewCdWorkflowServiceImpl

func NewCdWorkflowServiceImpl(Logger *zap.SugaredLogger,
	envRepository repository.EnvironmentRepository,
	cdConfig *CdConfig,
	appService app.AppService,
	globalCMCSService GlobalCMCSService,
	argoWorkflowExecutor ArgoWorkflowExecutor) *CdWorkflowServiceImpl

func (*CdWorkflowServiceImpl) DeleteWorkflow

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

func (*CdWorkflowServiceImpl) GetWorkflow

func (impl *CdWorkflowServiceImpl) GetWorkflow(name string, namespace string, clusterConfig util2.ClusterConfig, 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 *repository.Environment) error

func (*CdWorkflowServiceImpl) TerminateWorkflow

func (impl *CdWorkflowServiceImpl) TerminateWorkflow(name string, namespace string, clusterConfig util2.ClusterConfig, isExtRun bool) error

func (*CdWorkflowServiceImpl) UpdateWorkflow

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

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"`
	IsArtifactUploaded bool            `json:"isArtifactUploaded"`
	FailureReason      string          `json:"failureReason"`
}

type CiBuildConfigService added in v0.6.6

type CiBuildConfigService interface {
	Save(templateId int, overrideTemplateId int, ciBuildConfigBean *bean.CiBuildConfigBean, userId int32) error
	UpdateOrSave(templateId int, overrideTemplateId int, ciBuildConfig *bean.CiBuildConfigBean, userId int32) (*bean.CiBuildConfigBean, error)
	Delete(ciBuildConfigId int) error
	GetCountByBuildType() map[bean.CiBuildType]int
}

type CiBuildConfigServiceImpl added in v0.6.6

type CiBuildConfigServiceImpl struct {
	Logger                  *zap.SugaredLogger
	CiBuildConfigRepository pipelineConfig.CiBuildConfigRepository
}

func NewCiBuildConfigServiceImpl added in v0.6.6

func NewCiBuildConfigServiceImpl(logger *zap.SugaredLogger, ciBuildConfigRepository pipelineConfig.CiBuildConfigRepository) *CiBuildConfigServiceImpl

func (*CiBuildConfigServiceImpl) Delete added in v0.6.6

func (impl *CiBuildConfigServiceImpl) Delete(ciBuildConfigId int) error

func (*CiBuildConfigServiceImpl) GetCountByBuildType added in v0.6.6

func (impl *CiBuildConfigServiceImpl) GetCountByBuildType() map[bean.CiBuildType]int

func (*CiBuildConfigServiceImpl) Save added in v0.6.6

func (impl *CiBuildConfigServiceImpl) Save(templateId int, overrideTemplateId int, ciBuildConfigBean *bean.CiBuildConfigBean, userId int32) error

func (*CiBuildConfigServiceImpl) UpdateOrSave added in v0.6.6

func (impl *CiBuildConfigServiceImpl) UpdateOrSave(templateId int, overrideTemplateId int, ciBuildConfig *bean.CiBuildConfigBean, userId int32) (*bean.CiBuildConfigBean, error)

type CiCdPipelineOrchestrator added in v0.6.9

type CiCdPipelineOrchestrator 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, appName string) (pipelineId int, err error)
	UpdateCDPipeline(pipelineRequest *bean.CDPipelineConfigObject, userId int32, tx *pg.Tx) (err error)
	DeleteCiPipeline(pipeline *pipelineConfig.CiPipeline, request *bean.CiPatchRequest, tx *pg.Tx) error
	DeleteCdPipeline(pipelineId int, userId int32, tx *pg.Tx) error
	PatchMaterialValue(createRequest *bean.CiPipeline, userId int32, oldPipeline *pipelineConfig.CiPipeline) (*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)
	BuildCiPipelineScript(userId int32, ciScript *bean.CiScript, scriptStage string, ciPipeline *bean.CiPipeline) *pipelineConfig.CiPipelineScript
	AddPipelineMaterialInGitSensor(pipelineMaterials []*pipelineConfig.CiPipelineMaterial) error
	CheckStringMatchRegex(regex string, value string) bool
	CreateEcrRepo(dockerRepository, AWSRegion, AWSAccessKeyId, AWSSecretAccessKey string) error
	GetCdPipelinesForEnv(envId int, requestedAppIds []int) (cdPipelines *bean.CdPipelines, err error)
}

type CiCdPipelineOrchestratorImpl added in v0.6.9

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

func NewCiCdPipelineOrchestrator added in v0.6.9

func NewCiCdPipelineOrchestrator(
	pipelineGroupRepository app2.AppRepository,
	logger *zap.SugaredLogger,
	materialRepository pipelineConfig.MaterialRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	GitSensorClient gitSensor.Client, ciConfig *CiConfig,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	envRepository repository2.EnvironmentRepository,
	attributesService attributes.AttributesService,
	appListingRepository repository.AppListingRepository,
	appLabelsService app.AppCrudOperationService,
	userAuthService user.UserAuthService,
	prePostCdScriptHistoryService history3.PrePostCdScriptHistoryService,
	prePostCiScriptHistoryService history3.PrePostCiScriptHistoryService,
	pipelineStageService PipelineStageService,
	ciTemplateOverrideRepository pipelineConfig.CiTemplateOverrideRepository,
	gitMaterialHistoryService history3.GitMaterialHistoryService,
	ciPipelineHistoryService history3.CiPipelineHistoryService,
	ciTemplateService CiTemplateService,
	dockerArtifactStoreRepository dockerRegistryRepository.DockerArtifactStoreRepository) *CiCdPipelineOrchestratorImpl

func (CiCdPipelineOrchestratorImpl) AddPipelineMaterialInGitSensor added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) AddPipelineMaterialInGitSensor(pipelineMaterials []*pipelineConfig.CiPipelineMaterial) error

func (CiCdPipelineOrchestratorImpl) BuildCiPipelineScript added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) BuildCiPipelineScript(userId int32, ciScript *bean.CiScript, scriptStage string, ciPipeline *bean.CiPipeline) *pipelineConfig.CiPipelineScript

func (CiCdPipelineOrchestratorImpl) CheckStringMatchRegex added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) CheckStringMatchRegex(regex string, value string) bool

func (CiCdPipelineOrchestratorImpl) CreateApp added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) CreateCDPipelines added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) CreateCiConf added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) CreateEcrRepo added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) CreateEcrRepo(dockerRepository, AWSRegion, AWSAccessKeyId, AWSSecretAccessKey string) error

func (CiCdPipelineOrchestratorImpl) CreateMaterials added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) DeleteApp added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) DeleteCdPipeline added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) DeleteCdPipeline(pipelineId int, userId int32, tx *pg.Tx) error

func (CiCdPipelineOrchestratorImpl) DeleteCiPipeline added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) DeleteCiPipeline(pipeline *pipelineConfig.CiPipeline, request *bean.CiPatchRequest, tx *pg.Tx) error

func (CiCdPipelineOrchestratorImpl) GetByEnvOverrideId added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) GetCdPipelinesForApp added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) GetCdPipelinesForAppAndEnv added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) GetCdPipelinesForEnv added in v0.6.13

func (impl CiCdPipelineOrchestratorImpl) GetCdPipelinesForEnv(envId int, requestedAppIds []int) (cdPipelines *bean.CdPipelines, err error)

func (CiCdPipelineOrchestratorImpl) PatchMaterialValue added in v0.6.9

func (impl CiCdPipelineOrchestratorImpl) PatchMaterialValue(createRequest *bean.CiPipeline, userId int32, oldPipeline *pipelineConfig.CiPipeline) (*bean.CiPipeline, error)

func (CiCdPipelineOrchestratorImpl) PipelineExists added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) UpdateCDPipeline added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) UpdateMaterial added in v0.6.9

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

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"`
	DefaultCdLogsBucketRegion        string                       `env:"DEFAULT_CD_LOGS_BUCKET_REGION" envDefault:"us-east-2"`
	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                       `` /* 432-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                    blob_storage.BlobStorageType `env:"BLOB_STORAGE_PROVIDER" envDefault:"S3"`
	AzureAccountName                 string                       `env:"AZURE_ACCOUNT_NAME"`
	AzureGatewayUrl                  string                       `env:"AZURE_GATEWAY_URL" envDefault:"http://devtron-minio.devtroncd:9000"`
	AzureGatewayConnectionInsecure   bool                         `env:"AZURE_GATEWAY_CONNECTION_INSECURE" envDefault:"true"`
	AzureBlobContainerCiLog          string                       `env:"AZURE_BLOB_CONTAINER_CI_LOG"`
	AzureBlobContainerCiCache        string                       `env:"AZURE_BLOB_CONTAINER_CI_CACHE"`
	DefaultAddressPoolBaseCidr       string                       `env:"CI_DEFAULT_ADDRESS_POOL_BASE_CIDR"`
	DefaultAddressPoolSize           int                          `env:"CI_DEFAULT_ADDRESS_POOL_SIZE"`
	BlobStorageEnabled               bool                         `env:"BLOB_STORAGE_ENABLED" envDefault:"false"`
	BlobStorageS3AccessKey           string                       `env:"BLOB_STORAGE_S3_ACCESS_KEY"`
	BlobStorageS3SecretKey           string                       `env:"BLOB_STORAGE_S3_SECRET_KEY"`
	BlobStorageS3Endpoint            string                       `env:"BLOB_STORAGE_S3_ENDPOINT"`
	BlobStorageS3EndpointInsecure    bool                         `env:"BLOB_STORAGE_S3_ENDPOINT_INSECURE" envDefault:"false"`
	BlobStorageS3BucketVersioned     bool                         `env:"BLOB_STORAGE_S3_BUCKET_VERSIONED" envDefault:"true"`
	BlobStorageGcpCredentialJson     string                       `env:"BLOB_STORAGE_GCP_CREDENTIALS_JSON"`
	BuildLogTTLValue                 int                          `env:"BUILD_LOG_TTL_VALUE_IN_SECS" envDefault:"3600"`
	AzureAccountKey                  string                       `env:"AZURE_ACCOUNT_KEY"`
	CiRunnerDockerMTUValue           int                          `env:"CI_RUNNER_DOCKER_MTU_VALUE" envDefault:"-1"`
	IgnoreDockerCacheForCI           bool                         `env:"CI_IGNORE_DOCKER_CACHE"`
	VolumeMountsForCiJson            string                       `env:"CI_VOLUME_MOUNTS_JSON"`
	BuildPvcCachePath                string                       `env:"PRE_CI_CACHE_PATH" envDefault:"/devtroncd-cache"`
	DefaultPvcCachePath              string                       `env:"DOCKER_BUILD_CACHE_PATH" envDefault:"/var/lib/docker"`
	BuildxPvcCachePath               string                       `env:"BUILDX_CACHE_PATH" envDefault:"/var/lib/devtron/buildx"`
	UseBlobStorageConfigInCiWorkflow bool                         `env:"USE_BLOB_STORAGE_CONFIG_IN_CI_WORKFLOW" envDefault:"true"`
	BaseLogLocationPath              string                       `env:"BASE_LOG_LOCATION_PATH" envDefault:"/home/devtron/"`
	InAppLoggingEnabled              bool                         `env:"IN_APP_LOGGING_ENABLED" envDefault:"false"`
	ClusterConfig                    *rest.Config
	NodeLabel                        map[string]string
	EnableBuildContext               bool `env:"ENABLE_BUILD_CONTEXT" envDefault:"false"`
}

func GetCiConfig

func GetCiConfig() (*CiConfig, error)

type CiHandler

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

	FetchMaterialsByPipelineId(pipelineId int, showAll bool) ([]pipelineConfig.CiPipelineMaterialResponse, error)
	FetchMaterialsByPipelineIdAndGitMaterialId(pipelineId int, gitMaterialId int, showAll bool) ([]pipelineConfig.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)
	FetchCiStatusForTriggerViewV1(appId int) ([]*pipelineConfig.CiWorkflowStatus, error)
	RefreshMaterialByCiPipelineMaterialId(gitMaterialId int) (refreshRes *gitSensor.RefreshGitMaterialResponse, err error)
	FetchMaterialInfoByArtifactId(ciArtifactId int, envId int) (*GitTriggerInfoResponse, error)
	WriteToCreateTestSuites(pipelineId int, buildId int, triggeredBy int)
	UpdateCiWorkflowStatusFailure(timeoutForFailureCiBuild int) error
	FetchCiStatusForTriggerViewForEnvironment(request appGroup2.AppGroupingRequest) ([]*pipelineConfig.CiWorkflowStatus, error)
}

type CiHandlerImpl

type CiHandlerImpl struct {
	Logger *zap.SugaredLogger

	K8sUtil *util.K8sUtil
	// contains filtered or unexported fields
}

func NewCiHandlerImpl

func NewCiHandlerImpl(Logger *zap.SugaredLogger, ciService CiService, ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	gitSensorClient gitSensor.Client, 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,
	K8sUtil *util.K8sUtil, cdPipelineRepository pipelineConfig.PipelineRepository, enforcerUtil rbac.EnforcerUtil,
	appGroupService appGroup2.AppGroupService) *CiHandlerImpl

func (*CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeBranchFix added in v0.2.22

func (impl *CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeBranchFix(ciPipelineMaterial bean.CiPipelineMaterial, pipeLineMaterialFromDb *pipelineConfig.CiPipelineMaterial) (bean.GitCommit, error)

func (*CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeWebhook added in v0.2.22

func (impl *CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeWebhook(ciPipelineMaterial bean.CiPipelineMaterial, pipeLineMaterialFromDb *pipelineConfig.CiPipelineMaterial) (bean.GitCommit, map[string]string, error)

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) FetchCiStatusForTriggerViewForEnvironment added in v0.6.13

func (impl *CiHandlerImpl) FetchCiStatusForTriggerViewForEnvironment(request appGroup2.AppGroupingRequest) ([]*pipelineConfig.CiWorkflowStatus, error)

func (*CiHandlerImpl) FetchCiStatusForTriggerViewV1 added in v0.6.17

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

func (*CiHandlerImpl) FetchMaterialInfoByArtifactId

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

func (*CiHandlerImpl) FetchMaterialsByPipelineId

func (impl *CiHandlerImpl) FetchMaterialsByPipelineId(pipelineId int, showAll bool) ([]pipelineConfig.CiPipelineMaterialResponse, error)

func (*CiHandlerImpl) FetchMaterialsByPipelineIdAndGitMaterialId added in v0.6.17

func (impl *CiHandlerImpl) FetchMaterialsByPipelineIdAndGitMaterialId(pipelineId int, gitMaterialId int, showAll bool) ([]pipelineConfig.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) RefreshMaterialByCiPipelineMaterialId

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

func (*CiHandlerImpl) UpdateCiWorkflowStatusFailure added in v0.6.10

func (impl *CiHandlerImpl) UpdateCiWorkflowStatusFailure(timeoutForFailureCiBuild int) 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 CiLogService

type CiLogService interface {
	FetchRunningWorkflowLogs(ciLogRequest BuildLogRequest, clusterConfig util.ClusterConfig, isExt bool) (io.ReadCloser, func() error, error)
	FetchLogs(baseLogLocationPathConfig string, ciLogRequest BuildLogRequest) (*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(baseLogLocationPathConfig string, logRequest BuildLogRequest) (*os.File, func() error, error)

func (*CiLogServiceImpl) FetchRunningWorkflowLogs

func (impl *CiLogServiceImpl) FetchRunningWorkflowLogs(ciLogRequest BuildLogRequest, clusterConfig util.ClusterConfig, isExt bool) (io.ReadCloser, func() error, error)

type CiProjectDetails

type CiProjectDetails struct {
	GitRepository   string `json:"gitRepository"`
	MaterialName    string `json:"materialName"`
	CheckoutPath    string `json:"checkoutPath"`
	FetchSubmodules bool   `json:"fetchSubmodules"`
	CommitHash      string `json:"commitHash"`
	GitTag          string `json:"gitTag"`
	CommitTime      string `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"`
	WebhookData pipelineConfig.WebhookData
}

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,
	prePostCiScriptHistoryService history.PrePostCiScriptHistoryService,
	pipelineStageService PipelineStageService,
	userService user.UserService,
	ciTemplateService CiTemplateService, appCrudOperationService app.AppCrudOperationService) *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 CiTemplateService added in v0.6.6

type CiTemplateService interface {
	Save(ciTemplateBean *bean.CiTemplateBean) error
	FindByAppId(appId int) (ciTemplateBean *bean.CiTemplateBean, err error)
	FindTemplateOverrideByAppId(appId int) (ciTemplateBeans []*bean.CiTemplateBean, err error)
	FindTemplateOverrideByCiPipelineIds(ciPipelineIds []int) (ciTemplateBeans []*bean.CiTemplateBean, err error)
	FindTemplateOverrideByCiPipelineId(ciPipelineId int) (*bean.CiTemplateBean, error)
	Update(ciTemplateBean *bean.CiTemplateBean) error
	FindByAppIds(appIds []int) (map[int]*bean.CiTemplateBean, error)
}

type CiTemplateServiceImpl added in v0.6.6

type CiTemplateServiceImpl struct {
	Logger                       *zap.SugaredLogger
	CiBuildConfigService         CiBuildConfigService
	CiTemplateRepository         pipelineConfig.CiTemplateRepository
	CiTemplateOverrideRepository pipelineConfig.CiTemplateOverrideRepository
}

func NewCiTemplateServiceImpl added in v0.6.6

func NewCiTemplateServiceImpl(logger *zap.SugaredLogger, ciBuildConfigService CiBuildConfigService,
	ciTemplateRepository pipelineConfig.CiTemplateRepository, ciTemplateOverrideRepository pipelineConfig.CiTemplateOverrideRepository) *CiTemplateServiceImpl

func (CiTemplateServiceImpl) FindByAppId added in v0.6.6

func (impl CiTemplateServiceImpl) FindByAppId(appId int) (ciTemplateBean *bean.CiTemplateBean, err error)

func (CiTemplateServiceImpl) FindByAppIds added in v0.6.16

func (impl CiTemplateServiceImpl) FindByAppIds(appIds []int) (map[int]*bean.CiTemplateBean, error)

func (CiTemplateServiceImpl) FindTemplateOverrideByAppId added in v0.6.6

func (impl CiTemplateServiceImpl) FindTemplateOverrideByAppId(appId int) (ciTemplateBeans []*bean.CiTemplateBean, err error)

func (CiTemplateServiceImpl) FindTemplateOverrideByCiPipelineId added in v0.6.6

func (impl CiTemplateServiceImpl) FindTemplateOverrideByCiPipelineId(ciPipelineId int) (*bean.CiTemplateBean, error)

func (CiTemplateServiceImpl) FindTemplateOverrideByCiPipelineIds added in v0.6.16

func (impl CiTemplateServiceImpl) FindTemplateOverrideByCiPipelineIds(ciPipelineIds []int) (ciTemplateBeans []*bean.CiTemplateBean, err error)

func (CiTemplateServiceImpl) Save added in v0.6.6

func (impl CiTemplateServiceImpl) Save(ciTemplateBean *bean.CiTemplateBean) error

func (CiTemplateServiceImpl) Update added in v0.6.6

func (impl CiTemplateServiceImpl) Update(ciTemplateBean *bean.CiTemplateBean) error

type CiVolumeMount added in v0.6.4

type CiVolumeMount struct {
	Name               string `json:"name"`
	HostMountPath      string `json:"hostMountPath"`
	ContainerMountPath string `json:"containerMountPath"`
}

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"`
	ESOSecretData         ESOSecretData    `json:"esoSecretData"`
	DefaultESOSecretData  ESOSecretData    `json:"defaultESOSecretData,omitempty"`
	ExternalSecret        []ExternalSecret `json:"secretData"`
	DefaultExternalSecret []ExternalSecret `json:"defaultSecretData,omitempty"`
	RoleARN               string           `json:"roleARN"`
	SubPath               bool             `json:"subPath"`
	FilePermission        string           `json:"filePermission"`
}

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 ConfigMapSecretDto added in v0.6.17

type ConfigMapSecretDto struct {
	Name     string
	Data     map[string]string
	OwnerRef v1.OwnerReference
}

type ConfigMapSecretsResponse

type ConfigMapSecretsResponse struct {
	Maps    []bean2.ConfigSecretMap `json:"maps"`
	Secrets []bean2.ConfigSecretMap `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) (*ConfigDataRequest, error)
	CSEnvironmentFetchForEdit(name string, id int, appId int, envId int) (*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 chartRepoRepository.ChartRepository,
	logger *zap.SugaredLogger,
	repoRepository chartRepoRepository.ChartRepoRepository,
	mergeUtil util.MergeUtil,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository, environmentConfigRepository chartConfig.EnvConfigOverrideRepository,
	commonService commonService.CommonService, appRepository app.AppRepository,
	configMapHistoryService history2.ConfigMapHistoryService) *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) (*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) (*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 Deployment

type Deployment struct {
	Strategy map[string]interface{} `json:"strategy"`
}

type DeploymentConfigService added in v0.6.2

type DeploymentConfigService interface {
	GetLatestDeploymentConfigurationByPipelineId(pipelineId int, userHasAdminAccess bool) (*history.AllDeploymentConfigurationDetail, error)
}

type DeploymentConfigServiceImpl added in v0.6.2

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

func NewDeploymentConfigServiceImpl added in v0.6.2

func NewDeploymentConfigServiceImpl(logger *zap.SugaredLogger,
	envConfigOverrideRepository chartConfig.EnvConfigOverrideRepository,
	chartRepository chartRepoRepository.ChartRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	envLevelAppMetricsRepository repository.EnvLevelAppMetricsRepository,
	appLevelMetricsRepository repository.AppLevelMetricsRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository,
	configMapHistoryService history.ConfigMapHistoryService,
	chartRefRepository chartRepoRepository.ChartRefRepository) *DeploymentConfigServiceImpl

func (*DeploymentConfigServiceImpl) GetLatestCMCSConfig added in v0.6.2

func (*DeploymentConfigServiceImpl) GetLatestDeploymentConfigurationByPipelineId added in v0.6.2

func (impl *DeploymentConfigServiceImpl) GetLatestDeploymentConfigurationByPipelineId(pipelineId int, userHasAdminAccess bool) (*history.AllDeploymentConfigurationDetail, error)

func (*DeploymentConfigServiceImpl) GetLatestDeploymentTemplateConfig added in v0.6.2

func (impl *DeploymentConfigServiceImpl) GetLatestDeploymentTemplateConfig(pipeline *pipelineConfig.Pipeline) (*history.HistoryDetailDto, error)

func (*DeploymentConfigServiceImpl) GetLatestPipelineStrategyConfig added in v0.6.2

func (impl *DeploymentConfigServiceImpl) GetLatestPipelineStrategyConfig(pipeline *pipelineConfig.Pipeline) (*history.HistoryDetailDto, error)

func (*DeploymentConfigServiceImpl) GetMergedCMCSConfigMap added in v0.6.2

func (impl *DeploymentConfigServiceImpl) GetMergedCMCSConfigMap(appLevelConfig, envLevelConfig string, configType repository2.ConfigType) (map[string]*history.ConfigData, error)

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 DeploymentServiceTypeConfig added in v0.6.9

type DeploymentServiceTypeConfig struct {
	IsInternalUse bool `env:"IS_INTERNAL_USE" envDefault:"false"`
}

func GetDeploymentServiceTypeConfig added in v0.6.9

func GetDeploymentServiceTypeConfig() (*DeploymentServiceTypeConfig, error)

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"`
	Connection              string                       `json:"connection"`
	Cert                    string                       `json:"cert"`
	Active                  bool                         `json:"active"`
	User                    int32                        `json:"-"`
	DockerRegistryIpsConfig *DockerRegistryIpsConfigBean `json:"ipsConfig,notnull,omitempty" validate:"required"`
}

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)
	UpdateInactive(bean *DockerArtifactStoreBean) (*DockerArtifactStoreBean, error)
	Delete(storeId string) (string, error)
	DeleteReg(bean *DockerArtifactStoreBean) error
	CheckInActiveDockerAccount(storeId string) (bool, error)
}

type DockerRegistryConfigImpl

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

func NewDockerRegistryConfigImpl

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

func (DockerRegistryConfigImpl) CheckInActiveDockerAccount added in v0.6.15

func (impl DockerRegistryConfigImpl) CheckInActiveDockerAccount(storeId string) (bool, error)

func (DockerRegistryConfigImpl) Create

func (DockerRegistryConfigImpl) Delete

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

func (DockerRegistryConfigImpl) DeleteReg added in v0.3.15

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

func (DockerRegistryConfigImpl) UpdateInactive added in v0.6.15

type DockerRegistryIpsConfigBean added in v0.6.7

type DockerRegistryIpsConfigBean struct {
	Id                   int                                        `json:"id"`
	CredentialType       repository.DockerRegistryIpsCredentialType `json:"credentialType,omitempty" validate:"oneof=SAME_AS_REGISTRY NAME CUSTOM_CREDENTIAL"`
	CredentialValue      string                                     `json:"credentialValue,omitempty"`
	AppliedClusterIdsCsv string                                     `json:"appliedClusterIdsCsv,omitempty"`
	IgnoredClusterIdsCsv string                                     `json:"ignoredClusterIdsCsv,omitempty"`
}

type ESOData added in v0.5.3

type ESOData struct {
	SecretKey string `json:"secretKey"`
	Key       string `json:"key"`
	Property  string `json:"property,omitempty"`
}

type ESOSecretData added in v0.5.3

type ESOSecretData struct {
	SecretStore     json.RawMessage `json:"secretStore,omitempty"`
	SecretStoreRef  json.RawMessage `json:"secretStoreRef,omitempty"`
	EsoData         []ESOData       `json:"esoData,omitempty"`
	RefreshInterval string          `json:"refreshInterval,omitempty"`
}

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-space-component,required"`
	EnvironmentId     int                         `json:"environmentId"`
	EnvironmentName   string                      `json:"environmentName"`
	Latest            bool                        `json:"latest"`
	UserId            int32                       `json:"-"`
	AppMetrics        *bool                       `json:"isAppMetricsEnabled"`
	ChartRefId        int                         `json:"chartRefId,omitempty"  validate:"number"`
	IsOverride        bool                        `sql:"isOverride"`
	IsBasicViewLocked bool                        `json:"isBasicViewLocked"`
	CurrentViewEditor models.ChartsViewEditorType `json:"currentViewEditor"` //default "UNDEFINED" in db
	Description       string                      `json:"description" validate:"max=40"`
}

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-space-component"`
	Schema            json.RawMessage       `json:"schema"`
	Readme            string                `json:"readme"`
}

type ExternalSecret

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

type GitHostConfig added in v0.2.22

type GitHostConfig interface {
	GetAll() ([]GitHostRequest, error)
	GetById(id int) (*GitHostRequest, error)
	Create(request *GitHostRequest) (int, error)
}

type GitHostConfigImpl added in v0.2.22

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

func NewGitHostConfigImpl added in v0.2.22

func NewGitHostConfigImpl(gitHostRepo repository.GitHostRepository, logger *zap.SugaredLogger, attributeService attributes.AttributesService) *GitHostConfigImpl

func (GitHostConfigImpl) Create added in v0.2.22

func (impl GitHostConfigImpl) Create(request *GitHostRequest) (int, error)

Create in DB

func (GitHostConfigImpl) GetAll added in v0.2.22

func (impl GitHostConfigImpl) GetAll() ([]GitHostRequest, error)

get all git hosts

func (GitHostConfigImpl) GetById added in v0.2.22

func (impl GitHostConfigImpl) GetById(id int) (*GitHostRequest, error)

get git host by Id

type GitHostRequest added in v0.2.22

type GitHostRequest struct {
	Id              int    `json:"id,omitempty" validate:"number"`
	Name            string `json:"name,omitempty" validate:"required"`
	Active          bool   `json:"active"`
	WebhookUrl      string `json:"webhookUrl"`
	WebhookSecret   string `json:"webhookSecret"`
	EventTypeHeader string `json:"eventTypeHeader"`
	SecretHeader    string `json:"secretHeader"`
	SecretValidator string `json:"secretValidator"`
	UserId          int32  `json:"-"`
}

type GitOptions

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

type GitRegistry added in v0.2.32

type GitRegistry 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"`
	SshPrivateKey string              `json:"sshPrivateKey,omitempty"`
	AccessToken   string              `json:"accessToken,omitempty"`
	AuthMode      repository.AuthMode `json:"authMode,omitempty" validate:"required"`
	Active        bool                `json:"active"`
	UserId        int32               `json:"-"`
	GitHostId     int                 `json:"gitHostId"`
}

type GitRegistryConfig

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

type GitRegistryConfigImpl

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

func NewGitRegistryConfigImpl

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

func (GitRegistryConfigImpl) Create

func (impl GitRegistryConfigImpl) Create(request *GitRegistry) (*GitRegistry, error)

func (GitRegistryConfigImpl) Delete added in v0.3.15

func (impl GitRegistryConfigImpl) Delete(request *GitRegistry) error

func (GitRegistryConfigImpl) FetchAllGitProviders

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

func (GitRegistryConfigImpl) FetchOneGitProvider

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

func (GitRegistryConfigImpl) GetAll

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

get all active git providers

func (GitRegistryConfigImpl) Update

func (impl GitRegistryConfigImpl) Update(request *GitRegistry) (*GitRegistry, error)

func (GitRegistryConfigImpl) UpdateGitSensor

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

type GitTriggerInfoResponse

type GitTriggerInfoResponse struct {
	CiMaterials      []pipelineConfig.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 GlobalCMCSDataUpdateDto added in v0.6.15

type GlobalCMCSDataUpdateDto struct {
	Id                 int               `json:"id"`
	Data               map[string]string `json:"data"  validate:"required"`
	SecretIngestionFor string            `json:"SecretIngestionFor"` // value can be one of [ci, cd, ci/cd]
	UserId             int32             `json:"-"`
}

type GlobalCMCSService added in v0.6.1

type GlobalCMCSService interface {
	Create(model *bean.GlobalCMCSDto) (*bean.GlobalCMCSDto, error)
	UpdateDataById(config *GlobalCMCSDataUpdateDto) (*GlobalCMCSDataUpdateDto, error)
	GetGlobalCMCSDataByConfigTypeAndName(configName string, configType string) (*bean.GlobalCMCSDto, error)
	FindAllActiveByPipelineType(pipelineType string) ([]*bean.GlobalCMCSDto, error)
	FindAllActive() ([]*bean.GlobalCMCSDto, error)
	DeleteById(id int) error
}

type GlobalCMCSServiceImpl added in v0.6.1

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

func NewGlobalCMCSServiceImpl added in v0.6.1

func NewGlobalCMCSServiceImpl(logger *zap.SugaredLogger,
	globalCMCSRepository repository.GlobalCMCSRepository) *GlobalCMCSServiceImpl

func (*GlobalCMCSServiceImpl) ConvertGlobalCmcsDbObjectToGlobalCmcsDto added in v0.6.15

func (impl *GlobalCMCSServiceImpl) ConvertGlobalCmcsDbObjectToGlobalCmcsDto(GlobalCMCSDBObject []*repository.GlobalCMCS) []*bean.GlobalCMCSDto

func (*GlobalCMCSServiceImpl) Create added in v0.6.1

func (impl *GlobalCMCSServiceImpl) Create(config *bean.GlobalCMCSDto) (*bean.GlobalCMCSDto, error)

func (*GlobalCMCSServiceImpl) DeleteById added in v0.6.15

func (impl *GlobalCMCSServiceImpl) DeleteById(id int) error

func (*GlobalCMCSServiceImpl) FindAllActive added in v0.6.1

func (impl *GlobalCMCSServiceImpl) FindAllActive() ([]*bean.GlobalCMCSDto, error)

func (*GlobalCMCSServiceImpl) FindAllActiveByPipelineType added in v0.6.15

func (impl *GlobalCMCSServiceImpl) FindAllActiveByPipelineType(pipelineType string) ([]*bean.GlobalCMCSDto, error)

func (*GlobalCMCSServiceImpl) GetGlobalCMCSDataByConfigTypeAndName added in v0.6.15

func (impl *GlobalCMCSServiceImpl) GetGlobalCMCSDataByConfigTypeAndName(configName string, configType string) (*bean.GlobalCMCSDto, error)

func (*GlobalCMCSServiceImpl) UpdateDataById added in v0.6.15

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)
	DeleteMaterial(request *bean.UpdateMaterialDTO) error
	DeleteApp(appId int, userId int32) error
	GetCiPipeline(appId int) (ciConfig *bean.CiConfigRequest, err error)
	GetTriggerViewCiPipeline(appId int) (*bean.TriggerViewCiConfig, error)
	GetExternalCi(appId int) (ciConfig []*bean.ExternalCiConfig, err error)
	GetExternalCiById(appId int, externalCiId int) (ciConfig *bean.ExternalCiConfig, 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)
	DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, acdDelete bool, userId int32) (err error)
	ChangeDeploymentType(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
	ChangePipelineDeploymentType(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
	TriggerDeploymentAfterTypeChange(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
	DeleteDeploymentAppsForEnvironment(ctx context.Context, environmentId int, currentDeploymentAppType bean.DeploymentType, exclusionList []int, includeApps []int, userId int32) (*bean.DeploymentAppTypeChangeResponse, error)
	DeleteDeploymentApps(ctx context.Context, pipelines []*pipelineConfig.Pipeline, userId int32) *bean.DeploymentAppTypeChangeResponse
	GetTriggerViewCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err 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)*/
	RetrieveArtifactsByCDPipeline(pipeline *pipelineConfig.Pipeline, stage bean2.WorkflowType) (*bean.CiArtifactResponse, error)
	RetrieveParentDetails(pipelineId int) (parentId int, parentType bean2.WorkflowType, err error)
	FetchArtifactForRollback(cdPipelineId, offset, limit int) (bean.CiArtifactResponse, error)
	FindAppsByTeamId(teamId int) ([]*AppBean, error)
	FindAppsByTeamName(teamName string) ([]AppBean, error)
	FindPipelineById(cdPipelineId int) (*pipelineConfig.Pipeline, error)
	FindAppAndEnvDetailsByPipelineId(cdPipelineId int) (*pipelineConfig.Pipeline, error)
	GetAppList() ([]AppBean, error)
	GetCiPipelineMin(appId int) ([]*bean.CiPipelineMin, error)

	FetchCDPipelineStrategy(appId int) (PipelineStrategiesResponse, error)
	FetchDefaultCDPipelineStrategy(appId int, envId int) (PipelineStrategy, 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)

	GetMaterialsForAppId(appId int) []*bean.GitMaterial
	FindAllMatchesByAppName(appName string, appType helper.AppType) ([]*AppBean, error)
	GetEnvironmentByCdPipelineId(pipelineId int) (int, error)
	PatchRegexCiPipeline(request *bean.CiRegexPatchRequest) (err error)

	GetBulkActionImpactedPipelines(dto *bean.CdBulkActionRequestDto) ([]*pipelineConfig.Pipeline, error)
	PerformBulkActionOnCdPipelines(dto *bean.CdBulkActionRequestDto, impactedPipelines []*pipelineConfig.Pipeline, ctx context.Context, dryRun bool, userId int32) ([]*bean.CdBulkActionResponseDto, error)
	DeleteCiPipeline(request *bean.CiPatchRequest) (*bean.CiPipeline, error)
	IsGitOpsRequiredForCD(pipelineCreateRequest *bean.CdPipelines) bool
	SetPipelineDeploymentAppType(pipelineCreateRequest *bean.CdPipelines, isGitOpsConfigured bool)
	MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId int, envId int, acdToken string, pipeline *pipelineConfig.Pipeline) (bool, error)
	GetCiPipelineByEnvironment(request appGroup2.AppGroupingRequest) ([]*bean.CiConfigRequest, error)
	GetCiPipelineByEnvironmentMin(request appGroup2.AppGroupingRequest) ([]*bean.CiPipelineMinResponse, error)
	GetCdPipelinesByEnvironment(request appGroup2.AppGroupingRequest) (cdPipelines *bean.CdPipelines, err error)
	GetCdPipelinesByEnvironmentMin(request appGroup2.AppGroupingRequest) (cdPipelines []*bean.CDPipelineConfigObject, err error)
	GetExternalCiByEnvironment(request appGroup2.AppGroupingRequest) (ciConfig []*bean.ExternalCiConfig, err error)
	GetEnvironmentListForAutocompleteFilter(envName string, clusterIds []int, offset int, size int, emailId string, checkAuthBatch func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool), ctx context.Context) (*cluster.AppGroupingResponse, error)
	GetAppListForEnvironment(request appGroup2.AppGroupingRequest) ([]*AppBean, error)
}

type PipelineBuilderImpl

type PipelineBuilderImpl struct {
	GitFactory    *util.GitFactory
	ArgoK8sClient argocdServer.ArgoK8sClient

	CiTemplateHistoryService history.CiTemplateHistoryService
	CiPipelineHistoryService history.CiPipelineHistoryService

	ArgoUserService argo.ArgoUserService
	// contains filtered or unexported fields
}

func NewPipelineBuilderImpl

func NewPipelineBuilderImpl(logger *zap.SugaredLogger,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	dockerArtifactStoreRepository dockerRegistryRepository.DockerArtifactStoreRepository,
	materialRepo pipelineConfig.MaterialRepository,
	pipelineGroupRepo app2.AppRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	propertiesConfigService PropertiesConfigService,
	ciTemplateRepository pipelineConfig.CiTemplateRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	application application.ServiceClient,
	chartRepository chartRepoRepository.ChartRepository,
	ciArtifactRepository repository.CiArtifactRepository,
	ecrConfig *EcrConfig,
	envConfigOverrideRepository chartConfig.EnvConfigOverrideRepository,
	environmentRepository repository2.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,
	aCDAuthConfig *util3.ACDAuthConfig, gitOpsRepository repository.GitOpsConfigRepository,
	pipelineStrategyHistoryService history.PipelineStrategyHistoryService,
	prePostCiScriptHistoryService history.PrePostCiScriptHistoryService,
	prePostCdScriptHistoryService history.PrePostCdScriptHistoryService,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService,
	appLevelMetricsRepository repository.AppLevelMetricsRepository,
	pipelineStageService PipelineStageService, chartRefRepository chartRepoRepository.ChartRefRepository,
	chartTemplateService util.ChartTemplateService, chartService chart.ChartService,
	helmAppService client.HelmAppService,
	deploymentGroupRepository repository.DeploymentGroupRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	userService user.UserService,
	ciTemplateService CiTemplateService,
	ciTemplateOverrideRepository pipelineConfig.CiTemplateOverrideRepository,
	gitMaterialHistoryService history.GitMaterialHistoryService,
	CiTemplateHistoryService history.CiTemplateHistoryService,
	CiPipelineHistoryService history.CiPipelineHistoryService,
	globalStrategyMetadataRepository chartRepoRepository.GlobalStrategyMetadataRepository,
	globalStrategyMetadataChartRefMappingRepository chartRepoRepository.GlobalStrategyMetadataChartRefMappingRepository,
	deploymentConfig *DeploymentServiceTypeConfig, appStatusRepository appStatus.AppStatusRepository,
	workflowDagExecutor WorkflowDagExecutor,
	enforcerUtil rbac.EnforcerUtil, ArgoUserService argo.ArgoUserService,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	appGroupService appGroup2.AppGroupService,
	chartDeploymentService util.ChartDeploymentService) *PipelineBuilderImpl

func (PipelineBuilderImpl) BuildArtifactsForCIParent added in v0.3.12

func (impl PipelineBuilderImpl) BuildArtifactsForCIParent(cdPipelineId int, parentId int, parentType bean2.WorkflowType, ciArtifacts []bean.CiArtifactBean, artifactMap map[int]int, limit int) ([]bean.CiArtifactBean, error)

func (PipelineBuilderImpl) BuildArtifactsForCdStage added in v0.3.12

func (impl PipelineBuilderImpl) BuildArtifactsForCdStage(pipelineId int, stageType bean2.WorkflowType, ciArtifacts []bean.CiArtifactBean, artifactMap map[int]int, parent bool, limit int, parentCdId int) ([]bean.CiArtifactBean, map[int]int, int, string, error)

func (PipelineBuilderImpl) BuildArtifactsForParentStage added in v0.3.12

func (impl PipelineBuilderImpl) BuildArtifactsForParentStage(cdPipelineId int, parentId int, parentType bean2.WorkflowType, ciArtifacts []bean.CiArtifactBean, artifactMap map[int]int, limit int, parentCdId int) ([]bean.CiArtifactBean, error)

func (PipelineBuilderImpl) BulkDeleteCdPipelines added in v0.6.4

func (impl PipelineBuilderImpl) BulkDeleteCdPipelines(impactedPipelines []*pipelineConfig.Pipeline, ctx context.Context, dryRun, forceDelete bool, userId int32) []*bean.CdBulkActionResponseDto

func (PipelineBuilderImpl) ChangeDeploymentType added in v0.6.13

ChangeDeploymentType takes in DeploymentAppTypeChangeRequest struct and deletes all the cd pipelines for that deployment type in all apps that belongs to that environment and updates the db with desired deployment app type

func (PipelineBuilderImpl) ChangePipelineDeploymentType added in v0.6.17

func (PipelineBuilderImpl) CreateApp

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

func (PipelineBuilderImpl) CreateCdPipelines

func (impl PipelineBuilderImpl) CreateCdPipelines(pipelineCreateRequest *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) DeleteCdPipeline added in v0.6.6

func (impl PipelineBuilderImpl) DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete, deleteFromAcd bool, userId int32) (err error)

func (PipelineBuilderImpl) DeleteCdPipelinePartial added in v0.6.13

func (impl PipelineBuilderImpl) DeleteCdPipelinePartial(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, userId int32) (err error)

func (PipelineBuilderImpl) DeleteCiPipeline added in v0.6.6

func (impl PipelineBuilderImpl) DeleteCiPipeline(request *bean.CiPatchRequest) (*bean.CiPipeline, error)

func (PipelineBuilderImpl) DeleteDeploymentApps added in v0.6.13

func (impl PipelineBuilderImpl) DeleteDeploymentApps(ctx context.Context,
	pipelines []*pipelineConfig.Pipeline, userId int32) *bean.DeploymentAppTypeChangeResponse

func (PipelineBuilderImpl) DeleteDeploymentAppsForEnvironment added in v0.6.13

func (impl PipelineBuilderImpl) DeleteDeploymentAppsForEnvironment(ctx context.Context, environmentId int,
	currentDeploymentAppType bean.DeploymentType, exclusionList []int, includeApps []int, userId int32) (*bean.DeploymentAppTypeChangeResponse, error)

DeleteDeploymentAppsForEnvironment takes in environment id and current deployment app type and deletes all the cd pipelines for that deployment type in all apps that belongs to that environment.

func (PipelineBuilderImpl) DeleteMaterial added in v0.3.15

func (impl PipelineBuilderImpl) DeleteMaterial(request *bean.UpdateMaterialDTO) error

func (PipelineBuilderImpl) FetchArtifactForRollback

func (impl PipelineBuilderImpl) FetchArtifactForRollback(cdPipelineId, offset, limit 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) FetchDefaultCDPipelineStrategy added in v0.6.17

func (impl PipelineBuilderImpl) FetchDefaultCDPipelineStrategy(appId int, envId int) (PipelineStrategy, error)

func (PipelineBuilderImpl) FetchDeletedApp added in v0.6.17

func (PipelineBuilderImpl) FindAllMatchesByAppName added in v0.4.5

func (impl PipelineBuilderImpl) FindAllMatchesByAppName(appName string, appType helper.AppType) ([]*AppBean, error)

func (PipelineBuilderImpl) FindAppAndEnvDetailsByPipelineId added in v0.6.17

func (impl PipelineBuilderImpl) FindAppAndEnvDetailsByPipelineId(cdPipelineId int) (*pipelineConfig.Pipeline, 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) GetAppListForEnvironment added in v0.6.13

func (impl PipelineBuilderImpl) GetAppListForEnvironment(request appGroup2.AppGroupingRequest) ([]*AppBean, error)

func (PipelineBuilderImpl) GetBulkActionImpactedPipelines added in v0.6.4

func (impl PipelineBuilderImpl) GetBulkActionImpactedPipelines(dto *bean.CdBulkActionRequestDto) ([]*pipelineConfig.Pipeline, error)

func (PipelineBuilderImpl) GetCdPipelineById

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

func (PipelineBuilderImpl) GetCdPipelinesByEnvironment added in v0.6.13

func (impl PipelineBuilderImpl) GetCdPipelinesByEnvironment(request appGroup2.AppGroupingRequest) (cdPipelines *bean.CdPipelines, err error)

func (PipelineBuilderImpl) GetCdPipelinesByEnvironmentMin added in v0.6.17

func (impl PipelineBuilderImpl) GetCdPipelinesByEnvironmentMin(request appGroup2.AppGroupingRequest) (cdPipelines []*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) GetCiPipelineByEnvironment added in v0.6.13

func (impl PipelineBuilderImpl) GetCiPipelineByEnvironment(request appGroup2.AppGroupingRequest) ([]*bean.CiConfigRequest, error)

func (PipelineBuilderImpl) GetCiPipelineByEnvironmentMin added in v0.6.17

func (impl PipelineBuilderImpl) GetCiPipelineByEnvironmentMin(request appGroup2.AppGroupingRequest) ([]*bean.CiPipelineMinResponse, 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) GetEnvironmentByCdPipelineId added in v0.4.8

func (impl PipelineBuilderImpl) GetEnvironmentByCdPipelineId(pipelineId int) (int, error)

func (PipelineBuilderImpl) GetEnvironmentListForAutocompleteFilter added in v0.6.13

func (impl PipelineBuilderImpl) GetEnvironmentListForAutocompleteFilter(envName string, clusterIds []int, offset int, size int, emailId string, checkAuthBatch func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool), ctx context.Context) (*cluster.AppGroupingResponse, error)

func (PipelineBuilderImpl) GetExternalCi added in v0.6.9

func (impl PipelineBuilderImpl) GetExternalCi(appId int) (ciConfig []*bean.ExternalCiConfig, err error)

func (PipelineBuilderImpl) GetExternalCiByEnvironment added in v0.6.13

func (impl PipelineBuilderImpl) GetExternalCiByEnvironment(request appGroup2.AppGroupingRequest) (ciConfig []*bean.ExternalCiConfig, err error)

func (PipelineBuilderImpl) GetExternalCiById added in v0.6.9

func (impl PipelineBuilderImpl) GetExternalCiById(appId int, externalCiId int) (ciConfig *bean.ExternalCiConfig, err error)

func (PipelineBuilderImpl) GetMaterialsForAppId added in v0.3.6

func (impl PipelineBuilderImpl) GetMaterialsForAppId(appId int) []*bean.GitMaterial

func (PipelineBuilderImpl) GetTriggerViewCdPipelinesForApp added in v0.6.17

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

func (PipelineBuilderImpl) GetTriggerViewCiPipeline added in v0.6.17

func (impl PipelineBuilderImpl) GetTriggerViewCiPipeline(appId int) (*bean.TriggerViewCiConfig, error)

func (PipelineBuilderImpl) IsGitOpsRequiredForCD added in v0.6.9

func (impl PipelineBuilderImpl) IsGitOpsRequiredForCD(pipelineCreateRequest *bean.CdPipelines) bool

func (PipelineBuilderImpl) IsGitopsConfigured added in v0.6.9

func (impl PipelineBuilderImpl) IsGitopsConfigured() (bool, error)

func (PipelineBuilderImpl) MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted added in v0.6.13

func (impl PipelineBuilderImpl) MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId int, envId int, acdToken string, pipeline *pipelineConfig.Pipeline) (bool, 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) PatchRegexCiPipeline added in v0.4.28

func (impl PipelineBuilderImpl) PatchRegexCiPipeline(request *bean.CiRegexPatchRequest) (err error)

func (PipelineBuilderImpl) PerformBulkActionOnCdPipelines added in v0.6.4

func (impl PipelineBuilderImpl) PerformBulkActionOnCdPipelines(dto *bean.CdBulkActionRequestDto, impactedPipelines []*pipelineConfig.Pipeline, ctx context.Context, dryRun bool, userId int32) ([]*bean.CdBulkActionResponseDto, error)

func (PipelineBuilderImpl) RegisterInACD added in v0.6.9

func (impl PipelineBuilderImpl) RegisterInACD(gitOpsRepoName string, chartGitAttr *util.ChartGitAttribute, userId int32, ctx context.Context) error

func (PipelineBuilderImpl) RetrieveArtifactsByCDPipeline added in v0.6.17

func (impl PipelineBuilderImpl) RetrieveArtifactsByCDPipeline(pipeline *pipelineConfig.Pipeline, stage bean2.WorkflowType) (*bean.CiArtifactResponse, error)

RetrieveArtifactsByCDPipeline returns all the artifacts for the cd pipeline (pre / deploy / post)

func (PipelineBuilderImpl) RetrieveParentDetails added in v0.6.17

func (impl PipelineBuilderImpl) RetrieveParentDetails(pipelineId int) (parentId int, parentType bean2.WorkflowType, err error)

RetrieveParentDetails returns the parent id and type of the parent

func (PipelineBuilderImpl) SetPipelineDeploymentAppType added in v0.6.9

func (impl PipelineBuilderImpl) SetPipelineDeploymentAppType(pipelineCreateRequest *bean.CdPipelines, isGitOpsConfigured bool)

func (PipelineBuilderImpl) TriggerDeploymentAfterTypeChange added in v0.6.17

func (impl PipelineBuilderImpl) TriggerDeploymentAfterTypeChange(ctx context.Context,
	request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, 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)

func (PipelineBuilderImpl) ValidateCDPipelineRequest added in v0.6.9

func (impl PipelineBuilderImpl) ValidateCDPipelineRequest(pipelineCreateRequest *bean.CdPipelines, isGitOpsConfigured, haveAtleastOneGitOps bool) (bool, error)

type PipelineStageService added in v0.4.2

type PipelineStageService interface {
	GetCiPipelineStageData(ciPipelineId int) (preCiStage *bean.PipelineStageDto, postCiStage *bean.PipelineStageDto, err error)
	CreateCiStage(stageReq *bean.PipelineStageDto, stageType repository.PipelineStageType, ciPipelineId int, userId int32) error
	UpdateCiStage(stageReq *bean.PipelineStageDto, stageType repository.PipelineStageType, ciPipelineId int, userId int32) error
	DeleteCiStage(stageReq *bean.PipelineStageDto, userId int32, tx *pg.Tx) error
	BuildPrePostAndRefPluginStepsDataForWfRequest(ciPipelineId int) ([]*bean.StepObject, []*bean.StepObject, []*bean.RefPluginObject, error)

	GetCiPipelineStageDataDeepCopy(ciPipelineId int) (preCiStage *bean.PipelineStageDto, postCiStage *bean.PipelineStageDto, err error)
}

type PipelineStageServiceImpl added in v0.4.2

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

func NewPipelineStageService added in v0.4.2

func NewPipelineStageService(logger *zap.SugaredLogger,
	pipelineStageRepository repository.PipelineStageRepository,
	globalPluginRepository repository2.GlobalPluginRepository) *PipelineStageServiceImpl

func (*PipelineStageServiceImpl) BuildCiStageData added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildCiStageData(ciStage *repository.PipelineStage) (*bean.PipelineStageDto, error)

func (*PipelineStageServiceImpl) BuildCiStageDataDeepCopy added in v0.6.1

func (impl *PipelineStageServiceImpl) BuildCiStageDataDeepCopy(ciStage *repository.PipelineStage) (*bean.PipelineStageDto, error)

func (*PipelineStageServiceImpl) BuildCiStageDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildCiStageDataForWfRequest(ciStage *repository.PipelineStage) ([]*bean.StepObject, []int, error)

func (*PipelineStageServiceImpl) BuildCiStepDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildCiStepDataForWfRequest(step *repository.PipelineStageStep) (*bean.StepObject, error)

func (*PipelineStageServiceImpl) BuildInlineStepData added in v0.4.2

func (*PipelineStageServiceImpl) BuildInlineStepDataDeepCopy added in v0.6.1

func (impl *PipelineStageServiceImpl) BuildInlineStepDataDeepCopy(step *repository.PipelineStageStep) (*bean.InlineStepDetailDto, error)

func (*PipelineStageServiceImpl) BuildPluginStepDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildPluginStepDataForWfRequest(step *repository2.PluginStep) (*bean.StepObject, error)

func (*PipelineStageServiceImpl) BuildPluginVariableAndConditionDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildPluginVariableAndConditionDataForWfRequest(stepId int) ([]*bean.VariableObject, []*bean.VariableObject, []*bean.ConditionObject, []*bean.ConditionObject, error)

func (*PipelineStageServiceImpl) BuildPrePostAndRefPluginStepsDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildPrePostAndRefPluginStepsDataForWfRequest(ciPipelineId int) ([]*bean.StepObject, []*bean.StepObject, []*bean.RefPluginObject, error)

BuildPrePostAndRefPluginStepsDataForWfRequest and related methods starts

func (*PipelineStageServiceImpl) BuildRefPluginStepData added in v0.4.2

func (*PipelineStageServiceImpl) BuildRefPluginStepDataDeepCopy added in v0.6.1

func (impl *PipelineStageServiceImpl) BuildRefPluginStepDataDeepCopy(step *repository.PipelineStageStep) (*bean.RefPluginStepDetailDto, error)

func (*PipelineStageServiceImpl) BuildRefPluginStepDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildRefPluginStepDataForWfRequest(refPluginIds []int) ([]*bean.RefPluginObject, error)

func (*PipelineStageServiceImpl) BuildVariableAndConditionDataByStepId added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildVariableAndConditionDataByStepId(stepId int) ([]*bean.StepVariableDto, []*bean.StepVariableDto, []*bean.ConditionDetailDto, error)

func (*PipelineStageServiceImpl) BuildVariableAndConditionDataByStepIdDeepCopy added in v0.6.1

func (impl *PipelineStageServiceImpl) BuildVariableAndConditionDataByStepIdDeepCopy(stepId int) ([]*bean.StepVariableDto, []*bean.StepVariableDto, []*bean.ConditionDetailDto, error)

func (*PipelineStageServiceImpl) BuildVariableAndConditionDataForWfRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildVariableAndConditionDataForWfRequest(stepId int) ([]*bean.VariableObject, []*bean.VariableObject, []*bean.ConditionObject, []*bean.ConditionObject, error)

func (*PipelineStageServiceImpl) CreateCiStage added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateCiStage(stageReq *bean.PipelineStageDto, stageType repository.PipelineStageType, ciPipelineId int, userId int32) error

CreateCiStage and related methods starts

func (*PipelineStageServiceImpl) CreateConditions added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateConditions(stepId int, conditions []*bean.ConditionDetailDto, inputVariablesRepo []repository.PipelineStageStepVariable, outputVariablesRepo []repository.PipelineStageStepVariable, userId int32) error

func (*PipelineStageServiceImpl) CreateConditionsEntryInDb added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateConditionsEntryInDb(stepId int, conditions []*bean.ConditionDetailDto, variableNameIdMap map[string]int, userId int32, tx *pg.Tx) ([]repository.PipelineStageStepCondition, error)

func (*PipelineStageServiceImpl) CreateInputAndOutputVariables added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateInputAndOutputVariables(stepId int, inputVariables []*bean.StepVariableDto, outputVariables []*bean.StepVariableDto, userId int32) (inputVariablesRepo []repository.PipelineStageStepVariable, outputVariablesRepo []repository.PipelineStageStepVariable, err error)

func (*PipelineStageServiceImpl) CreateScriptAndMappingForInlineStep added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateScriptAndMappingForInlineStep(inlineStepDetail *bean.InlineStepDetailDto, userId int32) (scriptId int, err error)

func (*PipelineStageServiceImpl) CreateStageSteps added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateStageSteps(steps []*bean.PipelineStageStepDto, stageId int, userId int32, indexNameString map[int]string) error

func (*PipelineStageServiceImpl) CreateVariablesEntryInDb added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateVariablesEntryInDb(stepId int, variables []*bean.StepVariableDto, variableType repository.PipelineStageStepVariableType, userId int32, tx *pg.Tx) ([]repository.PipelineStageStepVariable, error)

func (*PipelineStageServiceImpl) DeleteCiStage added in v0.4.2

func (impl *PipelineStageServiceImpl) DeleteCiStage(stageReq *bean.PipelineStageDto, userId int32, tx *pg.Tx) error

DeleteCiStage and related methods starts

func (*PipelineStageServiceImpl) FilterAndActOnStepsInCiStageUpdateRequest added in v0.4.2

func (impl *PipelineStageServiceImpl) FilterAndActOnStepsInCiStageUpdateRequest(stageReq *bean.PipelineStageDto, userId int32) error

func (*PipelineStageServiceImpl) GetCiPipelineStageData added in v0.4.2

func (impl *PipelineStageServiceImpl) GetCiPipelineStageData(ciPipelineId int) (*bean.PipelineStageDto, *bean.PipelineStageDto, error)

GetCiPipelineStageData and related methods starts

func (*PipelineStageServiceImpl) GetCiPipelineStageDataDeepCopy added in v0.6.1

func (impl *PipelineStageServiceImpl) GetCiPipelineStageDataDeepCopy(ciPipelineId int) (*bean.PipelineStageDto, *bean.PipelineStageDto, error)

func (*PipelineStageServiceImpl) GetRefPluginStepsByIds added in v0.4.2

func (impl *PipelineStageServiceImpl) GetRefPluginStepsByIds(refPluginIds []int, pluginIdsEvaluated map[int]bool) (map[int][]*bean.StepObject, error)

func (*PipelineStageServiceImpl) UpdateCiStage added in v0.4.2

func (impl *PipelineStageServiceImpl) UpdateCiStage(stageReq *bean.PipelineStageDto, stageType repository.PipelineStageType, ciPipelineId int, userId int32) error

UpdateCiStage and related methods starts

func (*PipelineStageServiceImpl) UpdateInputAndOutputVariables added in v0.4.2

func (impl *PipelineStageServiceImpl) UpdateInputAndOutputVariables(stepId int, inputVariables []*bean.StepVariableDto, outputVariables []*bean.StepVariableDto, userId int32) (inputVarNameIdMap map[string]int, outputVarNameIdMap map[string]int, err error)

func (*PipelineStageServiceImpl) UpdatePipelineStageStepConditions added in v0.4.2

func (impl *PipelineStageServiceImpl) UpdatePipelineStageStepConditions(stepId int, conditions []*bean.ConditionDetailDto, variableNameIdMap map[string]int, userId int32) ([]repository.PipelineStageStepCondition, error)

func (*PipelineStageServiceImpl) UpdatePipelineStageStepVariables added in v0.4.2

func (impl *PipelineStageServiceImpl) UpdatePipelineStageStepVariables(stepId int, variables []*bean.StepVariableDto, variableType repository.PipelineStageStepVariableType, userId int32, tx *pg.Tx) (map[string]int, error)

func (*PipelineStageServiceImpl) UpdateScriptAndMappingForInlineStep added in v0.4.2

func (impl *PipelineStageServiceImpl) UpdateScriptAndMappingForInlineStep(inlineStepDetail *bean.InlineStepDetailDto, scriptId int, userId int32) (err error)

func (*PipelineStageServiceImpl) UpdateStageSteps added in v0.4.2

func (impl *PipelineStageServiceImpl) UpdateStageSteps(steps []*bean.PipelineStageStepDto, userId int32, stageId int, indexNameString map[int]string) error

type PipelineStrategiesResponse

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

type PipelineStrategy

type PipelineStrategy struct {
	DeploymentTemplate chartRepoRepository.DeploymentStrategy `json:"deploymentTemplate,omitempty"` //
	Config             json.RawMessage                        `json:"config"`
	Default            bool                                   `json:"default"`
}

type PodRotateRequest added in v0.6.17

type PodRotateRequest struct {
	AppId               int                              `json:"appId" validate:"required"`
	EnvironmentId       int                              `json:"environmentId" validate:"required"`
	UserId              int32                            `json:"-"`
	ResourceIdentifiers []application.ResourceIdentifier `json:"resources" validate:"required"`
}

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 *chartRepoRepository.Chart, environmentId int, userId int32, manualReviewed bool, chartStatus models.ChartStatus, isOverride, isAppMetricsEnabled bool, namespace string, IsBasicViewLocked bool, CurrentViewEditor models.ChartsViewEditorType, tx *pg.Tx) (*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 *chartService.AppMetricEnableDisableRequest) (*chartService.AppMetricEnableDisableRequest, error)
}

type PropertiesConfigServiceImpl

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

func NewPropertiesConfigServiceImpl

func NewPropertiesConfigServiceImpl(logger *zap.SugaredLogger,
	envConfigRepo chartConfig.EnvConfigOverrideRepository,
	chartRepo chartRepoRepository.ChartRepository,
	chartRefRepository chartRepoRepository.ChartRefRepository,
	mergeUtil util.MergeUtil,
	environmentRepository repository2.EnvironmentRepository,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	application application.ServiceClient,
	envLevelAppMetricsRepository repository.EnvLevelAppMetricsRepository,
	appLevelMetricsRepository repository.AppLevelMetricsRepository,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService) *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 *chartRepoRepository.Chart, environmentId int, userId int32, manualReviewed bool, chartStatus models.ChartStatus, isOverride, isAppMetricsEnabled bool, namespace string, IsBasicViewLocked bool, CurrentViewEditor models.ChartsViewEditorType, tx *pg.Tx) (*chartConfig.EnvConfigOverride, error)

func (PropertiesConfigServiceImpl) EnvMetricsEnableDisable

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 RequestType

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

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 TeamAppBean

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

type Trigger

type Trigger struct {
	PipelineId                int
	CommitHashes              map[int]bean.GitCommit
	CiMaterials               []*pipelineConfig.CiPipelineMaterial
	TriggeredBy               int32
	InvalidateCache           bool
	ExtraEnvironmentVariables map[string]string // extra env variables which will be used for CI
}

type WebhookEventDataConfig added in v0.2.22

type WebhookEventDataConfig interface {
	Save(webhookEventDataRequest *WebhookEventDataRequest) error
	GetById(payloadId int) (*WebhookEventDataRequest, error)
}

type WebhookEventDataConfigImpl added in v0.2.22

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

func NewWebhookEventDataConfigImpl added in v0.2.22

func NewWebhookEventDataConfigImpl(logger *zap.SugaredLogger, webhookEventDataRepository repository.WebhookEventDataRepository) *WebhookEventDataConfigImpl

func (WebhookEventDataConfigImpl) GetById added in v0.2.27

func (impl WebhookEventDataConfigImpl) GetById(payloadId int) (*WebhookEventDataRequest, error)

func (WebhookEventDataConfigImpl) Save added in v0.2.22

func (impl WebhookEventDataConfigImpl) Save(webhookEventDataRequest *WebhookEventDataRequest) error

type WebhookEventDataRequest added in v0.2.22

type WebhookEventDataRequest struct {
	PayloadId          int       `json:"payloadId"`
	GitHostId          int       `json:"gitHostId"`
	EventType          string    `json:"eventType"`
	RequestPayloadJson string    `json:"requestPayloadJson"`
	CreatedOn          time.Time `json:"createdOn"`
}

type WebhookService

type WebhookService interface {
	AuthenticateExternalCiWebhook(apiKey string) (int, error)
	HandleCiSuccessEvent(ciPipelineId int, request *CiArtifactWebhookRequest) (id int, err error)
	HandleExternalCiWebhook(externalCiId int, request *CiArtifactWebhookRequest, auth func(token string, projectObject string, envObject string) bool) (id int, err error)
	HandleCiStepFailedEvent(ciPipelineId int, request *CiArtifactWebhookRequest) (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) HandleCiStepFailedEvent added in v0.6.17

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

func (WebhookServiceImpl) HandleCiSuccessEvent added in v0.6.9

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

func (WebhookServiceImpl) HandleExternalCiWebhook added in v0.6.9

func (impl WebhookServiceImpl) HandleExternalCiWebhook(externalCiId int, request *CiArtifactWebhookRequest, auth func(token string, projectObject string, envObject string) bool) (id int, err error)

func (*WebhookServiceImpl) WriteCIStepFailedEvent added in v0.6.17

func (impl *WebhookServiceImpl) WriteCIStepFailedEvent(pipeline *pipelineConfig.CiPipeline, request *CiArtifactWebhookRequest, ciWorkflow *pipelineConfig.CiWorkflow)

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
	HandleWebhookExternalCiEvent(artifact *repository.CiArtifact, triggeredBy int32, externalCiId int, auth func(email string, projectObject string, envObject string) bool) (bool, error)
	HandlePreStageSuccessEvent(cdStageCompleteEvent CdStageCompleteEvent) error
	HandleDeploymentSuccessEvent(gitHash string, pipelineOverrideId int) error
	HandlePostStageSuccessEvent(cdWorkflowId int, cdPipelineId int, triggeredBy int32) 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, 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)
	RotatePods(ctx context.Context, podRotateRequest *PodRotateRequest) (*k8s.RotatePodResponse, error)
}

type WorkflowDagExecutorImpl

type WorkflowDagExecutorImpl struct {
	CiTemplateRepository pipelineConfig.CiTemplateRepository
	// contains filtered or unexported fields
}

func NewWorkflowDagExecutorImpl

func NewWorkflowDagExecutorImpl(Logger *zap.SugaredLogger, pipelineRepository pipelineConfig.PipelineRepository,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	pubsubClient *pubsub.PubSubClientServiceImpl,
	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 repository2.EnvironmentRepository,
	enforcer casbin.Enforcer, enforcerUtil rbac.EnforcerUtil, tokenCache *util3.TokenCache,
	acdAuthConfig *util3.ACDAuthConfig, eventFactory client.EventFactory,
	eventClient client.EventClient, cvePolicyRepository security.CvePolicyRepository,
	scanResultRepository security.ImageScanResultRepository,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	prePostCdScriptHistoryService history2.PrePostCdScriptHistoryService,
	argoUserService argo.ArgoUserService,
	cdPipelineStatusTimelineRepo pipelineConfig.PipelineStatusTimelineRepository,
	pipelineStatusTimelineService status.PipelineStatusTimelineService,
	CiTemplateRepository pipelineConfig.CiTemplateRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	appLabelRepository pipelineConfig.AppLabelRepository, gitSensorGrpcClient gitSensorClient.Client,
	k8sApplicationService k8s.K8sApplicationService) *WorkflowDagExecutorImpl

func (*WorkflowDagExecutorImpl) GetArtifactVulnerabilityStatus added in v0.6.17

func (impl *WorkflowDagExecutorImpl) GetArtifactVulnerabilityStatus(artifact *repository.CiArtifact, cdPipeline *pipelineConfig.Pipeline, ctx context.Context) (bool, error)

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, pipelineOverrideId int) error

func (*WorkflowDagExecutorImpl) HandlePostStageSuccessEvent added in v0.3.12

func (impl *WorkflowDagExecutorImpl) HandlePostStageSuccessEvent(cdWorkflowId int, cdPipelineId int, triggeredBy int32) error

func (*WorkflowDagExecutorImpl) HandlePreStageSuccessEvent

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

func (*WorkflowDagExecutorImpl) HandleWebhookExternalCiEvent added in v0.6.9

func (impl *WorkflowDagExecutorImpl) HandleWebhookExternalCiEvent(artifact *repository.CiArtifact, triggeredBy int32, externalCiId int, auth func(email string, projectObject string, envObject string) bool) (bool, error)

func (*WorkflowDagExecutorImpl) ManualCdTrigger

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

func (*WorkflowDagExecutorImpl) RotatePods added in v0.6.17

func (impl *WorkflowDagExecutorImpl) RotatePods(ctx context.Context, podRotateRequest *PodRotateRequest) (*k8s.RotatePodResponse, 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, triggeredBy int32) error

Only used for auto trigger

func (*WorkflowDagExecutorImpl) TriggerPostStage

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

func (*WorkflowDagExecutorImpl) TriggerPreStage

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

type WorkflowExecutor added in v0.6.17

type WorkflowExecutor interface {
	ExecuteWorkflow(workflowTemplate bean.WorkflowTemplate) error
}

type WorkflowRequest

type WorkflowRequest struct {
	WorkflowNamePrefix         string                            `json:"workflowNamePrefix"`
	PipelineName               string                            `json:"pipelineName"`
	PipelineId                 int                               `json:"pipelineId"`
	DockerImageTag             string                            `json:"dockerImageTag"`
	DockerRegistryId           string                            `json:"dockerRegistryId"`
	DockerRegistryType         string                            `json:"dockerRegistryType"`
	DockerRegistryURL          string                            `json:"dockerRegistryURL"`
	DockerConnection           string                            `json:"dockerConnection"`
	DockerCert                 string                            `json:"dockerCert"`
	DockerRepository           string                            `json:"dockerRepository"`
	CheckoutPath               string                            `json:"checkoutPath"`
	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"`
	CiArtifactBucket           string                            `json:"ciArtifactBucket"`
	CiArtifactFileName         string                            `json:"ciArtifactFileName"`
	CiArtifactRegion           string                            `json:"ciArtifactRegion"`
	ScanEnabled                bool                              `json:"scanEnabled"`
	CloudProvider              blob_storage.BlobStorageType      `json:"cloudProvider"`
	BlobStorageConfigured      bool                              `json:"blobStorageConfigured"`
	BlobStorageS3Config        *blob_storage.BlobStorageS3Config `json:"blobStorageS3Config"`
	AzureBlobConfig            *blob_storage.AzureBlobConfig     `json:"azureBlobConfig"`
	GcpBlobConfig              *blob_storage.GcpBlobConfig       `json:"gcpBlobConfig"`
	BlobStorageLogsKey         string                            `json:"blobStorageLogsKey"`
	InAppLoggingEnabled        bool                              `json:"inAppLoggingEnabled"`
	DefaultAddressPoolBaseCidr string                            `json:"defaultAddressPoolBaseCidr"`
	DefaultAddressPoolSize     int                               `json:"defaultAddressPoolSize"`
	PreCiSteps                 []*bean2.StepObject               `json:"preCiSteps"`
	PostCiSteps                []*bean2.StepObject               `json:"postCiSteps"`
	RefPlugins                 []*bean2.RefPluginObject          `json:"refPlugins"`
	AppName                    string                            `json:"appName"`
	TriggerByAuthor            string                            `json:"triggerByAuthor"`
	CiBuildConfig              *bean2.CiBuildConfigBean          `json:"ciBuildConfig"`
	CiBuildDockerMtuValue      int                               `json:"ciBuildDockerMtuValue"`
	IgnoreDockerCachePush      bool                              `json:"ignoreDockerCachePush"`
	IgnoreDockerCachePull      bool                              `json:"ignoreDockerCachePull"`
	CacheInvalidate            bool                              `json:"cacheInvalidate"`
	IsPvcMounted               bool                              `json:"IsPvcMounted"`
	ExtraEnvironmentVariables  map[string]string                 `json:"extraEnvironmentVariables"`
	EnableBuildContext         bool                              `json:"enableBuildContext"`
}

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"`
	BlobStorageEnabled   bool                                        `json:"blobStorageEnabled"`
	GitTriggers          map[int]pipelineConfig.GitCommit            `json:"gitTriggers"`
	CiMaterials          []pipelineConfig.CiPipelineMaterialResponse `json:"ciMaterials"`
	TriggeredBy          int32                                       `json:"triggeredBy"`
	Artifact             string                                      `json:"artifact"`
	TriggeredByEmail     string                                      `json:"triggeredByEmail"`
	Stage                string                                      `json:"stage"`
	ArtifactId           int                                         `json:"artifactId"`
	IsArtifactUploaded   bool                                        `json:"isArtifactUploaded"`
	IsVirtualEnvironment bool                                        `json:"isVirtualEnvironment"`
	PodName              string                                      `json:"podName"`
}

type WorkflowService

type WorkflowService interface {
	SubmitWorkflow(workflowRequest *WorkflowRequest, appLabels map[string]string) (*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,
	globalCMCSService GlobalCMCSService) *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, appLabels map[string]string) (*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, PodName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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