pipeline

package
v0.6.29 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 111 Imported by: 30

Documentation

Index

Constants

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 (
	KubernetesSecret  string = "KubernetesSecret"
	AWSSecretsManager string = "AWSSecretsManager"
	AWSSystemManager  string = "AWSSystemManager"
	HashiCorpVault    string = "HashiCorpVault"
)
View Source
const (
	DISABLED_CONTAINER  types.DisabledFields = "CONTAINER"
	DISABLED_CHART_PULL types.DisabledFields = "CHART_PULL"
)
View Source
const (
	DESTINATION_INFO                copyContainerImagePluginInputVariable = "DESTINATION_INFO"
	SOURCE_REGISTRY_CREDENTIALS_KEY                                       = "SOURCE_REGISTRY_CREDENTIAL"
)
View Source
const ABORT_MESSAGE_AFTER_STARTING_STAGE = "workflow shutdown with strategy: Force Abort"
View Source
const AFTER_DOCKER_BUILD string = "AFTER_DOCKER_BUILD"
View Source
const BEFORE_DOCKER_BUILD string = "BEFORE_DOCKER_BUILD"
View Source
const (
	CI_NODE_SELECTOR_APP_LABEL_KEY = "devtron.ai/node-selector"
)
View Source
const CiStageFailErrorCode = 2
View Source
const CommentKey = "comment"
View Source
const DashboardConfigMap = "dashboard-cm"
View Source
const DefaultCiWorkflowNamespace = "devtron-ci"
View Source
const DuplicateTagsInAppError = "cannot create duplicate tags in the same app"
View Source
const NotDeployed = "Not Deployed"
View Source
const NotTriggered string = "Not Triggered"
View Source
const POD_DELETED_MESSAGE = "pod deleted"
View Source
const Running = "Running"
View Source
const SECURITY_SCANNING = "FORCE_SECURITY_SCANNING"
View Source
const Starting = "Starting"
View Source
const TERMINATE_MESSAGE = "workflow shutdown with strategy: Terminate"
View Source
const TagsKey = "tags"
View Source
const WorklowTypeDeploy = "DEPLOY"
View Source
const WorklowTypePost = "POST"
View Source
const WorklowTypePre = "PRE"

Variables

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

Functions

func ConvertStageYamlScriptsToPipelineStageSteps added in v0.6.21

func ConvertStageYamlScriptsToPipelineStageSteps(cdPipeline *bean2.CDPipelineConfigObject) (*bean2.CDPipelineConfigObject, error)

func CreatePreAndPostStageResponse added in v0.6.21

func CreatePreAndPostStageResponse(cdPipeline *bean2.CDPipelineConfigObject, version string) (*bean2.CDPipelineConfigObject, error)

func ExtractWorkflowStatus added in v0.6.28

func ExtractWorkflowStatus(workflowStatus v1alpha1.WorkflowStatus) (string, string, string, string, string, string)

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 *types.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 pipelineConfig.GitCommit) pipelineConfig.GitCommit

func StageStepsToCdStageAdapter added in v0.6.21

func StageStepsToCdStageAdapter(deployStage *bean.PipelineStageDto) (*bean2.CdStage, error)

func StageYamlToPipelineStageAdapter added in v0.6.21

func StageYamlToPipelineStageAdapter(stageConfig string, stageType repository2.PipelineStageType, triggerType pipelineConfig.TriggerType) (*bean.PipelineStageDto, error)

func ToTaskYaml added in v0.6.21

func ToTaskYaml(yamlFile []byte) (*types.TaskYaml, error)

Types

type AppArtifactManager added in v0.6.24

type AppArtifactManager interface {
	//RetrieveArtifactsByCDPipeline : RetrieveArtifactsByCDPipeline returns all the artifacts for the cd pipeline (pre / deploy / post)
	RetrieveArtifactsByCDPipeline(pipeline *pipelineConfig.Pipeline, stage bean.WorkflowType) (*bean2.CiArtifactResponse, error)

	RetrieveArtifactsByCDPipelineV2(pipeline *pipelineConfig.Pipeline, stage bean.WorkflowType, artifactListingFilterOpts *bean.ArtifactsListFilterOptions) (*bean2.CiArtifactResponse, error)

	//FetchArtifactForRollback :
	FetchArtifactForRollback(cdPipelineId, appId, offset, limit int, searchString string) (bean2.CiArtifactResponse, error)

	FetchArtifactForRollbackV2(cdPipelineId, appId, offset, limit int, searchString string, app *bean2.CreateAppDTO, deploymentPipeline *pipelineConfig.Pipeline) (bean2.CiArtifactResponse, error)

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

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

type AppArtifactManagerImpl added in v0.6.24

type AppArtifactManagerImpl struct {
	CiPipelineRepository pipelineConfig.CiPipelineRepository
	// contains filtered or unexported fields
}

func NewAppArtifactManagerImpl added in v0.6.24

func NewAppArtifactManagerImpl(
	logger *zap.SugaredLogger,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	userService user.UserService,
	imageTaggingService ImageTaggingService,
	ciArtifactRepository repository.CiArtifactRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	pipelineStageService PipelineStageService,
	cdPipelineConfigService CdPipelineConfigService,
	dockerArtifactRegistry dockerArtifactStoreRegistry.DockerArtifactStoreRepository,
	CiPipelineRepository pipelineConfig.CiPipelineRepository,
	ciTemplateService CiTemplateService) *AppArtifactManagerImpl

func (*AppArtifactManagerImpl) BuildArtifactsForCIParent added in v0.6.24

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

func (*AppArtifactManagerImpl) BuildArtifactsForCIParentV2 added in v0.6.26

func (impl *AppArtifactManagerImpl) BuildArtifactsForCIParentV2(listingFilterOpts *bean.ArtifactsListFilterOptions) ([]*bean2.CiArtifactBean, int, error)

func (*AppArtifactManagerImpl) BuildArtifactsForCdStage added in v0.6.24

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

func (*AppArtifactManagerImpl) BuildArtifactsForCdStageV2 added in v0.6.26

func (impl *AppArtifactManagerImpl) BuildArtifactsForCdStageV2(listingFilterOpts *bean.ArtifactsListFilterOptions) ([]*bean2.CiArtifactBean, int, error)

func (*AppArtifactManagerImpl) BuildArtifactsForParentStage added in v0.6.24

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

func (*AppArtifactManagerImpl) BuildArtifactsList added in v0.6.26

func (impl *AppArtifactManagerImpl) BuildArtifactsList(listingFilterOpts *bean.ArtifactsListFilterOptions) ([]*bean2.CiArtifactBean, int, string, int, error)

func (*AppArtifactManagerImpl) BuildRollbackArtifactsList added in v0.6.26

func (impl *AppArtifactManagerImpl) BuildRollbackArtifactsList(artifactListingFilterOpts bean.ArtifactsListFilterOptions) ([]bean2.CiArtifactBean, []int, int, error)

func (*AppArtifactManagerImpl) FetchArtifactForRollback added in v0.6.24

func (impl *AppArtifactManagerImpl) FetchArtifactForRollback(cdPipelineId, appId, offset, limit int, searchString string) (bean2.CiArtifactResponse, error)

func (*AppArtifactManagerImpl) FetchArtifactForRollbackV2 added in v0.6.26

func (impl *AppArtifactManagerImpl) FetchArtifactForRollbackV2(cdPipelineId, appId, offset, limit int, searchString string, app *bean2.CreateAppDTO, deploymentPipeline *pipelineConfig.Pipeline) (bean2.CiArtifactResponse, error)

func (*AppArtifactManagerImpl) RetrieveArtifactsByCDPipeline added in v0.6.24

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

func (*AppArtifactManagerImpl) RetrieveArtifactsByCDPipelineV2 added in v0.6.26

func (impl *AppArtifactManagerImpl) RetrieveArtifactsByCDPipelineV2(pipeline *pipelineConfig.Pipeline, stage bean.WorkflowType, artifactListingFilterOpts *bean.ArtifactsListFilterOptions) (*bean2.CiArtifactResponse, error)

type AppBean

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

type AppDeploymentTypeChangeManager added in v0.6.24

type AppDeploymentTypeChangeManager interface {
	//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
	ChangeDeploymentType(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
	//ChangePipelineDeploymentType : 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
	ChangePipelineDeploymentType(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
	//TriggerDeploymentAfterTypeChange :
	TriggerDeploymentAfterTypeChange(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
	//DeleteDeploymentApps : takes in a list of pipelines and delete the applications
	DeleteDeploymentApps(ctx context.Context, pipelines []*pipelineConfig.Pipeline, userId int32) *bean.DeploymentAppTypeChangeResponse
	//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.
	DeleteDeploymentAppsForEnvironment(ctx context.Context, environmentId int, currentDeploymentAppType bean3.DeploymentType, exclusionList []int, includeApps []int, userId int32) (*bean.DeploymentAppTypeChangeResponse, error)
}

type AppDeploymentTypeChangeManagerImpl added in v0.6.24

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

func NewAppDeploymentTypeChangeManagerImpl added in v0.6.24

func NewAppDeploymentTypeChangeManagerImpl(
	logger *zap.SugaredLogger,
	pipelineRepository pipelineConfig.PipelineRepository,
	appService app2.AppService,
	appStatusRepository appStatus.AppStatusRepository,
	helmAppService service.HelmAppService,
	application application2.ServiceClient,
	appArtifactManager AppArtifactManager,
	cdPipelineConfigService CdPipelineConfigService,
	gitOpsConfigReadService config.GitOpsConfigReadService,
	chartService chartService.ChartService,
	workflowEventPublishService out.WorkflowEventPublishService) *AppDeploymentTypeChangeManagerImpl

func (*AppDeploymentTypeChangeManagerImpl) ChangeDeploymentType added in v0.6.24

func (*AppDeploymentTypeChangeManagerImpl) ChangePipelineDeploymentType added in v0.6.24

func (*AppDeploymentTypeChangeManagerImpl) DeleteDeploymentApps added in v0.6.24

func (*AppDeploymentTypeChangeManagerImpl) DeleteDeploymentAppsForEnvironment added in v0.6.24

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

func (*AppDeploymentTypeChangeManagerImpl) FetchDeletedApp added in v0.6.24

func (*AppDeploymentTypeChangeManagerImpl) TriggerDeploymentAfterTypeChange added in v0.6.24

type BlobStorageConfigService added in v0.6.25

type BlobStorageConfigService interface {
	FetchCmAndSecretBlobConfigFromExternalCluster(clusterConfig *k8s.ClusterConfig, namespace string) (*bean2.CmBlobStorageConfig, *bean2.SecretBlobStorageConfig, error)
}

type BlobStorageConfigServiceImpl added in v0.6.25

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

func NewBlobStorageConfigServiceImpl added in v0.6.25

func NewBlobStorageConfigServiceImpl(Logger *zap.SugaredLogger, k8sUtil *k8s.K8sServiceImpl, ciCdConfig *types.CiCdConfig) *BlobStorageConfigServiceImpl

func (*BlobStorageConfigServiceImpl) FetchCmAndSecretBlobConfigFromExternalCluster added in v0.6.25

func (impl *BlobStorageConfigServiceImpl) FetchCmAndSecretBlobConfigFromExternalCluster(clusterConfig *k8s.ClusterConfig, namespace string) (*bean2.CmBlobStorageConfig, *bean2.SecretBlobStorageConfig, error)

type BuildPipelineSwitchService added in v0.6.26

type BuildPipelineSwitchService interface {
	SwitchToExternalCi(tx *pg.Tx, appWorkflowMapping *appWorkflow.AppWorkflowMapping, switchFromCiPipelineId int, userId int32) error
	SwitchToCiPipelineExceptExternal(request *bean.CiPatchRequest, ciConfig *bean.CiConfigRequest) (*bean.CiConfigRequest, error)
}

type BuildPipelineSwitchServiceImpl added in v0.6.26

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

func NewBuildPipelineSwitchServiceImpl added in v0.6.26

func NewBuildPipelineSwitchServiceImpl(logger *zap.SugaredLogger,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	pipelineRepository pipelineConfig.PipelineRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	ciPipelineHistoryService history.CiPipelineHistoryService,
	ciTemplateOverrideRepository pipelineConfig.CiTemplateOverrideRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository) *BuildPipelineSwitchServiceImpl

func (*BuildPipelineSwitchServiceImpl) DeleteCiMaterial added in v0.6.26

func (*BuildPipelineSwitchServiceImpl) SwitchToCiPipelineExceptExternal added in v0.6.26

func (impl *BuildPipelineSwitchServiceImpl) SwitchToCiPipelineExceptExternal(request *bean.CiPatchRequest, ciConfig *bean.CiConfigRequest) (*bean.CiConfigRequest, error)

func (*BuildPipelineSwitchServiceImpl) SwitchToExternalCi added in v0.6.26

func (impl *BuildPipelineSwitchServiceImpl) SwitchToExternalCi(tx *pg.Tx, appWorkflowMapping *appWorkflow.AppWorkflowMapping, switchFromCiPipelineId int, userId int32) 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) (types.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)
	FetchAppWorkflowStatusForTriggerViewForEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) ([]*pipelineConfig.CdWorkflowStatus, error)
	FetchAppDeploymentStatusForEnvironments(request resourceGroup2.ResourceGroupingRequest, token string) ([]*pipelineConfig.AppDeploymentStatus, error)
	DeactivateImageReservationPathsOnFailure(imagePathReservationIds []int) error
}

type CdHandlerImpl

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

func NewCdHandlerImpl

func NewCdHandlerImpl(Logger *zap.SugaredLogger, userService user.UserService,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository, ciLogService CiLogService,
	ciArtifactRepository repository.CiArtifactRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	pipelineRepository pipelineConfig.PipelineRepository, envRepository repository2.EnvironmentRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository, enforcerUtil rbac.EnforcerUtil,
	resourceGroupService resourceGroup2.ResourceGroupService,
	imageTaggingService ImageTaggingService, k8sUtil *k8s.K8sServiceImpl,
	workflowService WorkflowService, clusterService cluster.ClusterService,
	blobConfigStorageService BlobStorageConfigService, customTagService CustomTagService) *CdHandlerImpl

func (*CdHandlerImpl) CancelStage

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

func (*CdHandlerImpl) DeactivateImageReservationPathsOnFailure added in v0.6.26

func (impl *CdHandlerImpl) DeactivateImageReservationPathsOnFailure(imagePathReservationIds []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 resourceGroup2.ResourceGroupingRequest, token string) ([]*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 resourceGroup2.ResourceGroupingRequest, token string) ([]*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) (types.WorkflowResponse, error)

func (*CdHandlerImpl) GetCdBuildHistory

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

func (*CdHandlerImpl) GetRunningWorkflowLogs

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

func (*CdHandlerImpl) UpdateWorkflow

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

type CdPipelineConfigService added in v0.6.24

type CdPipelineConfigService interface {
	//GetCdPipelineById : Retrieve cdPipeline for given cdPipelineId.
	//getting cdPipeline,environment and strategies ,preDeployStage, postDeployStage,appWorkflowMapping from respective repository and service layer
	//converting above data in proper bean object and then assigning to CDPipelineConfigObject
	//if any error occur , will get empty object or nil
	GetCdPipelineById(pipelineId int) (cdPipeline *bean.CDPipelineConfigObject, err error)
	CreateCdPipelines(cdPipelines *bean.CdPipelines, ctx context.Context) (*bean.CdPipelines, error)
	//PatchCdPipelines : Handle CD pipeline patch requests, making necessary changes to the configuration and returning the updated version.
	//Performs Create ,Update and Delete operation.
	PatchCdPipelines(cdPipelines *bean.CDPatchRequest, ctx context.Context) (*bean.CdPipelines, error)
	DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, deleteAction int, acdDelete bool, userId int32) (*bean.AppDeleteResponseDTO, error)
	DeleteACDAppCdPipelineWithNonCascade(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, userId int32) (err error)
	//GetTriggerViewCdPipelinesForApp :
	GetTriggerViewCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err error)
	//GetCdPipelinesForApp : Retrieve cdPipeline for given appId
	GetCdPipelinesForApp(appId int) (cdPipelines *bean.CdPipelines, err error)
	//GetCdPipelinesForAppAndEnv : Retrieve cdPipeline for given appId and envId
	GetCdPipelinesForAppAndEnv(appId int, envId int) (cdPipelines *bean.CdPipelines, err error)
	/*	CreateCdPipelines(cdPipelines bean.CdPipelines) (*bean.CdPipelines, error)*/
	//GetCdPipelinesByEnvironment : lists cdPipeline for given environmentId and appIds
	GetCdPipelinesByEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) (cdPipelines *bean.CdPipelines, err error)
	//GetCdPipelinesByEnvironmentMin : lists minimum detail of cdPipelines for given environmentId and appIds
	GetCdPipelinesByEnvironmentMin(request resourceGroup2.ResourceGroupingRequest, token string) (cdPipelines []*bean.CDPipelineConfigObject, err error)
	//PerformBulkActionOnCdPipelines :
	PerformBulkActionOnCdPipelines(dto *bean.CdBulkActionRequestDto, impactedPipelines []*pipelineConfig.Pipeline, ctx context.Context, dryRun bool, userId int32) ([]*bean.CdBulkActionResponseDto, error)
	//FindPipelineById : Retrieve Pipeline object from pipelineRepository for given cdPipelineId
	FindPipelineById(cdPipelineId int) (*pipelineConfig.Pipeline, error)
	//FindAppAndEnvDetailsByPipelineId : Retrieve app and env details for given cdPipelineId
	FindAppAndEnvDetailsByPipelineId(cdPipelineId int) (*pipelineConfig.Pipeline, error)
	// RetrieveParentDetails : Retrieve the parent id and type of the parent.
	//Here ParentId refers to Parent like parent of CD can be CI , PRE-CD .
	// It first fetches the workflow details from the appWorkflow repository.
	//If the workflow is a CD pipeline, it further checks for stage configurations.
	//If the workflow is a webhook, it returns the webhook workflow type.
	//In case of error , it returns 0 for parentId and empty string for parentType
	RetrieveParentDetails(pipelineId int) (parentId int, parentType bean2.WorkflowType, err error)
	//GetEnvironmentByCdPipelineId : Retrieve environmentId for given cdPipelineId
	GetEnvironmentByCdPipelineId(pipelineId int) (int, error)
	GetBulkActionImpactedPipelines(dto *bean.CdBulkActionRequestDto) ([]*pipelineConfig.Pipeline, error) //no usage
	//IsGitOpsRequiredForCD : Determine if GitOps is required for CD based on the provided pipeline creation request
	IsGitOpsRequiredForCD(pipelineCreateRequest *bean.CdPipelines) bool
	//SetPipelineDeploymentAppType : Set pipeline deployment application(helm/argo) types based on the provided configuration
	SetPipelineDeploymentAppType(pipelineCreateRequest *bean.CdPipelines, isGitOpsConfigured bool, deploymentTypeValidationConfig map[string]bool)
	MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId int, envId int, acdToken string, pipeline *pipelineConfig.Pipeline) (bool, error)
	//GetEnvironmentListForAutocompleteFilter : lists environment for given configuration
	GetEnvironmentListForAutocompleteFilter(envName string, clusterIds []int, offset int, size int, token string, checkAuthBatch func(token string, appObject []string, envObject []string) (map[string]bool, map[string]bool), ctx context.Context) (*cluster.ResourceGroupingResponse, error)
	RegisterInACD(ctx context.Context, chartGitAttr *commonBean.ChartGitAttribute, userId int32) error
}

type CdPipelineConfigServiceImpl added in v0.6.24

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

func NewCdPipelineConfigServiceImpl added in v0.6.24

func NewCdPipelineConfigServiceImpl(logger *zap.SugaredLogger, pipelineRepository pipelineConfig.PipelineRepository,
	environmentRepository repository2.EnvironmentRepository, pipelineConfigRepository chartConfig.PipelineConfigRepository,
	appWorkflowRepository appWorkflow.AppWorkflowRepository, pipelineStageService PipelineStageService,
	appRepo app2.AppRepository, appService app.AppService, deploymentGroupRepository repository.DeploymentGroupRepository,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator, appStatusRepository appStatus.AppStatusRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository, prePostCdScriptHistoryService history.PrePostCdScriptHistoryService,
	clusterRepository repository2.ClusterRepository, helmAppService client.HelmAppService,
	enforcerUtil rbac.EnforcerUtil, pipelineStrategyHistoryService history.PipelineStrategyHistoryService,
	chartRepository chartRepoRepository.ChartRepository, resourceGroupService resourceGroup2.ResourceGroupService,
	propertiesConfigService PropertiesConfigService,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService,
	scopedVariableManager variables.ScopedVariableManager, deploymentConfig *DeploymentServiceTypeConfig,
	application application.ServiceClient, customTagService CustomTagService,
	pipelineConfigListenerService PipelineConfigListenerService, devtronAppCMCSService DevtronAppCMCSService,
	ciPipelineConfigService CiPipelineConfigService, buildPipelineSwitchService BuildPipelineSwitchService,
	argoClientWrapperService argocdServer.ArgoClientWrapperService,
	deployedAppMetricsService deployedAppMetrics.DeployedAppMetricsService,
	gitOpsConfigReadService config.GitOpsConfigReadService,
	gitOperationService git.GitOperationService,
	chartService chart.ChartService,
	imageDigestPolicyService imageDigestPolicy.ImageDigestPolicyService) *CdPipelineConfigServiceImpl

func (*CdPipelineConfigServiceImpl) BulkDeleteCdPipelines added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) CDPipelineCustomTagDBOperations added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) CDPipelineCustomTagDBOperations(pipeline *bean.CDPipelineConfigObject) error

func (*CdPipelineConfigServiceImpl) CreateCdPipelines added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) CreateCdPipelines(pipelineCreateRequest *bean.CdPipelines, ctx context.Context) (*bean.CdPipelines, error)

func (*CdPipelineConfigServiceImpl) DeleteACDAppCdPipelineWithNonCascade added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) DeleteACDAppCdPipelineWithNonCascade(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, userId int32) error

func (*CdPipelineConfigServiceImpl) DeleteCdPipeline added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, deleteAction int, deleteFromAcd bool, userId int32) (*bean.AppDeleteResponseDTO, error)

func (*CdPipelineConfigServiceImpl) DeleteCdPipelinePartial added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) DeleteCdPipelinePartial(pipeline *pipelineConfig.Pipeline, ctx context.Context, deleteAction int, userId int32) (*bean.AppDeleteResponseDTO, error)

func (*CdPipelineConfigServiceImpl) DeleteCustomTag added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) DeleteCustomTag(pipeline *bean.CDPipelineConfigObject) error

func (*CdPipelineConfigServiceImpl) DeleteCustomTagByPipelineStageType added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) DeleteCustomTagByPipelineStageType(pipelineStageType *repository5.PipelineStageType, pipelineId int) error

func (*CdPipelineConfigServiceImpl) DisableCustomTag added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) DisableCustomTag(pipeline *bean.CDPipelineConfigObject) error

func (*CdPipelineConfigServiceImpl) DisableCustomTagByPipelineStageType added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) DisableCustomTagByPipelineStageType(pipelineStageType *repository5.PipelineStageType, pipelineId int) error

func (*CdPipelineConfigServiceImpl) FindAppAndEnvDetailsByPipelineId added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) FindAppAndEnvDetailsByPipelineId(cdPipelineId int) (*pipelineConfig.Pipeline, error)

func (*CdPipelineConfigServiceImpl) FindPipelineById added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) GetBulkActionImpactedPipelines added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) GetCdPipelineById added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) GetCdPipelinesByEnvironment added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) GetCdPipelinesByEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) (cdPipelines *bean.CdPipelines, err error)

func (*CdPipelineConfigServiceImpl) GetCdPipelinesByEnvironmentMin added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) GetCdPipelinesByEnvironmentMin(request resourceGroup2.ResourceGroupingRequest, token string) (cdPipelines []*bean.CDPipelineConfigObject, err error)

func (*CdPipelineConfigServiceImpl) GetCdPipelinesForApp added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) GetCdPipelinesForAppAndEnv added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) GetEnvironmentByCdPipelineId added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) GetEnvironmentByCdPipelineId(pipelineId int) (int, error)

func (*CdPipelineConfigServiceImpl) GetEnvironmentListForAutocompleteFilter added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) GetTriggerViewCdPipelinesForApp added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) IsGitOpsRequiredForCD added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId int, envId int, acdToken string, pipeline *pipelineConfig.Pipeline) (bool, error)

func (*CdPipelineConfigServiceImpl) ParseCustomTagPatchRequest added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) ParseCustomTagPatchRequest(pipelineRequest *bean.CDPipelineConfigObject) (*bean2.CustomTag, error)

func (*CdPipelineConfigServiceImpl) PatchCdPipelines added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) PerformBulkActionOnCdPipelines added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) RegisterInACD added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) RegisterInACD(ctx context.Context, chartGitAttr *commonBean.ChartGitAttribute, userId int32) error

func (*CdPipelineConfigServiceImpl) RetrieveParentDetails added in v0.6.24

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

func (*CdPipelineConfigServiceImpl) SaveOrUpdateCustomTagForCDPipeline added in v0.6.26

func (impl *CdPipelineConfigServiceImpl) SaveOrUpdateCustomTagForCDPipeline(pipeline *bean.CDPipelineConfigObject) error

func (*CdPipelineConfigServiceImpl) SetPipelineDeploymentAppType added in v0.6.24

func (impl *CdPipelineConfigServiceImpl) SetPipelineDeploymentAppType(pipelineCreateRequest *bean.CdPipelines, isGitOpsConfigured bool, deploymentTypeValidationConfig map[string]bool)

func (*CdPipelineConfigServiceImpl) ValidateCDPipelineRequest added in v0.6.24

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

type CiArtifactWebhookRequest

type CiArtifactWebhookRequest struct {
	Image                         string                         `json:"image" validate:"required"`
	ImageDigest                   string                         `json:"imageDigest"`
	MaterialInfo                  json.RawMessage                `json:"materialInfo"`
	DataSource                    repository.ArtifactsSourceType `json:"dataSource" validate:"oneof=CI-RUNNER EXTERNAL pre_cd post_cd post_ci GOCD"`
	PipelineName                  string                         `json:"pipelineName"`
	WorkflowId                    *int                           `json:"workflowId"`
	UserId                        int32                          `json:"userId"`
	IsArtifactUploaded            bool                           `json:"isArtifactUploaded"`
	FailureReason                 string                         `json:"failureReason"`
	PluginRegistryArtifactDetails map[string][]string            `json:"PluginRegistryArtifactDetails"` //map of registry and array of images generated by Copy container image plugin
	PluginArtifactStage           string                         `json:"pluginArtifactStage"`           // at which stage of CI artifact was generated by plugin ("pre_ci/post_ci")
}

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) (pipeline *pipelineConfig.Pipeline, err error)
	DeleteCiPipeline(pipeline *pipelineConfig.CiPipeline, request *bean.CiPatchRequest, tx *pg.Tx) error
	DeleteCiPipelineAndCiEnvMappings(tx *pg.Tx, ciPipeline *pipelineConfig.CiPipeline, userId int32) error
	SaveHistoryOfBaseTemplate(userId int32, pipeline *pipelineConfig.CiPipeline, materials []*pipelineConfig.CiPipelineMaterial) error
	DeleteCdPipeline(pipelineId int, userId int32, tx *pg.Tx) error
	PatchMaterialValue(createRequest *bean.CiPipeline, userId int32, oldPipeline *pipelineConfig.CiPipeline) (*bean.CiPipeline, error)
	PatchCiMaterialSource(ciPipeline *bean.CiMaterialPatchRequest, userId int32) (*bean.CiMaterialPatchRequest, error)
	PatchCiMaterialSourceValue(patchRequest *bean.CiMaterialValuePatchRequest, userId int32, value string, token string, checkAppSpecificAccess func(token, action string, appId int) (bool, error)) (*pipelineConfig.CiPipelineMaterial, error)
	CreateCiTemplateBean(ciPipelineId int, dockerRegistryId string, dockerRepository string, gitMaterialId int, ciBuildConfig *pipelineConfigBean.CiBuildConfigBean, userId int32) pipelineConfigBean.CiTemplateBean
	UpdateCiPipelineMaterials(materialsUpdate []*pipelineConfig.CiPipelineMaterial) 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)
	AddPipelineToTemplate(createRequest *bean.CiConfigRequest, isSwitchCiPipelineRequest bool) (resp *bean.CiConfigRequest, err error)
}

type CiCdPipelineOrchestratorImpl added in v0.6.9

type CiCdPipelineOrchestratorImpl struct {
	GitSensorClient gitSensor.Client

	CiArtifactRepository repository.CiArtifactRepository
	// 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 *types.CiCdConfig,
	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,
	CiArtifactRepository repository.CiArtifactRepository,
	configMapService ConfigMapService,
	customTagService CustomTagService,
	genericNoteService genericNotes.GenericNoteService,
	chartService chart.ChartService) *CiCdPipelineOrchestratorImpl

func (CiCdPipelineOrchestratorImpl) AddPipelineMaterialInGitSensor added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) AddPipelineToTemplate added in v0.6.26

func (impl CiCdPipelineOrchestratorImpl) AddPipelineToTemplate(createRequest *bean.CiConfigRequest, isSwitchCiPipelineRequest bool) (resp *bean.CiConfigRequest, err 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) CreateCiTemplateBean added in v0.6.26

func (impl CiCdPipelineOrchestratorImpl) CreateCiTemplateBean(ciPipelineId int, dockerRegistryId string, dockerRepository string, gitMaterialId int, ciBuildConfig *pipelineConfigBean.CiBuildConfigBean, userId int32) pipelineConfigBean.CiTemplateBean

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

todo: extract common logic into separate func and use that here and in switchService

func (CiCdPipelineOrchestratorImpl) DeleteCiPipelineAndCiEnvMappings added in v0.6.26

func (impl CiCdPipelineOrchestratorImpl) DeleteCiPipelineAndCiEnvMappings(tx *pg.Tx, ciPipeline *pipelineConfig.CiPipeline, userId int32) 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) PatchCiMaterialSource added in v0.6.21

func (impl CiCdPipelineOrchestratorImpl) PatchCiMaterialSource(patchRequest *bean.CiMaterialPatchRequest, userId int32) (*bean.CiMaterialPatchRequest, error)

func (CiCdPipelineOrchestratorImpl) PatchCiMaterialSourceValue added in v0.6.24

func (impl CiCdPipelineOrchestratorImpl) PatchCiMaterialSourceValue(patchRequest *bean.CiMaterialValuePatchRequest, userId int32, value string, token string, checkAppSpecificAccess func(token, action string, appId int) (bool, error)) (*pipelineConfig.CiPipelineMaterial, 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) SaveHistoryOfBaseTemplate added in v0.6.26

func (impl CiCdPipelineOrchestratorImpl) SaveHistoryOfBaseTemplate(userId int32, pipeline *pipelineConfig.CiPipeline, materials []*pipelineConfig.CiPipelineMaterial) error

func (CiCdPipelineOrchestratorImpl) UpdateCDPipeline added in v0.6.9

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

func (CiCdPipelineOrchestratorImpl) UpdateCiPipelineMaterials added in v0.6.24

func (impl CiCdPipelineOrchestratorImpl) UpdateCiPipelineMaterials(materialsUpdate []*pipelineConfig.CiPipelineMaterial) error

func (CiCdPipelineOrchestratorImpl) UpdateMaterial added in v0.6.9

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

type CiHandler

type CiHandler interface {
	HandleCIWebhook(gitCiTriggerRequest bean.GitCiTriggerRequest) (int, error)
	HandleCIManual(ciTriggerRequest bean.CiTriggerRequest) (int, error)
	CheckAndReTriggerCI(workflowStatus v1alpha1.WorkflowStatus) 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) (types.WorkflowResponse, error)
	FetchArtifactsForCiJob(buildId int) (*types.ArtifactsForCiJob, error)
	//FetchBuildById(appId int, pipelineId int) (WorkflowResponse, error)
	CancelBuild(workflowId int, forceAbort bool) (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, appId int, offset int, size int) ([]types.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) (*types.GitTriggerInfoResponse, error)
	UpdateCiWorkflowStatusFailure(timeoutForFailureCiBuild int) error
	FetchCiStatusForTriggerViewForEnvironment(request resourceGroup.ResourceGroupingRequest, token string) ([]*pipelineConfig.CiWorkflowStatus, error)
}

type CiHandlerImpl

type CiHandlerImpl struct {
	Logger *zap.SugaredLogger

	K8sUtil *k8s.K8sServiceImpl
	// 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, ciArtifactRepository repository.CiArtifactRepository, userService user.UserService, eventClient client.EventClient, eventFactory client.EventFactory, ciPipelineRepository pipelineConfig.CiPipelineRepository,
	appListingRepository repository.AppListingRepository, K8sUtil *k8s.K8sServiceImpl, cdPipelineRepository pipelineConfig.PipelineRepository, enforcerUtil rbac.EnforcerUtil, resourceGroupService resourceGroup.ResourceGroupService, envRepository repository3.EnvironmentRepository,
	imageTaggingService ImageTaggingService, k8sCommonService k8s2.K8sCommonService, clusterService cluster.ClusterService, blobConfigStorageService BlobStorageConfigService, appWorkflowRepository appWorkflow.AppWorkflowRepository, customTagService CustomTagService,
	envService cluster.EnvironmentService) *CiHandlerImpl

func (*CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeBranchFix added in v0.2.22

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

func (*CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeWebhook added in v0.2.22

func (impl *CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeWebhook(ciPipelineMaterial bean.CiPipelineMaterial, pipeLineMaterialFromDb *pipelineConfig.CiPipelineMaterial) (pipelineConfig.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, forceAbort bool) (int, error)

func (*CiHandlerImpl) CheckAndReTriggerCI added in v0.6.24

func (impl *CiHandlerImpl) CheckAndReTriggerCI(workflowStatus v1alpha1.WorkflowStatus) error

func (*CiHandlerImpl) DownloadCiWorkflowArtifacts

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

func (*CiHandlerImpl) FetchArtifactsForCiJob added in v0.6.24

func (impl *CiHandlerImpl) FetchArtifactsForCiJob(buildId int) (*types.ArtifactsForCiJob, 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 resourceGroup.ResourceGroupingRequest, token string) ([]*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) (*types.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) (types.WorkflowResponse, error)

func (*CiHandlerImpl) GetBuildHistory

func (impl *CiHandlerImpl) GetBuildHistory(pipelineId int, appId int, offset int, size int) ([]types.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)

type CiLogService

type CiLogService interface {
	FetchRunningWorkflowLogs(ciLogRequest types.BuildLogRequest, clusterConfig *k8s.ClusterConfig, isExt bool) (io.ReadCloser, func() error, error)
	FetchLogs(baseLogLocationPathConfig string, ciLogRequest types.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, k8sUtil *k8s.K8sServiceImpl) (*CiLogServiceImpl, error)

func (*CiLogServiceImpl) FetchLogs

func (impl *CiLogServiceImpl) FetchLogs(baseLogLocationPathConfig string, logRequest types.BuildLogRequest) (*os.File, func() error, error)

func (*CiLogServiceImpl) FetchRunningWorkflowLogs

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

type CiMaterialConfigService added in v0.6.24

type CiMaterialConfigService interface {
	//CreateMaterialsForApp : Delegating the request to ciCdPipelineOrchestrator for Material creation
	CreateMaterialsForApp(request *bean.CreateMaterialDTO) (*bean.CreateMaterialDTO, error)
	//UpdateMaterialsForApp : Delegating the request to ciCdPipelineOrchestrator for updating Material
	UpdateMaterialsForApp(request *bean.UpdateMaterialDTO) (*bean.UpdateMaterialDTO, error)
	DeleteMaterial(request *bean.UpdateMaterialDTO) error
	//PatchCiMaterialSource : Delegating the request to ciCdPipelineOrchestrator for updating source
	PatchCiMaterialSource(ciPipeline *bean.CiMaterialPatchRequest, userId int32) (*bean.CiMaterialPatchRequest, error)
	//BulkPatchCiMaterialSource : Delegating the request to ciCdPipelineOrchestrator for bulk updating source
	BulkPatchCiMaterialSource(ciPipelines *bean.CiMaterialBulkPatchRequest, userId int32, token string, checkAppSpecificAccess func(token, action string, appId int) (bool, error)) (*bean.CiMaterialBulkPatchResponse, error)
	//GetMaterialsForAppId : Retrieve material for given appId
	GetMaterialsForAppId(appId int) []*bean.GitMaterial
}

type CiMaterialConfigServiceImpl added in v0.6.24

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

func NewCiMaterialConfigServiceImpl added in v0.6.24

func NewCiMaterialConfigServiceImpl(
	logger *zap.SugaredLogger,
	materialRepo pipelineConfig.MaterialRepository,
	ciTemplateService CiTemplateService,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	gitMaterialHistoryService history.GitMaterialHistoryService,
	pipelineRepository pipelineConfig.PipelineRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository) *CiMaterialConfigServiceImpl

func (*CiMaterialConfigServiceImpl) BulkPatchCiMaterialSource added in v0.6.24

func (impl *CiMaterialConfigServiceImpl) BulkPatchCiMaterialSource(ciPipelines *bean.CiMaterialBulkPatchRequest, userId int32, token string, checkAppSpecificAccess func(token, action string, appId int) (bool, error)) (*bean.CiMaterialBulkPatchResponse, error)

func (*CiMaterialConfigServiceImpl) CreateMaterialsForApp added in v0.6.24

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

func (*CiMaterialConfigServiceImpl) DeleteMaterial added in v0.6.24

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

func (*CiMaterialConfigServiceImpl) GetMaterialsForAppId added in v0.6.24

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

func (*CiMaterialConfigServiceImpl) PatchCiMaterialSource added in v0.6.24

func (impl *CiMaterialConfigServiceImpl) PatchCiMaterialSource(ciPipeline *bean.CiMaterialPatchRequest, userId int32) (*bean.CiMaterialPatchRequest, error)

func (*CiMaterialConfigServiceImpl) UpdateMaterialsForApp added in v0.6.24

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

type CiPipelineConfigService added in v0.6.24

type CiPipelineConfigService interface {
	//GetCiPipeline : retrieves CI pipeline configuration (CiConfigRequest) for a specific application (appId).
	// It fetches CI pipeline data, including pipeline materials, scripts, and associated configurations.
	// It returns a detailed CiConfigRequest.
	//If any errors occur during the retrieval process  CI pipeline configuration remains nil.
	//If you want less detail of ciPipeline ,Please refer GetCiPipelineMin
	GetCiPipeline(appId int) (ciConfig *bean.CiConfigRequest, err error)
	//GetCiPipelineById : Retrieve ciPipeline for given ciPipelineId
	GetCiPipelineById(pipelineId int) (ciPipeline *bean.CiPipeline, err error)
	//GetTriggerViewCiPipeline : retrieves a detailed view of the CI pipelines configured for a specific application (appId).
	// It includes information on CI pipeline materials, scripts, configurations, and linked pipelines.
	//If any errors occur ,It returns an error along with a nil result(bean.TriggerViewCiConfig).
	GetTriggerViewCiPipeline(appId int) (*bean.TriggerViewCiConfig, error)
	//GetExternalCi : Lists externalCi for given appId
	//"external CI" refers to CI pipelines and configurations that are managed externally,
	//like by third-party services or tools.
	//It fetches information about external CI pipelines, their webhooks, payload configurations, and related roles.
	//The function constructs an array of ExternalCiConfig objects and returns it.
	// If any errors occur, the function returns an error along with a nil result([]*bean.ExternalCiConfig).
	GetExternalCi(appId int) (ciConfig []*bean.ExternalCiConfig, err error)
	//GetExternalCiById : Retrieve externalCi for given appId and externalCiId.
	//It begins by validating the provided ID and fetching the corresponding CI pipeline from the repository.
	//If the CI pipeline is found, the function constructs an ExternalCiConfig object, encapsulating essential details and returns it.
	// If any errors occur, the function returns an error along with a nil result(*bean.ExternalCiConfig).
	GetExternalCiById(appId int, externalCiId int) (ciConfig *bean.ExternalCiConfig, err error)
	//UpdateCiTemplate : handles updates to the CiTemplate based on the provided CiConfigRequest.
	//It fetches relevant Docker registry information, and updates the CI configuration.
	//The function then creates or modifies associated resources such as Docker repositories.
	//After updating the configuration, it ensures to update history .
	//Finally, the function returns the modified CiConfigRequest.
	//If an error occurs, the CiConfigRequest is nil.
	//If you want to Update CiPipeline please refer PatchCiPipeline
	UpdateCiTemplate(updateRequest *bean.CiConfigRequest) (*bean.CiConfigRequest, error)
	//PatchCiPipeline :  function manages CI pipeline operations based on the provided CiPatchRequest.
	//It fetches template variables, sets specific attributes, and
	//handles following actions
	// 1. create
	//2. update source
	//3. delete pipelines
	PatchCiPipeline(request *bean.CiPatchRequest) (ciConfig *bean.CiConfigRequest, err error)

	CreateCiPipeline(createRequest *bean.CiConfigRequest) (*bean.PipelineCreateResponse, error)
	//GetCiPipelineMin : lists minimum detail of ciPipelines for given appId and envIds.
	//It filters and fetches CI pipelines based on the provided environment identifiers.
	//If no specific environments are provided, it retrieves all CI pipelines associated with the application.
	//If you want more details like buildConfig ,gitMaterials etc, please refer GetCiPipeline
	GetCiPipelineMin(appId int, envIds []int) ([]*bean.CiPipelineMin, error)
	//PatchRegexCiPipeline : Update CI pipeline materials based on the provided regex patch request
	PatchRegexCiPipeline(request *bean.CiRegexPatchRequest) (err error)
	//GetCiPipelineByEnvironment : lists ciPipeline for given environmentId and appIds
	GetCiPipelineByEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) ([]*bean.CiConfigRequest, error)
	//GetCiPipelineByEnvironmentMin : lists minimum detail of ciPipelines for given environmentId and appIds
	GetCiPipelineByEnvironmentMin(request resourceGroup2.ResourceGroupingRequest, token string) ([]*bean.CiPipelineMinResponse, error)
	//GetExternalCiByEnvironment : lists externalCi for given environmentId and appIds
	GetExternalCiByEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) (ciConfig []*bean.ExternalCiConfig, err error)
	DeleteCiPipeline(request *bean.CiPatchRequest) (*bean.CiPipeline, error)
	CreateExternalCiAndAppWorkflowMapping(appId, appWorkflowId int, userId int32, tx *pg.Tx) (int, *appWorkflow.AppWorkflowMapping, error)
}

type CiPipelineConfigServiceImpl added in v0.6.24

type CiPipelineConfigServiceImpl struct {
	CiTemplateHistoryService history.CiTemplateHistoryService
	// contains filtered or unexported fields
}

func NewCiPipelineConfigServiceImpl added in v0.6.24

func NewCiPipelineConfigServiceImpl(logger *zap.SugaredLogger,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	dockerArtifactStoreRepository dockerRegistryRepository.DockerArtifactStoreRepository,
	materialRepo pipelineConfig.MaterialRepository,
	pipelineGroupRepo app2.AppRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	ecrConfig *EcrConfig,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	ciConfig *types.CiCdConfig,
	attributesService attributes.AttributesService,
	pipelineStageService PipelineStageService,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	ciTemplateService CiTemplateService,
	ciTemplateOverrideRepository pipelineConfig.CiTemplateOverrideRepository,
	CiTemplateHistoryService history.CiTemplateHistoryService,
	enforcerUtil rbac.EnforcerUtil,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	resourceGroupService resourceGroup2.ResourceGroupService,
	customTagService CustomTagService,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	buildPipelineSwitchService BuildPipelineSwitchService,
) *CiPipelineConfigServiceImpl

func (*CiPipelineConfigServiceImpl) CreateCiPipeline added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) CreateExternalCiAndAppWorkflowMapping added in v0.6.26

func (impl *CiPipelineConfigServiceImpl) CreateExternalCiAndAppWorkflowMapping(appId, appWorkflowId int, userId int32, tx *pg.Tx) (int, *appWorkflow.AppWorkflowMapping, error)

func (*CiPipelineConfigServiceImpl) DeleteCiPipeline added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) GetCiPipeline added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) GetCiPipelineByEnvironment added in v0.6.24

func (impl *CiPipelineConfigServiceImpl) GetCiPipelineByEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) ([]*bean.CiConfigRequest, error)

func (*CiPipelineConfigServiceImpl) GetCiPipelineByEnvironmentMin added in v0.6.24

func (impl *CiPipelineConfigServiceImpl) GetCiPipelineByEnvironmentMin(request resourceGroup2.ResourceGroupingRequest, token string) ([]*bean.CiPipelineMinResponse, error)

func (*CiPipelineConfigServiceImpl) GetCiPipelineById added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) GetCiPipelineMin added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) GetExternalCi added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) GetExternalCiByEnvironment added in v0.6.24

func (impl *CiPipelineConfigServiceImpl) GetExternalCiByEnvironment(request resourceGroup2.ResourceGroupingRequest, token string) (ciConfig []*bean.ExternalCiConfig, err error)

func (*CiPipelineConfigServiceImpl) GetExternalCiById added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) GetTriggerViewCiPipeline added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) PatchCiPipeline added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) PatchRegexCiPipeline added in v0.6.24

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

func (*CiPipelineConfigServiceImpl) UpdateCiTemplate added in v0.6.24

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

type CiService

type CiService interface {
	TriggerCiPipeline(trigger types.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, 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, envRepository repository1.EnvironmentRepository, appRepository appRepository.AppRepository,
	scopedVariableManager variables.ScopedVariableManager,
	customTagService CustomTagService,
	pluginInputVariableParser PluginInputVariableParser,
	globalPluginService plugin.GlobalPluginService,
	infraProvider infraProviders.InfraProvider,
) *CiServiceImpl

func (*CiServiceImpl) BuildPayload

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

TODO: Send all trigger data

func (*CiServiceImpl) GetCiMaterials

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

func (*CiServiceImpl) GetWorkflowRequestVariablesForCopyContainerImagePlugin added in v0.6.26

func (impl *CiServiceImpl) GetWorkflowRequestVariablesForCopyContainerImagePlugin(preCiSteps []*pipelineConfigBean.StepObject, postCiSteps []*pipelineConfigBean.StepObject, customTag string, customTagId int, buildImagePath string, buildImagedockerRegistryId string) (map[string][]string, map[string]plugin.RegistryCredentials, string, []int, error)

func (*CiServiceImpl) ReserveImagesGeneratedAtPlugin added in v0.6.26

func (impl *CiServiceImpl) ReserveImagesGeneratedAtPlugin(customTagId int, registryImageMap map[string][]string) ([]int, error)

func (*CiServiceImpl) TriggerCiPipeline

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

func (*CiServiceImpl) WriteCITriggerEvent

func (impl *CiServiceImpl) WriteCITriggerEvent(trigger types.Trigger, pipeline *pipelineConfig.CiPipeline, workflowRequest *types.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)
	GetAppliedDockerConfigForCiPipeline(ciPipelineId, appId int, isOverridden bool) (*types.DockerArtifactStoreBean, error)
	GetBaseDockerConfigForCiPipeline(appId int) (*types.DockerArtifactStoreBean, 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) GetAppliedDockerConfigForCiPipeline added in v0.6.29

func (impl CiTemplateServiceImpl) GetAppliedDockerConfigForCiPipeline(ciPipelineId, appId int, isOverridden bool) (*types.DockerArtifactStoreBean, error)

func (CiTemplateServiceImpl) GetBaseDockerConfigForCiPipeline added in v0.6.29

func (impl CiTemplateServiceImpl) GetBaseDockerConfigForCiPipeline(appId int) (*types.DockerArtifactStoreBean, 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 ConfigMapSecretsResponse

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

type ConfigMapService

type ConfigMapService interface {
	CMGlobalAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.ConfigDataRequest, error)
	CMGlobalFetch(appId int) (*bean.ConfigDataRequest, error)
	CMEnvironmentAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.ConfigDataRequest, error)
	CMEnvironmentFetch(appId int, envId int) (*bean.ConfigDataRequest, error)
	CMGlobalFetchForEdit(name string, id int) (*bean.ConfigDataRequest, error)
	CMEnvironmentFetchForEdit(name string, id int, appId int, envId int) (*bean.ConfigDataRequest, error)

	CSGlobalAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.ConfigDataRequest, error)
	CSGlobalFetch(appId int) (*bean.ConfigDataRequest, error)
	CSEnvironmentAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.ConfigDataRequest, error)
	CSEnvironmentFetch(appId int, envId int) (*bean.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) (*bean.ConfigDataRequest, error)
	CSEnvironmentFetchForEdit(name string, id int, appId int, envId int) (*bean.ConfigDataRequest, error)
	ConfigSecretGlobalBulkPatch(bulkPatchRequest *bean.BulkPatchRequest) (*bean.BulkPatchRequest, error)
	ConfigSecretEnvironmentBulkPatch(bulkPatchRequest *bean.BulkPatchRequest) (*bean.BulkPatchRequest, error)

	ConfigSecretEnvironmentCreate(createJobEnvOverrideRequest *bean.CreateJobEnvOverridePayload) (*bean.CreateJobEnvOverridePayload, error)
	ConfigSecretEnvironmentDelete(createJobEnvOverrideRequest *bean.CreateJobEnvOverridePayload) (*bean.CreateJobEnvOverridePayload, error)
	ConfigSecretEnvironmentGet(appId int) ([]bean.JobEnvOverrideResponse, error)
	ConfigSecretEnvironmentClone(appId int, cloneAppId int, userId int32) ([]chartConfig.ConfigMapEnvModel, 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, environmentRepository repository2.EnvironmentRepository,
	scopedVariableManager variables.ScopedVariableCMCSManager,
) *ConfigMapServiceImpl

func (ConfigMapServiceImpl) CMEnvironmentAddUpdate

func (impl ConfigMapServiceImpl) CMEnvironmentAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.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) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) CMEnvironmentFetchForEdit added in v0.6.22

func (impl ConfigMapServiceImpl) CMEnvironmentFetchForEdit(name string, id int, appId int, envId int) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) CMGlobalAddUpdate

func (impl ConfigMapServiceImpl) CMGlobalAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.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) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) CMGlobalFetchForEdit added in v0.6.22

func (impl ConfigMapServiceImpl) CMGlobalFetchForEdit(name string, id int) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSEnvironmentAddUpdate

func (impl ConfigMapServiceImpl) CSEnvironmentAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.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) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSEnvironmentFetchForEdit

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

func (ConfigMapServiceImpl) CSGlobalAddUpdate

func (impl ConfigMapServiceImpl) CSGlobalAddUpdate(configMapRequest *bean.ConfigDataRequest) (*bean.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) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) CSGlobalFetchForEdit

func (impl ConfigMapServiceImpl) CSGlobalFetchForEdit(name string, id int) (*bean.ConfigDataRequest, error)

func (ConfigMapServiceImpl) ConfigSecretEnvironmentBulkPatch

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

func (ConfigMapServiceImpl) ConfigSecretEnvironmentClone added in v0.6.21

func (impl ConfigMapServiceImpl) ConfigSecretEnvironmentClone(appId int, cloneAppId int, userId int32) ([]chartConfig.ConfigMapEnvModel, error)

func (ConfigMapServiceImpl) ConfigSecretEnvironmentCreate added in v0.6.21

func (impl ConfigMapServiceImpl) ConfigSecretEnvironmentCreate(createJobEnvOverrideRequest *bean.CreateJobEnvOverridePayload) (*bean.CreateJobEnvOverridePayload, error)

func (ConfigMapServiceImpl) ConfigSecretEnvironmentDelete added in v0.6.21

func (impl ConfigMapServiceImpl) ConfigSecretEnvironmentDelete(createJobEnvOverrideRequest *bean.CreateJobEnvOverridePayload) (*bean.CreateJobEnvOverridePayload, error)

func (ConfigMapServiceImpl) ConfigSecretEnvironmentGet added in v0.6.21

func (impl ConfigMapServiceImpl) ConfigSecretEnvironmentGet(appId int) ([]bean.JobEnvOverrideResponse, error)

func (ConfigMapServiceImpl) ConfigSecretGlobalBulkPatch

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

type ConfigsList

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

type CustomTagService added in v0.6.25

type CustomTagService interface {
	CreateOrUpdateCustomTag(tag *bean.CustomTag) error
	GetCustomTagByEntityKeyAndValue(entityKey int, entityValue string) (*repository.CustomTag, error)
	GetActiveCustomTagByEntityKeyAndValue(entityKey int, entityValue string) (*repository.CustomTag, error)
	GenerateImagePath(entityKey int, entityValue string, dockerRegistryURL string, dockerRepo string) (*repository.ImagePathReservation, error)
	DeleteCustomTagIfExists(tag bean.CustomTag) error
	DeactivateImagePathReservation(id int) error
	GetCustomTag(entityKey int, entityValue string) (*repository.CustomTag, string, error)
	ReserveImagePath(imagePath string, customTagId int) (*repository.ImagePathReservation, error)
	DeactivateImagePathReservationByImagePath(imagePaths []string) error
	DeactivateImagePathReservationByImageIds(imagePathReservationIds []int) error
	DisableCustomTagIfExist(tag bean.CustomTag) error
}

type CustomTagServiceImpl added in v0.6.25

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

func NewCustomTagService added in v0.6.25

func NewCustomTagService(logger *zap.SugaredLogger, customTagRepo repository.ImageTagRepository) *CustomTagServiceImpl

func (*CustomTagServiceImpl) CreateOrUpdateCustomTag added in v0.6.25

func (impl *CustomTagServiceImpl) CreateOrUpdateCustomTag(tag *bean.CustomTag) error

func (*CustomTagServiceImpl) DeactivateImagePathReservation added in v0.6.25

func (impl *CustomTagServiceImpl) DeactivateImagePathReservation(id int) error

func (*CustomTagServiceImpl) DeactivateImagePathReservationByImageIds added in v0.6.26

func (impl *CustomTagServiceImpl) DeactivateImagePathReservationByImageIds(imagePathReservationIds []int) error

func (*CustomTagServiceImpl) DeactivateImagePathReservationByImagePath added in v0.6.26

func (impl *CustomTagServiceImpl) DeactivateImagePathReservationByImagePath(imagePaths []string) error

func (*CustomTagServiceImpl) DeleteCustomTagIfExists added in v0.6.25

func (impl *CustomTagServiceImpl) DeleteCustomTagIfExists(tag bean.CustomTag) error

func (*CustomTagServiceImpl) DisableCustomTagIfExist added in v0.6.26

func (impl *CustomTagServiceImpl) DisableCustomTagIfExist(tag bean.CustomTag) error

func (*CustomTagServiceImpl) GenerateImagePath added in v0.6.25

func (impl *CustomTagServiceImpl) GenerateImagePath(entityKey int, entityValue string, dockerRegistryURL string, dockerRepo string) (*repository.ImagePathReservation, error)

func (*CustomTagServiceImpl) GetActiveCustomTagByEntityKeyAndValue added in v0.6.25

func (impl *CustomTagServiceImpl) GetActiveCustomTagByEntityKeyAndValue(entityKey int, entityValue string) (*repository.CustomTag, error)

func (*CustomTagServiceImpl) GetCustomTag added in v0.6.26

func (impl *CustomTagServiceImpl) GetCustomTag(entityKey int, entityValue string) (*repository.CustomTag, string, error)

func (*CustomTagServiceImpl) GetCustomTagByEntityKeyAndValue added in v0.6.25

func (impl *CustomTagServiceImpl) GetCustomTagByEntityKeyAndValue(entityKey int, entityValue string) (*repository.CustomTag, error)

func (*CustomTagServiceImpl) ReserveImagePath added in v0.6.26

func (impl *CustomTagServiceImpl) ReserveImagePath(imagePath string, customTagId int) (*repository.ImagePathReservation, error)

type Deployment

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

type DeploymentConfigService added in v0.6.2

type DeploymentConfigService interface {
	GetLatestDeploymentConfigurationByPipelineId(ctx context.Context, 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,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository,
	configMapHistoryService history.ConfigMapHistoryService,
	scopedVariableManager variables.ScopedVariableCMCSManager,
	deployedAppMetricsService deployedAppMetrics.DeployedAppMetricsService,
	chartRefService chartRef.ChartRefService) *DeploymentConfigServiceImpl

func (*DeploymentConfigServiceImpl) GetLatestCMCSConfig added in v0.6.2

func (*DeploymentConfigServiceImpl) GetLatestDeploymentConfigurationByPipelineId added in v0.6.2

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

func (*DeploymentConfigServiceImpl) GetLatestDeploymentTemplateConfig added in v0.6.2

func (impl *DeploymentConfigServiceImpl) GetLatestDeploymentTemplateConfig(ctx context.Context, 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]*bean.ConfigData, error)

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 DevtronAppCMCSService added in v0.6.24

type DevtronAppCMCSService interface {
	//FetchConfigmapSecretsForCdStages : Delegating the request to appService for fetching cm/cs
	FetchConfigmapSecretsForCdStages(appId, envId, cdPipelineId int) (ConfigMapSecretsResponse, error)
	//GetDeploymentConfigMap : Retrieve deployment config values from the attributes table
	GetDeploymentConfigMap(environmentId int) (map[string]bool, error)
}

type DevtronAppCMCSServiceImpl added in v0.6.24

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

func NewDevtronAppCMCSServiceImpl added in v0.6.24

func NewDevtronAppCMCSServiceImpl(
	logger *zap.SugaredLogger,
	appService app.AppService,
	attributesRepository repository.AttributesRepository) *DevtronAppCMCSServiceImpl

func (*DevtronAppCMCSServiceImpl) FetchConfigmapSecretsForCdStages added in v0.6.24

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

func (*DevtronAppCMCSServiceImpl) GetDeploymentConfigMap added in v0.6.24

func (impl *DevtronAppCMCSServiceImpl) GetDeploymentConfigMap(environmentId int) (map[string]bool, error)

type DevtronAppConfigService added in v0.6.24

type DevtronAppConfigService interface {
	//CreateApp : This function creates applications of type Job as well as Devtronapps
	// In case of error response object is nil
	CreateApp(request *bean.CreateAppDTO) (*bean.CreateAppDTO, error)
	//DeleteApp : This function deletes applications of type Job as well as DevtronApps
	DeleteApp(appId int, userId int32) error
	//GetApp : Gets Application along with Git materials for given appId.
	//If the application type is a 'Chart Store App', it doesnt provide any detail.
	//For application types like Jobs and DevtronApps, it retrieves Git materials associated with the application.
	//In case of error response object is nil
	GetApp(appId int) (application *bean.CreateAppDTO, err error)
	//FindByIds : Find applications by given IDs, delegating the request to the appRepository.
	// It queries the repository for applications corresponding to the given IDs and constructs
	//a list of AppBean objects containing ID, name, and team ID.
	//It returns the list of AppBean instances.
	//In case of error,AppBean is returned as nil.
	FindByIds(ids []*int) ([]*AppBean, error)
	//GetAppList : Retrieve and return a list of applications after converting in proper bean object.
	//In case of any error , []AppBean is returned as nil.
	GetAppList() ([]AppBean, error)
	//FindAllMatchesByAppName : Find and return applications matching the given name and type.
	//Internally,It performs a case-insensitive search based on the applicationName("%"+appName+"%") and type.
	//In case of error,[]*AppBean is returned as nil.
	FindAllMatchesByAppName(appName string, appType helper.AppType) ([]*AppBean, error)
	//GetAppListForEnvironment : Retrieves a list of applications (AppBean) based on the provided ResourceGroupingRequest.
	// It first determines the relevant application and environment objects based on the active pipelines fetched from the repository.
	//The function then performs authorization checks on these objects for the given user.
	//Finally , the corresponding AppBean objects are added to the applicationList and then returned.
	//In case of error,[]*AppBean is returned as nil.
	GetAppListForEnvironment(request resourceGroup.ResourceGroupingRequest, token string) ([]*AppBean, error)
	//FindAppsByTeamId : Retrieves applications (AppBean) associated with the provided teamId
	//It queries the repository for applications belonging to the specified team(project) and
	//constructs a list of AppBean instances containing ID and name.
	//The function returns the list of applications in valid case.
	//In case of error,[]*AppBean is returned as nil.
	FindAppsByTeamId(teamId int) ([]*AppBean, error)
	//FindAppsByTeamName : Retrieves applications (AppBean) associated with the provided teamName
	// It queries the repository for applications belonging to the specified team(project) and
	// constructs a list of AppBean instances containing ID and name.
	// The function returns the list of applications in valid case.
	// In case of error,[]*AppBean is returned as nil.
	FindAppsByTeamName(teamName string) ([]AppBean, error)
}

type DevtronAppConfigServiceImpl added in v0.6.24

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

func NewDevtronAppConfigServiceImpl added in v0.6.24

func NewDevtronAppConfigServiceImpl(
	logger *zap.SugaredLogger,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	appRepo app.AppRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	resourceGroupService resourceGroup.ResourceGroupService,
	enforcerUtil rbac.EnforcerUtil,
	ciMaterialConfigService CiMaterialConfigService) *DevtronAppConfigServiceImpl

func (*DevtronAppConfigServiceImpl) CreateApp added in v0.6.24

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

func (*DevtronAppConfigServiceImpl) DeleteApp added in v0.6.24

func (impl *DevtronAppConfigServiceImpl) DeleteApp(appId int, userId int32) error

func (*DevtronAppConfigServiceImpl) FindAllMatchesByAppName added in v0.6.24

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

func (*DevtronAppConfigServiceImpl) FindAppsByTeamId added in v0.6.24

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

func (*DevtronAppConfigServiceImpl) FindAppsByTeamName added in v0.6.24

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

func (*DevtronAppConfigServiceImpl) FindByIds added in v0.6.24

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

func (*DevtronAppConfigServiceImpl) GetApp added in v0.6.24

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

func (*DevtronAppConfigServiceImpl) GetAppList added in v0.6.24

func (impl *DevtronAppConfigServiceImpl) GetAppList() ([]AppBean, error)

func (*DevtronAppConfigServiceImpl) GetAppListForEnvironment added in v0.6.24

func (impl *DevtronAppConfigServiceImpl) GetAppListForEnvironment(request resourceGroup.ResourceGroupingRequest, token string) ([]*AppBean, error)

type DevtronAppStrategyService added in v0.6.24

type DevtronAppStrategyService interface {
	//FetchCDPipelineStrategy : Retrieve CDPipelineStrategy for given appId
	FetchCDPipelineStrategy(appId int) (PipelineStrategiesResponse, error)

	// FetchDefaultCDPipelineStrategy :
	// TODO: uncomment this after code has been refactored as this function doesnt contain any logic to fetch strategy
	FetchDefaultCDPipelineStrategy(appId int, envId int) (PipelineStrategy, error)
}

type DevtronAppStrategyServiceImpl added in v0.6.24

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

func NewDevtronAppStrategyServiceImpl added in v0.6.24

func NewDevtronAppStrategyServiceImpl(
	logger *zap.SugaredLogger,
	chartRepository chartRepoRepository.ChartRepository,
	globalStrategyMetadataChartRefMappingRepository chartRepoRepository.GlobalStrategyMetadataChartRefMappingRepository,
	ciCdPipelineOrchestrator CiCdPipelineOrchestrator,
	cdPipelineConfigService CdPipelineConfigService) *DevtronAppStrategyServiceImpl

func (*DevtronAppStrategyServiceImpl) FetchCDPipelineStrategy added in v0.6.24

func (impl *DevtronAppStrategyServiceImpl) FetchCDPipelineStrategy(appId int) (PipelineStrategiesResponse, error)

func (*DevtronAppStrategyServiceImpl) FetchDefaultCDPipelineStrategy added in v0.6.24

func (impl *DevtronAppStrategyServiceImpl) FetchDefaultCDPipelineStrategy(appId int, envId int) (PipelineStrategy, error)

type DockerRegistryConfig

type DockerRegistryConfig interface {
	Create(bean *types.DockerArtifactStoreBean) (*types.DockerArtifactStoreBean, error)
	ListAllActive() ([]types.DockerArtifactStoreBean, error)
	FetchAllDockerAccounts() ([]types.DockerArtifactStoreBean, error)
	FetchOneDockerAccount(storeId string) (*types.DockerArtifactStoreBean, error)
	Update(bean *types.DockerArtifactStoreBean) (*types.DockerArtifactStoreBean, error)
	UpdateInactive(bean *types.DockerArtifactStoreBean) (*types.DockerArtifactStoreBean, error)
	Delete(storeId string) (string, error)
	DeleteReg(bean *types.DockerArtifactStoreBean) error
	CheckInActiveDockerAccount(storeId string) (bool, error)
	ValidateRegistryCredentials(bean *types.DockerArtifactStoreBean) bool
	ConfigureOCIRegistry(bean *types.DockerArtifactStoreBean, isUpdate bool, userId int32, tx *pg.Tx) error
	CreateOrUpdateOCIRegistryConfig(ociRegistryConfig *repository.OCIRegistryConfig, userId int32, tx *pg.Tx) error
	FilterOCIRegistryConfigForSpecificRepoType(ociRegistryConfigList []*repository.OCIRegistryConfig, repositoryType string) *repository.OCIRegistryConfig
	FilterRegistryBeanListBasedOnStorageTypeAndAction(bean []types.DockerArtifactStoreBean, storageType string, actionTypes ...string) []types.DockerArtifactStoreBean
	ValidateRegistryStorageType(registryId string, storageType string, storageActions ...string) bool
}

type DockerRegistryConfigImpl

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

func NewDockerRegistryConfigImpl

func NewDockerRegistryConfigImpl(logger *zap.SugaredLogger, helmAppService client.HelmAppService, dockerArtifactStoreRepository repository.DockerArtifactStoreRepository,
	dockerRegistryIpsConfigRepository repository.DockerRegistryIpsConfigRepository, ociRegistryConfigRepository repository.OCIRegistryConfigRepository) *DockerRegistryConfigImpl

func (DockerRegistryConfigImpl) CheckInActiveDockerAccount added in v0.6.15

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

func (DockerRegistryConfigImpl) ConfigureOCIRegistry added in v0.6.19

func (impl DockerRegistryConfigImpl) ConfigureOCIRegistry(bean *types.DockerArtifactStoreBean, isUpdate bool, userId int32, tx *pg.Tx) error

ConfigureOCIRegistry Takes DockerArtifactStoreBean, IsUpdate flag and the DB context. It finally creates/updates the OCI config in the DB. Returns Error if any.

func (DockerRegistryConfigImpl) Create

Create Takes the DockerArtifactStoreBean and creates the record in DB. Returns Error if any

func (DockerRegistryConfigImpl) CreateOrUpdateOCIRegistryConfig added in v0.6.19

func (impl DockerRegistryConfigImpl) CreateOrUpdateOCIRegistryConfig(ociRegistryConfig *repository.OCIRegistryConfig, userId int32, tx *pg.Tx) error

CreateOrUpdateOCIRegistryConfig Takes the OCIRegistryConfig to be saved/updated and the DB context. For update OCIRegistryConfig.Id should be the record id to be updated. Returns Error if any.

func (DockerRegistryConfigImpl) Delete

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

Delete is a Deprecated function. It was used to hard delete the registry from DB.

func (DockerRegistryConfigImpl) DeleteReg added in v0.3.15

DeleteReg Takes DockerArtifactStoreBean and soft deletes the OCI configs (if exists), finally soft deletes the registry. Returns Error if any.

func (DockerRegistryConfigImpl) FetchAllDockerAccounts

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

FetchAllDockerAccounts method used for getting all registry accounts with complete details

func (DockerRegistryConfigImpl) FetchOneDockerAccount

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

FetchOneDockerAccount this method takes the docker account id and Returns DockerArtifactStoreBean and Error (if any)

func (DockerRegistryConfigImpl) FilterOCIRegistryConfigForSpecificRepoType added in v0.6.19

func (impl DockerRegistryConfigImpl) FilterOCIRegistryConfigForSpecificRepoType(ociRegistryConfigList []*repository.OCIRegistryConfig, repositoryType string) *repository.OCIRegistryConfig

FilterOCIRegistryConfigForSpecificRepoType Takes the list of OCIRegistryConfigs and the RepositoryType to be filtered. Returns the first entry that matches the repositoryType.

func (DockerRegistryConfigImpl) FilterRegistryBeanListBasedOnStorageTypeAndAction added in v0.6.19

func (impl DockerRegistryConfigImpl) FilterRegistryBeanListBasedOnStorageTypeAndAction(bean []types.DockerArtifactStoreBean, storageType string, actionTypes ...string) []types.DockerArtifactStoreBean
FilterRegistriesBasedOnStorageTypeAndAction

Parameters:

  • List of DockerArtifactStoreBean,
  • storageType: it can be any from repository.OCI_REGISRTY_REPO_TYPE_LIST
  • list of actionTypes: it can be PULL, PUSH, PULL/PUSH

Returns:

  • List of DockerArtifactStoreBean
  • Error: if invalid storageType

func (DockerRegistryConfigImpl) ListAllActive

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

ListAllActive Returns the list all active artifact stores

func (DockerRegistryConfigImpl) PopulateOCIRegistryConfig added in v0.6.19

func (impl DockerRegistryConfigImpl) PopulateOCIRegistryConfig(store *repository.DockerArtifactStore, storeBean *types.DockerArtifactStoreBean) *types.DockerArtifactStoreBean

PopulateOCIRegistryConfig Takes the DB docker_artifact_store response and generates

func (DockerRegistryConfigImpl) Update

Update will update the existing registry with the given DockerArtifactStoreBean

func (DockerRegistryConfigImpl) UpdateInactive added in v0.6.15

UpdateInactive will update the existing soft deleted registry with the given DockerArtifactStoreBean instead of creating one

func (DockerRegistryConfigImpl) ValidateRegistryCredentials added in v0.6.23

func (impl DockerRegistryConfigImpl) ValidateRegistryCredentials(bean *types.DockerArtifactStoreBean) bool

func (DockerRegistryConfigImpl) ValidateRegistryStorageType added in v0.6.19

func (impl DockerRegistryConfigImpl) ValidateRegistryStorageType(registryId string, storageType string, storageActions ...string) bool
ValidateRegistryStorageType

Parameters:

  • registryId,
  • storageType: it can be any from repository.OCI_REGISRTY_REPO_TYPE_LIST
  • list of storageActions: it can be PULL, PUSH, PULL/PUSH

Logic:

  • Fetch registry config for the given registryId and validate if the storageType has any of the given storageActions

Returns:

  • isValid bool

type EcrConfig

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

func GetEcrConfig

func GetEcrConfig() (*EcrConfig, error)

type ExternalCiWebhookDto added in v0.6.29

type ExternalCiWebhookDto struct {
	CiProjectDetails              []bean.CiProjectDetails `json:"ciProjectDetails"`
	DockerImage                   string                  `json:"dockerImage" validate:"required,image-validator"`
	Digest                        string                  `json:"digest"`
	PipelineId                    int                     `json:"pipelineId"`
	WorkflowId                    *int                    `json:"workflowId"`
	TriggeredBy                   int32                   `json:"triggeredBy"`
	PipelineName                  string                  `json:"pipelineName"`
	DataSource                    string                  `json:"dataSource"`
	MaterialType                  string                  `json:"materialType"`
	Metrics                       util3.CIMetrics         `json:"metrics"`
	AppName                       string                  `json:"appName"`
	IsArtifactUploaded            bool                    `json:"isArtifactUploaded"`
	FailureReason                 string                  `json:"failureReason"`
	ImageDetailsFromCR            *ImageDetailsFromCR     `json:"imageDetailsFromCR"`
	PluginRegistryArtifactDetails map[string][]string     `json:"PluginRegistryArtifactDetails"`
	PluginArtifactStage           string                  `json:"pluginArtifactStage"`
}

this object's current object was previously used as CiCompleteEvent, duplicating it currently to remove unused fields here

type GitHostConfig added in v0.2.22

type GitHostConfig interface {
	GetAll() ([]types.GitHostRequest, error)
	GetById(id int) (*types.GitHostRequest, error)
	Create(request *types.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 *types.GitHostRequest) (int, error)

Create in DB

func (GitHostConfigImpl) GetAll added in v0.2.22

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

get all git hosts

func (GitHostConfigImpl) GetById added in v0.2.22

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

get git host by Id

type GitRegistryConfig

type GitRegistryConfig interface {
	Create(request *types.GitRegistry) (*types.GitRegistry, error)
	GetAll() ([]types.GitRegistry, error)
	FetchAllGitProviders() ([]types.GitRegistry, error)
	FetchOneGitProvider(id string) (*types.GitRegistry, error)
	Update(request *types.GitRegistry) (*types.GitRegistry, error)
	Delete(request *types.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 *types.GitRegistry) (*types.GitRegistry, error)

func (GitRegistryConfigImpl) Delete added in v0.3.15

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

func (GitRegistryConfigImpl) FetchAllGitProviders

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

func (GitRegistryConfigImpl) FetchOneGitProvider

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

func (GitRegistryConfigImpl) GetAll

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

get all active git providers

func (GitRegistryConfigImpl) Update

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

func (GitRegistryConfigImpl) UpdateGitSensor

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

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 ImageDetailsFromCR added in v0.6.29

type ImageDetailsFromCR struct {
	ImageDetails []types.ImageDetail `json:"imageDetails"`
	Region       string              `json:"region"`
}

type ImageTaggingService added in v0.6.19

type ImageTaggingService interface {
	// GetTagsData returns the following fields in reponse Object
	//ImageReleaseTags -> this will get the tags of the artifact,
	//AppReleaseTags -> all the tags of the given appId,
	//imageComment -> comment of the given artifactId,
	// ProdEnvExists -> implies the existence of prod environment in any workflow of given ciPipelineId or its child ciPipelineRequest's
	GetTagsData(ciPipelineId, appId, artifactId int, externalCi bool) (*types.ImageTaggingResponseDTO, error)
	CreateOrUpdateImageTagging(ciPipelineId, appId, artifactId, userId int, imageTaggingRequest *types.ImageTaggingRequestDTO) (*types.ImageTaggingResponseDTO, error)
	GetProdEnvFromParentAndLinkedWorkflow(ciPipelineId int) (bool, error)
	GetProdEnvByCdPipelineId(pipelineId int) (bool, error)
	// ValidateImageTaggingRequest validates the requested payload
	ValidateImageTaggingRequest(imageTaggingRequest *types.ImageTaggingRequestDTO, appId, artifactId int) (bool, error)
	GetTagsByArtifactId(artifactId int) ([]*repository.ImageTag, error)
	// GetTaggingDataMapByAppId this will fetch a map of artifact vs []tags for given appId
	GetTagsDataMapByAppId(appId int) (map[int][]*repository.ImageTag, error)
	// GetTaggingDataMapByAppId this will fetch a map of artifact vs imageComment for given artifactIds
	GetImageCommentsDataMapByArtifactIds(artifactIds []int) (map[int]*repository.ImageComment, error)
	// GetUniqueTagsByAppId gets all the unique tag names for the given appId
	GetUniqueTagsByAppId(appId int) ([]string, error)
	GetImageTaggingServiceConfig() ImageTaggingServiceConfig
	FindProdEnvExists(externalCi bool, pipelineIds []int) (bool, error)
}

type ImageTaggingServiceConfig added in v0.6.19

type ImageTaggingServiceConfig struct {
	HideImageTaggingHardDelete bool `env:"HIDE_IMAGE_TAGGING_HARD_DELETE" envDefault:"false"`
}

type ImageTaggingServiceImpl added in v0.6.19

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

func NewImageTaggingServiceImpl added in v0.6.19

func NewImageTaggingServiceImpl(imageTaggingRepo repository.ImageTaggingRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	cdPipelineRepository pipelineConfig.PipelineRepository,
	environmentRepository repository2.EnvironmentRepository,
	logger *zap.SugaredLogger) *ImageTaggingServiceImpl

func (ImageTaggingServiceImpl) CreateOrUpdateImageTagging added in v0.6.19

func (impl ImageTaggingServiceImpl) CreateOrUpdateImageTagging(ciPipelineId, appId, artifactId, userId int, imageTaggingRequest *types.ImageTaggingRequestDTO) (*types.ImageTaggingResponseDTO, error)

func (ImageTaggingServiceImpl) FindProdEnvExists added in v0.6.19

func (impl ImageTaggingServiceImpl) FindProdEnvExists(externalCi bool, pipelineIds []int) (bool, error)

func (ImageTaggingServiceImpl) GetImageCommentsDataMapByArtifactIds added in v0.6.19

func (impl ImageTaggingServiceImpl) GetImageCommentsDataMapByArtifactIds(artifactIds []int) (map[int]*repository.ImageComment, error)

func (ImageTaggingServiceImpl) GetImageTaggingServiceConfig added in v0.6.19

func (impl ImageTaggingServiceImpl) GetImageTaggingServiceConfig() ImageTaggingServiceConfig

func (ImageTaggingServiceImpl) GetProdEnvByCdPipelineId added in v0.6.19

func (impl ImageTaggingServiceImpl) GetProdEnvByCdPipelineId(pipelineId int) (bool, error)

func (ImageTaggingServiceImpl) GetProdEnvFromParentAndLinkedWorkflow added in v0.6.19

func (impl ImageTaggingServiceImpl) GetProdEnvFromParentAndLinkedWorkflow(ciPipelineId int) (bool, error)

func (ImageTaggingServiceImpl) GetTagsByArtifactId added in v0.6.19

func (impl ImageTaggingServiceImpl) GetTagsByArtifactId(artifactId int) ([]*repository.ImageTag, error)

func (ImageTaggingServiceImpl) GetTagsData added in v0.6.19

func (impl ImageTaggingServiceImpl) GetTagsData(ciPipelineId, appId, artifactId int, externalCi bool) (*types.ImageTaggingResponseDTO, error)

GetTagsData returns the following fields in reponse Object ImageReleaseTags -> this will get the tags of the artifact, AppReleaseTags -> all the tags of the given appId, imageComment -> comment of the given artifactId, ProdEnvExists -> implies the existence of prod environment in any workflow of given ciPipelineId or its child ciPipelineRequest's

func (ImageTaggingServiceImpl) GetTagsDataMapByAppId added in v0.6.19

func (impl ImageTaggingServiceImpl) GetTagsDataMapByAppId(appId int) (map[int][]*repository.ImageTag, error)

GetTaggingDataMapByAppId this will fetch a map of artifact vs []tags for given appId

func (ImageTaggingServiceImpl) GetUniqueTagsByAppId added in v0.6.19

func (impl ImageTaggingServiceImpl) GetUniqueTagsByAppId(appId int) ([]string, error)

func (ImageTaggingServiceImpl) ValidateImageTaggingRequest added in v0.6.19

func (impl ImageTaggingServiceImpl) ValidateImageTaggingRequest(imageTaggingRequest *types.ImageTaggingRequestDTO, appId, artifactId int) (bool, error)

type PipelineBuilderImpl

func NewPipelineBuilderImpl

func NewPipelineBuilderImpl(
	logger *zap.SugaredLogger,
	materialRepo pipelineConfig.MaterialRepository,
	chartRepository chartRepoRepository.ChartRepository,
	ciPipelineConfigService CiPipelineConfigService,
	ciMaterialConfigService CiMaterialConfigService,
	appArtifactManager AppArtifactManager,
	devtronAppCMCSService DevtronAppCMCSService,
	devtronAppStrategyService DevtronAppStrategyService,
	appDeploymentTypeChangeManager AppDeploymentTypeChangeManager,
	cdPipelineConfigService CdPipelineConfigService,
	devtronAppConfigService DevtronAppConfigService) *PipelineBuilderImpl

type PipelineConfigListener added in v0.6.26

type PipelineConfigListener interface {
	OnDeleteCdPipelineEvent(pipelineId int, triggeredBy int32)
}

type PipelineConfigListenerService added in v0.6.26

type PipelineConfigListenerService interface {
	RegisterPipelineDeleteListener(listener PipelineConfigListener)
	HandleCdPipelineDelete(pipelineId int, triggeredBy int32)
}

type PipelineConfigListenerServiceImpl added in v0.6.26

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

func NewPipelineConfigListenerServiceImpl added in v0.6.26

func NewPipelineConfigListenerServiceImpl(logger *zap.SugaredLogger) *PipelineConfigListenerServiceImpl

func (*PipelineConfigListenerServiceImpl) HandleCdPipelineDelete added in v0.6.26

func (impl *PipelineConfigListenerServiceImpl) HandleCdPipelineDelete(pipelineId int, triggeredBy int32)

func (*PipelineConfigListenerServiceImpl) RegisterPipelineDeleteListener added in v0.6.26

func (impl *PipelineConfigListenerServiceImpl) RegisterPipelineDeleteListener(listener PipelineConfigListener)

type PipelineStageService added in v0.4.2

type PipelineStageService interface {
	GetCiPipelineStageData(ciPipelineId int) (preCiStage *bean.PipelineStageDto, postCiStage *bean.PipelineStageDto, err error)
	CreatePipelineStage(stageReq *bean.PipelineStageDto, stageType repository.PipelineStageType, pipelineId int, userId int32) error
	UpdatePipelineStage(stageReq *bean.PipelineStageDto, stageType repository.PipelineStageType, pipelineId int, userId int32) error
	DeletePipelineStage(stageReq *bean.PipelineStageDto, userId int32, tx *pg.Tx) error
	BuildPrePostAndRefPluginStepsDataForWfRequest(pipelineId int, stageType string, scope resourceQualifiers.Scope) (*bean.PrePostAndRefPluginStepsResponse, error)
	GetCiPipelineStageDataDeepCopy(ciPipelineId int) (preCiStage *bean.PipelineStageDto, postCiStage *bean.PipelineStageDto, err error)
	GetCdPipelineStageDataDeepCopy(cdPipelineId int) (*bean.PipelineStageDto, *bean.PipelineStageDto, error)
	GetCdPipelineStageDataDeepCopyForPipelineIds(cdPipelineIds []int) (map[int][]*bean.PipelineStageDto, error)
	GetCdStageByCdPipelineIdAndStageType(cdPipelineId int, stageType repository.PipelineStageType) (*repository.PipelineStage, error)
	// DeletePipelineStageIfReq function is used to delete corrupted pipelineStage data
	// , there was a bug(https://github.com/devtron-labs/devtron/issues/3826) where we were not deleting pipeline stage entry even after deleting all the pipelineStageSteps
	// , this will delete those pipelineStage entry
	DeletePipelineStageIfReq(stageReq *bean.PipelineStageDto, userId int32) (error, bool)
}

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,
	pipelineRepository pipelineConfig.PipelineRepository,
	scopedVariableManager variables.ScopedVariableManager,

) *PipelineStageServiceImpl

func (*PipelineStageServiceImpl) BuildCiStageData added in v0.4.2

func (impl *PipelineStageServiceImpl) BuildCiStageData(ciStage *repository.PipelineStage) (*bean.PipelineStageDto, 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) BuildPipelineStageDataDeepCopy added in v0.6.21

func (impl *PipelineStageServiceImpl) BuildPipelineStageDataDeepCopy(pipelineStage *repository.PipelineStage) (*bean.PipelineStageDto, error)

func (*PipelineStageServiceImpl) BuildPipelineStageDataForWfRequest added in v0.6.21

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

func (*PipelineStageServiceImpl) BuildPipelineStepDataForWfRequest added in v0.6.21

func (impl *PipelineStageServiceImpl) BuildPipelineStepDataForWfRequest(step *repository.PipelineStageStep) (*bean.StepObject, 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(pipelineId int, stageType string, scope resourceQualifiers.Scope) (*bean.PrePostAndRefPluginStepsResponse, 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) CreateConditions added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateConditions(stepId int, conditions []*bean.ConditionDetailDto, inputVariablesRepo []repository.PipelineStageStepVariable, outputVariablesRepo []repository.PipelineStageStepVariable, userId int32, tx *pg.Tx) 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, tx *pg.Tx) (inputVariablesRepo []repository.PipelineStageStepVariable, outputVariablesRepo []repository.PipelineStageStepVariable, err error)

func (*PipelineStageServiceImpl) CreatePipelineStage added in v0.6.21

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

CreatePipelineStage and related methods starts

func (*PipelineStageServiceImpl) CreateScriptAndMappingForInlineStep added in v0.4.2

func (impl *PipelineStageServiceImpl) CreateScriptAndMappingForInlineStep(inlineStepDetail *bean.InlineStepDetailDto, userId int32, tx *pg.Tx) (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, tx *pg.Tx) 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) DeletePipelineStage added in v0.6.21

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

DeletePipelineStage and related methods starts

func (*PipelineStageServiceImpl) DeletePipelineStageIfReq added in v0.6.23

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

DeletePipelineStageIfReq function is used to delete corrupted pipelineStage data , there was a bug (https://github.com/devtron-labs/devtron/issues/3826) where we were not deleting pipeline stage entry even after deleting all the pipelineStageSteps , this will delete those pipelineStage entry

func (*PipelineStageServiceImpl) FilterAndActOnStepsInPipelineStageUpdateRequest added in v0.6.21

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

func (*PipelineStageServiceImpl) GetCdPipelineStageDataDeepCopy added in v0.6.21

func (impl *PipelineStageServiceImpl) GetCdPipelineStageDataDeepCopy(cdPipelineId int) (*bean.PipelineStageDto, *bean.PipelineStageDto, error)

func (*PipelineStageServiceImpl) GetCdPipelineStageDataDeepCopyForPipelineIds added in v0.6.21

func (impl *PipelineStageServiceImpl) GetCdPipelineStageDataDeepCopyForPipelineIds(cdPipelineIds []int) (map[int][]*bean.PipelineStageDto, error)

func (*PipelineStageServiceImpl) GetCdStageByCdPipelineIdAndStageType added in v0.6.24

func (impl *PipelineStageServiceImpl) GetCdStageByCdPipelineIdAndStageType(cdPipelineId int, stageType repository.PipelineStageType) (*repository.PipelineStage, 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) 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) UpdatePipelineStage added in v0.6.21

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

UpdatePipelineStage and related methods starts

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 PluginInputVariableParser added in v0.6.26

type PluginInputVariableParser interface {
	HandleCopyContainerImagePluginInputVariables(inputVariables []*bean.VariableObject, dockerImageTag string, pluginTriggerImage string, sourceImageDockerRegistry string) (registryDestinationImageMap map[string][]string, registryCredentials map[string]plugin.RegistryCredentials, err error)
}

type PluginInputVariableParserImpl added in v0.6.26

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

func NewPluginInputVariableParserImpl added in v0.6.26

func NewPluginInputVariableParserImpl(
	logger *zap.SugaredLogger,
	dockerRegistryConfig DockerRegistryConfig,
	customTagService CustomTagService,
) *PluginInputVariableParserImpl

func (*PluginInputVariableParserImpl) HandleCopyContainerImagePluginInputVariables added in v0.6.26

func (impl *PluginInputVariableParserImpl) HandleCopyContainerImagePluginInputVariables(inputVariables []*bean.VariableObject,
	dockerImageTag string,
	pluginTriggerImage string,
	sourceImageDockerRegistry string) (registryDestinationImageMap map[string][]string, registryCredentials map[string]plugin.RegistryCredentials, err error)

type PropertiesConfigService

type PropertiesConfigService interface {
	CreateEnvironmentProperties(appId int, propertiesRequest *bean.EnvironmentProperties) (*bean.EnvironmentProperties, error)
	UpdateEnvironmentProperties(appId int, propertiesRequest *bean.EnvironmentProperties, userId int32) (*bean.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, bool, error)
	GetEnvironmentProperties(appId, environmentId int, chartRefId int) (environmentPropertiesResponse *bean.EnvironmentPropertiesResponse, err error)
	GetEnvironmentPropertiesById(environmentId int) ([]bean.EnvironmentProperties, error)

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

	FetchEnvProperties(appId, envId, chartRefId int) (*chartConfig.EnvConfigOverride, error)
}

type PropertiesConfigServiceImpl

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

func NewPropertiesConfigServiceImpl

func NewPropertiesConfigServiceImpl(logger *zap.SugaredLogger,
	envConfigRepo chartConfig.EnvConfigOverrideRepository,
	chartRepo chartRepoRepository.ChartRepository,
	environmentRepository repository2.EnvironmentRepository,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService,
	scopedVariableManager variables.ScopedVariableManager,
	deployedAppMetricsService deployedAppMetrics.DeployedAppMetricsService) *PropertiesConfigServiceImpl

func (PropertiesConfigServiceImpl) CreateEnvironmentProperties

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

func (PropertiesConfigServiceImpl) CreateEnvironmentPropertiesWithNamespace

func (impl PropertiesConfigServiceImpl) CreateEnvironmentPropertiesWithNamespace(appId int, environmentProperties *bean.EnvironmentProperties) (*bean.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, bool, error)

func (PropertiesConfigServiceImpl) FetchEnvProperties added in v0.6.21

func (impl PropertiesConfigServiceImpl) FetchEnvProperties(appId, envId, chartRefId int) (*chartConfig.EnvConfigOverride, error)

func (PropertiesConfigServiceImpl) GetAppIdByChartEnvId

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

func (PropertiesConfigServiceImpl) GetEnvironmentProperties

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

func (PropertiesConfigServiceImpl) GetEnvironmentPropertiesById

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

func (PropertiesConfigServiceImpl) GetLatestEnvironmentProperties

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

func (PropertiesConfigServiceImpl) ResetEnvironmentProperties

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

func (PropertiesConfigServiceImpl) UpdateEnvironmentProperties

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

type RefPluginName added in v0.6.26

type RefPluginName = string
const (
	COPY_CONTAINER_IMAGE RefPluginName = "Copy container image"
	EMPTY_STRING                       = " "
)

type SecurityConfig added in v0.6.18

type SecurityConfig struct {
	//FORCE_SECURITY_SCANNING flag is being maintained in both dashboard and orchestrator CM's
	//TODO: rishabh will remove FORCE_SECURITY_SCANNING from dashboard's CM.
	ForceSecurityScanning bool `env:"FORCE_SECURITY_SCANNING" envDefault:"false"`
}

type SwitchBuildPipelineValidationError added in v0.6.26

type SwitchBuildPipelineValidationError string

type TeamAppBean

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

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)
	HandleMultipleImagesFromEvent(imageDetails []types.ImageDetail, ciWorkflowId int) (map[string]*pipelineConfig.CiWorkflow, error)
	GetTriggerValidateFuncs() []pubsub.ValidateMsg
}

type WebhookServiceImpl

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

func NewWebhookServiceImpl

func NewWebhookServiceImpl(ciArtifactRepository repository.CiArtifactRepository,
	logger *zap.SugaredLogger, ciPipelineRepository pipelineConfig.CiPipelineRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	cdWorkflowCommonService cd.CdWorkflowCommonService) *WebhookServiceImpl

func (WebhookServiceImpl) AuthenticateExternalCiWebhook

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

func (*WebhookServiceImpl) GetTriggerValidateFuncs added in v0.6.28

func (impl *WebhookServiceImpl) GetTriggerValidateFuncs() []pubsub.ValidateMsg

func (*WebhookServiceImpl) HandleMultipleImagesFromEvent added in v0.6.24

func (impl *WebhookServiceImpl) HandleMultipleImagesFromEvent(imageDetails []types.ImageDetail, ciWorkflowId int) (map[string]*pipelineConfig.CiWorkflow, error)

HandleMultipleImagesFromEvent handles multiple images from plugin and creates ci workflow for n-1 images for mapping in ci_artifact

type WorkflowService

type WorkflowService interface {
	SubmitWorkflow(workflowRequest *types.WorkflowRequest) (*unstructured.UnstructuredList, error)
	// DeleteWorkflow(wfName string, namespace string) error
	GetWorkflow(executorType pipelineConfig.WorkflowExecutorType, name string, namespace string, restConfig *rest.Config) (*unstructured.UnstructuredList, error)
	GetWorkflowStatus(executorType pipelineConfig.WorkflowExecutorType, name string, namespace string, restConfig *rest.Config) (*types.WorkflowStatus, error)
	// ListAllWorkflows(namespace string) (*v1alpha1.WorkflowList, error)
	// UpdateWorkflow(wf *v1alpha1.Workflow) (*v1alpha1.Workflow, error)
	TerminateWorkflow(executorType pipelineConfig.WorkflowExecutorType, name string, namespace string, restConfig *rest.Config, isExt bool, environment *repository.Environment) error
}

type WorkflowServiceImpl

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

func NewWorkflowServiceImpl

func NewWorkflowServiceImpl(Logger *zap.SugaredLogger, envRepository repository.EnvironmentRepository, ciCdConfig *types.CiCdConfig,
	appService app.AppService, globalCMCSService GlobalCMCSService, argoWorkflowExecutor executors.ArgoWorkflowExecutor,
	k8sUtil *k8s.K8sServiceImpl,
	systemWorkflowExecutor executors.SystemWorkflowExecutor, k8sCommonService k8s2.K8sCommonService,
	infraProvider infraProviders.InfraProvider) (*WorkflowServiceImpl, error)

func (*WorkflowServiceImpl) GetWorkflow

func (impl *WorkflowServiceImpl) GetWorkflow(executorType pipelineConfig.WorkflowExecutorType, name string, namespace string, restConfig *rest.Config) (*unstructured.UnstructuredList, error)

func (*WorkflowServiceImpl) GetWorkflowStatus added in v0.6.26

func (impl *WorkflowServiceImpl) GetWorkflowStatus(executorType pipelineConfig.WorkflowExecutorType, name string, namespace string, restConfig *rest.Config) (*types.WorkflowStatus, error)

func (*WorkflowServiceImpl) SubmitWorkflow

func (impl *WorkflowServiceImpl) SubmitWorkflow(workflowRequest *types.WorkflowRequest) (*unstructured.UnstructuredList, error)

func (*WorkflowServiceImpl) TerminateWorkflow

func (impl *WorkflowServiceImpl) TerminateWorkflow(executorType pipelineConfig.WorkflowExecutorType, name string, namespace string, restConfig *rest.Config, isExt bool, environment *repository.Environment) error

Directories

Path Synopsis
Package mock_pipeline is a generated GoMock package.
Package mock_pipeline is a generated GoMock package.

Jump to

Keyboard shortcuts

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