pipeline

package
v0.0.0-...-987a61a Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 90 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesSecret  string = "KubernetesSecret"
	AWSSecretsManager string = "AWSSecretsManager"
	AWSSystemManager  string = "AWSSystemManager"
	HashiCorpVault    string = "HashiCorpVault"
)
View Source
const AFTER_DOCKER_BUILD string = "AFTER_DOCKER_BUILD"
View Source
const BEFORE_DOCKER_BUILD string = "BEFORE_DOCKER_BUILD"
View Source
const BLOB_STORAGE_AZURE = "AZURE"
View Source
const BLOB_STORAGE_GCP = "GCP"
View Source
const BLOB_STORAGE_MINIO = "MINIO"
View Source
const BLOB_STORAGE_S3 = "S3"
View Source
const CD_WORKFLOW_NAME = "cd"
View Source
const DegradeTime time.Duration = 10
View Source
const DevMode = "DEV"
View Source
const ExternalCiWebhookPath = "orchestrator/webhook/ext-ci"
View Source
const POST = "POST"
View Source
const PRE = "PRE"
View Source
const ProdMode = "PROD"
View Source
const WorkflowAborted = "Aborted"
View Source
const WorkflowCancel = "CANCELLED"
View Source
const WorkflowFailed = "Failed"
View Source
const WorkflowStarting = "Starting"

Variables

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

Functions

func ModifySshPrivateKey

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 SetGitCommitValuesForBuildingCommitHash

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

Types

type AppBean

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

type AzureBlob

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

func (*AzureBlob) DownloadBlob

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

func (*AzureBlob) UploadBlob

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

type AzureBlobConfig

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

type BlueGreen

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

type BulkPatchFilter

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

type BulkPatchPayload

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

type BulkPatchRequest

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

type BulkTriggerRequest

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

type BulkUpdatePayload

type BulkUpdatePayload struct {
	Includes           *NameIncludesExcludes   `json:"includes"`
	Excludes           *NameIncludesExcludes   `json:"excludes"`
	EnvIds             []int                   `json:"envIds"`
	Global             bool                    `json:"global"`
	DeploymentTemplate *DeploymentTemplateTask `json:"deploymentTemplate"`
	ConfigMap          *CmAndSecretTask        `json:"configMap"`
	Secret             *CmAndSecretTask        `json:"secret"`
}

type BulkUpdateResponse

type BulkUpdateResponse struct {
	DeploymentTemplate *DeploymentTemplateBulkUpdateResponse `json:"deploymentTemplate"`
	ConfigMap          *CmAndSecretBulkUpdateResponse        `json:"configMap"`
	Secret             *CmAndSecretBulkUpdateResponse        `json:"secret"`
}

type BulkUpdateScript

type BulkUpdateScript struct {
	ApiVersion string             `json:"apiVersion" validate:"required"`
	Kind       string             `json:"kind" validate:"required"`
	Spec       *BulkUpdatePayload `json:"spec" validate:"required"`
}

type BulkUpdateSeeExampleResponse

type BulkUpdateSeeExampleResponse struct {
	Operation string            `json:"operation"`
	Script    *BulkUpdateScript `json:"script" validate:"required"`
	ReadMe    string            `json:"readme"`
}

type BulkUpdateService

type BulkUpdateService interface {
	FindBulkUpdateReadme(operation string) (response *BulkUpdateSeeExampleResponse, err error)
	GetBulkAppName(bulkUpdateRequest *BulkUpdatePayload) (*ImpactedObjectsResponse, error)
	ApplyJsonPatch(patch jsonpatch.Patch, target string) (string, error)
	BulkUpdateDeploymentTemplate(bulkUpdatePayload *BulkUpdatePayload) *DeploymentTemplateBulkUpdateResponse
	BulkUpdateConfigMap(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse
	BulkUpdateSecret(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse
	BulkUpdate(bulkUpdateRequest *BulkUpdatePayload) (bulkUpdateResponse *BulkUpdateResponse)
}

type BulkUpdateServiceImpl

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

func NewBulkUpdateServiceImpl

func NewBulkUpdateServiceImpl(bulkUpdateRepository bulkUpdate.BulkUpdateRepository,
	chartRepository chartRepoRepository.ChartRepository,
	logger *zap.SugaredLogger,
	chartTemplateService util.ChartTemplateService,
	repoRepository chartRepoRepository.ChartRepoRepository,
	defaultChart chart.DefaultChart,
	mergeUtil util.MergeUtil,
	repositoryService repository.ServiceClient,
	chartRefRepository chartRepoRepository.ChartRefRepository,
	envOverrideRepository chartConfig.EnvConfigOverrideRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository,
	environmentRepository repository2.EnvironmentRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	appLevelMetricsRepository repository3.AppLevelMetricsRepository,
	envLevelAppMetricsRepository repository3.EnvLevelAppMetricsRepository,
	client *http.Client,
	appRepository app.AppRepository,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService,
	configMapHistoryService history.ConfigMapHistoryService) *BulkUpdateServiceImpl

func (BulkUpdateServiceImpl) ApplyJsonPatch

func (impl BulkUpdateServiceImpl) ApplyJsonPatch(patch jsonpatch.Patch, target string) (string, error)

func (BulkUpdateServiceImpl) BulkUpdate

func (impl BulkUpdateServiceImpl) BulkUpdate(bulkUpdatePayload *BulkUpdatePayload) *BulkUpdateResponse

func (BulkUpdateServiceImpl) BulkUpdateConfigMap

func (impl BulkUpdateServiceImpl) BulkUpdateConfigMap(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse

func (BulkUpdateServiceImpl) BulkUpdateDeploymentTemplate

func (impl BulkUpdateServiceImpl) BulkUpdateDeploymentTemplate(bulkUpdatePayload *BulkUpdatePayload) *DeploymentTemplateBulkUpdateResponse

func (BulkUpdateServiceImpl) BulkUpdateSecret

func (impl BulkUpdateServiceImpl) BulkUpdateSecret(bulkUpdatePayload *BulkUpdatePayload) *CmAndSecretBulkUpdateResponse

func (BulkUpdateServiceImpl) FindBulkUpdateReadme

func (impl BulkUpdateServiceImpl) FindBulkUpdateReadme(operation string) (*BulkUpdateSeeExampleResponse, error)

func (BulkUpdateServiceImpl) GetBulkAppName

func (impl BulkUpdateServiceImpl) GetBulkAppName(bulkUpdatePayload *BulkUpdatePayload) (*ImpactedObjectsResponse, error)

type Canary

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

type CanaryStep

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

type CdConfig

type CdConfig struct {
	Mode                       string   `env:"MODE" envDefault:"DEV"`
	LimitCpu                   string   `env:"CD_LIMIT_CI_CPU" envDefault:"0.5"`
	LimitMem                   string   `env:"CD_LIMIT_CI_MEM" envDefault:"3G"`
	ReqCpu                     string   `env:"CD_REQ_CI_CPU" envDefault:"0.5"`
	ReqMem                     string   `env:"CD_REQ_CI_MEM" envDefault:"3G"`
	TaintKey                   string   `env:"CD_NODE_TAINTS_KEY" envDefault:"dedicated"`
	WorkflowServiceAccount     string   `env:"CD_WORKFLOW_SERVICE_ACCOUNT" envDefault:"cd-runner"`
	DefaultBuildLogsKeyPrefix  string   `env:"DEFAULT_BUILD_LOGS_KEY_PREFIX" `
	DefaultArtifactKeyPrefix   string   `env:"DEFAULT_CD_ARTIFACT_KEY_LOCATION" `
	TaintValue                 string   `env:"CD_NODE_TAINTS_VALUE" envDefault:"ci"`
	DefaultBuildLogsBucket     string   `env:"DEFAULT_BUILD_LOGS_BUCKET" `
	NodeLabelSelector          []string `env:"CD_NODE_LABEL_SELECTOR"`
	CdArtifactLocationFormat   string   `env:"CD_ARTIFACT_LOCATION_FORMAT" envDefault:"%d/%d.zip"`
	DefaultNamespace           string   `env:"DEFAULT_CD_NAMESPACE"`
	DefaultImage               string   `env:"DEFAULT_CI_IMAGE" `
	DefaultTimeout             int64    `env:"DEFAULT_CD_TIMEOUT" envDefault:"3600"`
	DefaultCdLogsBucketRegion  string   `env:"DEFAULT_CD_LOGS_BUCKET_REGION" `
	WfControllerInstanceID     string   `env:"WF_CONTROLLER_INSTANCE_ID" envDefault:"template-cron-job-runner"`
	OrchestratorHost           string   `env:"ORCH_HOST" envDefault:"http://devtroncd-orchestrator-service-prod.devtroncd/webhook/msg/nats"`
	OrchestratorToken          string   `env:"ORCH_TOKEN" envDefault:""`
	ClusterConfig              *rest.Config
	NodeLabel                  map[string]string
	CloudProvider              string `env:"BLOB_STORAGE_PROVIDER" envDefault:"S3"`
	AzureAccountName           string `env:"AZURE_ACCOUNT_NAME"`
	AzureBlobContainerCiLog    string `env:"AZURE_BLOB_CONTAINER_CI_LOG"`
	AzureBlobContainerCiCache  string `env:"AZURE_BLOB_CONTAINER_CI_CACHE"`
	MinioEndpoint              string `env:"MINIO_ENDPOINT"`
	MinioAccessKey             string `env:"MINIO_ACCESS_KEY"`
	MinioSecretKey             string `env:"MINIO_SECRET_KEY"`
	AzureAccountKey            string `env:"AZURE_ACCOUNT_KEY"`
	DefaultAddressPoolBaseCidr string `env:"CD_DEFAULT_ADDRESS_POOL_BASE_CIDR"`
	DefaultAddressPoolSize     int    `env:"CD_DEFAULT_ADDRESS_POOL_SIZE"`
}

func GetCdConfig

func GetCdConfig() (*CdConfig, error)

type CdHandler

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

type CdHandlerImpl

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

func NewCdHandlerImpl

func NewCdHandlerImpl(Logger *zap.SugaredLogger, cdConfig *CdConfig, userService user.UserService,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	cdWorkflowService CdWorkflowService,
	ciLogService CiLogService,
	ciArtifactRepository repository.CiArtifactRepository,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	envRepository repository2.EnvironmentRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository,
	ciConfig *CiConfig, helmAppService client.HelmAppService,
	pipelineOverrideRepository chartConfig.PipelineOverrideRepository, workflowDagExecutor WorkflowDagExecutor) *CdHandlerImpl

func (*CdHandlerImpl) CancelStage

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

func (*CdHandlerImpl) CheckHelmAppStatusPeriodicallyAndUpdateInDb

func (impl *CdHandlerImpl) CheckHelmAppStatusPeriodicallyAndUpdateInDb() error

func (*CdHandlerImpl) DownloadCdWorkflowArtifacts

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

func (*CdHandlerImpl) FetchAppWorkflowStatusForTriggerView

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

func (*CdHandlerImpl) FetchCdPrePostStageStatus

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

func (*CdHandlerImpl) FetchCdWorkflowDetails

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

func (*CdHandlerImpl) GetCdBuildHistory

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

func (*CdHandlerImpl) GetRunningWorkflowLogs

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

func (*CdHandlerImpl) UpdateWorkflow

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

type CdStageCompleteEvent

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

type CdWorkflowRequest

type CdWorkflowRequest struct {
	AppId                      int                `json:"appId"`
	EnvironmentId              int                `json:"envId"`
	WorkflowId                 int                `json:"workflowId"`
	WorkflowRunnerId           int                `json:"workflowRunnerId"`
	CdPipelineId               int                `json:"cdPipelineId"`
	TriggeredBy                int32              `json:"triggeredBy"`
	StageYaml                  string             `json:"stageYaml"`
	ArtifactLocation           string             `json:"artifactLocation"`
	CiProjectDetails           []CiProjectDetails `json:"ciProjectDetails"`
	CiArtifactDTO              CiArtifactDTO      `json:"ciArtifactDTO"`
	Namespace                  string             `json:"namespace"`
	WorkflowNamePrefix         string             `json:"workflowNamePrefix"`
	CdImage                    string             `json:"cdImage"`
	ActiveDeadlineSeconds      int64              `json:"activeDeadlineSeconds"`
	StageType                  string             `json:"stageType"`
	DockerUsername             string             `json:"dockerUsername"`
	DockerPassword             string             `json:"dockerPassword"`
	AwsRegion                  string             `json:"awsRegion"`
	SecretKey                  string             `json:"secretKey"`
	AccessKey                  string             `json:"accessKey"`
	DockerConnection           string             `json:"dockerConnection"`
	DockerCert                 string             `json:"dockerCert"`
	CdCacheLocation            string             `json:"cdCacheLocation"`
	CdCacheRegion              string             `json:"cdCacheRegion"`
	DockerRegistryType         string             `json:"dockerRegistryType"`
	DockerRegistryURL          string             `json:"dockerRegistryURL"`
	OrchestratorHost           string             `json:"orchestratorHost"`
	OrchestratorToken          string             `json:"orchestratorToken"`
	IsExtRun                   bool               `json:"isExtRun"`
	ExtraEnvironmentVariables  map[string]string  `json:"extraEnvironmentVariables"`
	CloudProvider              string             `json:"cloudProvider"`
	AzureBlobConfig            *AzureBlobConfig   `json:"azureBlobConfig"`
	MinioEndpoint              string             `json:"minioEndpoint"`
	DefaultAddressPoolBaseCidr string             `json:"defaultAddressPoolBaseCidr"`
	DefaultAddressPoolSize     int                `json:"defaultAddressPoolSize"`
}

type CdWorkflowService

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

type CdWorkflowServiceImpl

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

func NewCdWorkflowServiceImpl

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

func (*CdWorkflowServiceImpl) DeleteWorkflow

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

func (*CdWorkflowServiceImpl) GetWorkflow

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

func (*CdWorkflowServiceImpl) ListAllWorkflows

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

func (*CdWorkflowServiceImpl) SubmitWorkflow

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

func (*CdWorkflowServiceImpl) TerminateWorkflow

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

func (*CdWorkflowServiceImpl) UpdateWorkflow

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

type CiArtifactDTO

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

type CiArtifactWebhookRequest

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

type CiCdTriggerEvent

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

type CiConfig

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

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

func GetCiConfig

func GetCiConfig() (*CiConfig, error)

type CiHandler

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

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

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

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

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

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

type CiHandlerImpl

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

func NewCiHandlerImpl

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

func (*CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeBranchFix

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

func (*CiHandlerImpl) BuildManualTriggerCommitHashesForSourceTypeWebhook

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

func (*CiHandlerImpl) BuildPayload

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

func (*CiHandlerImpl) CancelBuild

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

func (*CiHandlerImpl) DownloadCiWorkflowArtifacts

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

func (*CiHandlerImpl) FetchCiStatusForTriggerView

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

func (*CiHandlerImpl) FetchMaterialInfoByArtifactId

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

func (*CiHandlerImpl) FetchMaterialsByPipelineId

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

func (*CiHandlerImpl) FetchWorkflowDetails

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

func (*CiHandlerImpl) GetBuildHistory

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

func (*CiHandlerImpl) GetCiPipeline

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

func (*CiHandlerImpl) GetHistoricBuildLogs

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

func (*CiHandlerImpl) GetRunningWorkflowLogs

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

func (*CiHandlerImpl) HandleCIManual

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

func (*CiHandlerImpl) HandleCIWebhook

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

func (*CiHandlerImpl) RefreshMaterialByCiPipelineMaterialId

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

func (*CiHandlerImpl) UpdateWorkflow

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

func (*CiHandlerImpl) WriteCIFailEvent

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

func (*CiHandlerImpl) WriteToCreateTestSuites

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

type CiLogRequest

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

type CiLogService

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

type CiLogServiceImpl

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

func NewCiLogServiceImpl

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

func (*CiLogServiceImpl) FetchLogs

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

func (*CiLogServiceImpl) FetchRunningWorkflowLogs

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

type CiPipelineMaterialResponse

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

type CiProjectDetails

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

type CiService

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

type CiServiceImpl

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

func NewCiServiceImpl

func NewCiServiceImpl(Logger *zap.SugaredLogger, workflowService WorkflowService,
	ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository, ciConfig *CiConfig, eventClient client.EventClient,
	eventFactory client.EventFactory, mergeUtil *util.MergeUtil, ciPipelineRepository pipelineConfig.CiPipelineRepository,
	prePostCiScriptHistoryService history.PrePostCiScriptHistoryService,
	pipelineStageService PipelineStageService,
	userService user.UserService) *CiServiceImpl

func (*CiServiceImpl) BuildPayload

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

TODO: Send all trigger data

func (*CiServiceImpl) GetCiMaterials

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

func (*CiServiceImpl) TriggerCiPipeline

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

func (*CiServiceImpl) WriteCITriggerEvent

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

type CmAndSecretBulkUpdateResponse

type CmAndSecretBulkUpdateResponse struct {
	Message    []string                                  `json:"message"`
	Failure    []*CmAndSecretBulkUpdateResponseForOneApp `json:"failure"`
	Successful []*CmAndSecretBulkUpdateResponseForOneApp `json:"successful"`
}

type CmAndSecretBulkUpdateResponseForOneApp

type CmAndSecretBulkUpdateResponseForOneApp struct {
	AppId   int      `json:"appId"`
	AppName string   `json:"appName"`
	EnvId   int      `json:"envId"`
	Names   []string `json:"names"`
	Message string   `json:"message"`
}

type CmAndSecretImpactedObjectsResponseForOneApp

type CmAndSecretImpactedObjectsResponseForOneApp struct {
	AppId   int      `json:"appId"`
	AppName string   `json:"appName"`
	EnvId   int      `json:"envId"`
	Names   []string `json:"names"`
}

type CmAndSecretSpec

type CmAndSecretSpec struct {
	Names     []string `json:"names"`
	PatchJson string   `json:"patchJson"`
}

type CmAndSecretTask

type CmAndSecretTask struct {
	Spec *CmAndSecretSpec `json:"spec"`
}

type ConfigData

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

type ConfigDataRequest

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

type ConfigMapRequest

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

type ConfigMapSecretsResponse

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

type ConfigMapService

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

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

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

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

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

type ConfigMapServiceImpl

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

func NewConfigMapServiceImpl

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

func (ConfigMapServiceImpl) CMEnvironmentAddUpdate

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

func (ConfigMapServiceImpl) CMEnvironmentDelete

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

func (ConfigMapServiceImpl) CMEnvironmentDeleteByAppIdAndEnvId

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

func (ConfigMapServiceImpl) CMEnvironmentFetch

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

func (ConfigMapServiceImpl) CMGlobalAddUpdate

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

func (ConfigMapServiceImpl) CMGlobalDelete

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

func (ConfigMapServiceImpl) CMGlobalDeleteByAppId

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

func (ConfigMapServiceImpl) CMGlobalFetch

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

func (ConfigMapServiceImpl) CSEnvironmentAddUpdate

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

func (ConfigMapServiceImpl) CSEnvironmentDelete

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

func (ConfigMapServiceImpl) CSEnvironmentDeleteByAppIdAndEnvId

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

func (ConfigMapServiceImpl) CSEnvironmentFetch

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

func (ConfigMapServiceImpl) CSEnvironmentFetchForEdit

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

func (ConfigMapServiceImpl) CSGlobalAddUpdate

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

func (ConfigMapServiceImpl) CSGlobalDelete

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

func (ConfigMapServiceImpl) CSGlobalDeleteByAppId

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

func (ConfigMapServiceImpl) CSGlobalFetch

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

func (ConfigMapServiceImpl) CSGlobalFetchForEdit

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

func (ConfigMapServiceImpl) ConfigSecretEnvironmentBulkPatch

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

func (ConfigMapServiceImpl) ConfigSecretGlobalBulkPatch

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

type ConfigsList

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

type ContainerResources

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

type DbConfigBean

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

type DbConfigService

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

type DbConfigServiceImpl

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

func NewDbConfigService

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

func (DbConfigServiceImpl) GetAll

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

func (DbConfigServiceImpl) GetById

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

func (DbConfigServiceImpl) GetForAutocomplete

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

func (DbConfigServiceImpl) Save

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

func (DbConfigServiceImpl) Update

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

type DbMigrationConfigBean

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

type DbMigrationService

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

type DbMigrationServiceImpl

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

func NewDbMogrationService

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

func (DbMigrationServiceImpl) GetByPipelineId

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

func (DbMigrationServiceImpl) Save

func (DbMigrationServiceImpl) Update

type DbPipelineOrchestrator

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

type DbPipelineOrchestratorImpl

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

func NewDbPipelineOrchestrator

func NewDbPipelineOrchestrator(
	pipelineGroupRepository app2.AppRepository,
	logger *zap.SugaredLogger,
	materialRepository pipelineConfig.MaterialRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	CiPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository,
	GitSensorClient gitSensor.GitSensorClient, ciConfig *CiConfig,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	envRepository repository2.EnvironmentRepository,
	attributesService attributes.AttributesService,
	appListingRepository repository.AppListingRepository,
	appLabelsService app.AppLabelService,
	userAuthService user.UserAuthService,
	prePostCdScriptHistoryService history3.PrePostCdScriptHistoryService,
	prePostCiScriptHistoryService history3.PrePostCiScriptHistoryService,
	pipelineStageService PipelineStageService) *DbPipelineOrchestratorImpl

func (DbPipelineOrchestratorImpl) BuildCiPipelineScript

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

func (DbPipelineOrchestratorImpl) CreateApp

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

func (DbPipelineOrchestratorImpl) CreateCDPipelines

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

func (DbPipelineOrchestratorImpl) CreateCiConf

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

func (DbPipelineOrchestratorImpl) CreateMaterials

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

func (DbPipelineOrchestratorImpl) DeleteApp

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

func (DbPipelineOrchestratorImpl) DeleteCdPipeline

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

func (DbPipelineOrchestratorImpl) DeleteCiPipeline

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

func (DbPipelineOrchestratorImpl) GetByEnvOverrideId

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

func (DbPipelineOrchestratorImpl) GetCdPipelinesForApp

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

func (DbPipelineOrchestratorImpl) GetCdPipelinesForAppAndEnv

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

func (DbPipelineOrchestratorImpl) PatchMaterialValue

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

func (DbPipelineOrchestratorImpl) PipelineExists

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

func (DbPipelineOrchestratorImpl) UpdateCDPipeline

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

func (DbPipelineOrchestratorImpl) UpdateMaterial

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

type Deployment

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

type DeploymentGroupAppWithEnv

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

type DeploymentTemplateBulkUpdateResponse

type DeploymentTemplateBulkUpdateResponse struct {
	Message    []string                                         `json:"message"`
	Failure    []*DeploymentTemplateBulkUpdateResponseForOneApp `json:"failure"`
	Successful []*DeploymentTemplateBulkUpdateResponseForOneApp `json:"successful"`
}

type DeploymentTemplateBulkUpdateResponseForOneApp

type DeploymentTemplateBulkUpdateResponseForOneApp struct {
	AppId   int    `json:"appId"`
	AppName string `json:"appName"`
	EnvId   int    `json:"envId"`
	Message string `json:"message"`
}

type DeploymentTemplateImpactedObjectsResponseForOneApp

type DeploymentTemplateImpactedObjectsResponseForOneApp struct {
	AppId   int    `json:"appId"`
	AppName string `json:"appName"`
	EnvId   int    `json:"envId"`
}

type DeploymentTemplateSpec

type DeploymentTemplateSpec struct {
	PatchJson string `json:"patchJson"`
}

type DeploymentTemplateTask

type DeploymentTemplateTask struct {
	Spec *DeploymentTemplateSpec `json:"spec"`
}

type DeploymentType

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

type DockerArtifactStoreBean

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

type DockerRegistryConfig

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

type DockerRegistryConfigImpl

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

func NewDockerRegistryConfigImpl

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

func (DockerRegistryConfigImpl) Create

func (DockerRegistryConfigImpl) Delete

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

func (DockerRegistryConfigImpl) DeleteReg

func (DockerRegistryConfigImpl) FetchAllDockerAccounts

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

* this method used for getting all the docker account details

func (DockerRegistryConfigImpl) FetchOneDockerAccount

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

* this method used for getting all the docker account details

func (DockerRegistryConfigImpl) ListAllActive

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

list all active artifact store

func (DockerRegistryConfigImpl) Update

type EcrConfig

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

func GetEcrConfig

func GetEcrConfig() (*EcrConfig, error)

type EnvironmentProperties

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

type EnvironmentPropertiesResponse

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

type ExternalSecret

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

type GitHostConfig

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

type GitHostConfigImpl

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

func NewGitHostConfigImpl

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

func (GitHostConfigImpl) Create

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

Create in DB

func (GitHostConfigImpl) GetAll

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

get all git hosts

func (GitHostConfigImpl) GetById

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

get git host by Id

type GitHostRequest

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

type GitOptions

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

type GitRegistry

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

type GitRegistryConfig

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

type GitRegistryConfigImpl

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

func NewGitRegistryConfigImpl

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

func (GitRegistryConfigImpl) Create

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

func (GitRegistryConfigImpl) Delete

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

func (GitRegistryConfigImpl) FetchAllGitProviders

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

func (GitRegistryConfigImpl) FetchOneGitProvider

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

func (GitRegistryConfigImpl) GetAll

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

get all active git providers

func (GitRegistryConfigImpl) Update

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

func (GitRegistryConfigImpl) UpdateGitSensor

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

type GitTriggerInfoResponse

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

type ImpactedObjectsResponse

type ImpactedObjectsResponse struct {
	DeploymentTemplate []*DeploymentTemplateImpactedObjectsResponseForOneApp `json:"deploymentTemplate"`
	ConfigMap          []*CmAndSecretImpactedObjectsResponseForOneApp        `json:"configMap"`
	Secret             []*CmAndSecretImpactedObjectsResponseForOneApp        `json:"secret"`
}

type NameIncludesExcludes

type NameIncludesExcludes struct {
	Names []string `json:"names"`
}

type PipelineBuilder

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

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

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

	GetMaterialsForAppId(appId int) []*bean.GitMaterial
	FindAllMatchesByAppName(appName string) ([]*AppBean, error)
	GetEnvironmentByCdPipelineId(pipelineId int) (int, error)
}

type PipelineBuilderImpl

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

func NewPipelineBuilderImpl

func NewPipelineBuilderImpl(logger *zap.SugaredLogger,
	dbPipelineOrchestrator DbPipelineOrchestrator,
	dockerArtifactStoreRepository repository.DockerArtifactStoreRepository,
	materialRepo pipelineConfig.MaterialRepository,
	pipelineGroupRepo app2.AppRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	propertiesConfigService PropertiesConfigService,
	ciTemplateRepository pipelineConfig.CiTemplateRepository,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	application application.ServiceClient,
	chartRepository chartRepoRepository.ChartRepository,
	ciArtifactRepository repository.CiArtifactRepository,
	ecrConfig *EcrConfig,
	envConfigOverrideRepository chartConfig.EnvConfigOverrideRepository,
	environmentRepository repository2.EnvironmentRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	mergeUtil util.MergeUtil,
	appWorkflowRepository appWorkflow.AppWorkflowRepository,
	ciConfig *CiConfig,
	cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	appService app.AppService,
	imageScanResultRepository security.ImageScanResultRepository,
	ArgoK8sClient argocdServer.ArgoK8sClient,
	GitFactory *util.GitFactory, attributesService attributes.AttributesService,
	aCDAuthConfig *util3.ACDAuthConfig, gitOpsRepository repository.GitOpsConfigRepository,
	pipelineStrategyHistoryService history.PipelineStrategyHistoryService,
	prePostCiScriptHistoryService history.PrePostCiScriptHistoryService,
	prePostCdScriptHistoryService history.PrePostCdScriptHistoryService,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService,
	appLevelMetricsRepository repository.AppLevelMetricsRepository,
	pipelineStageService PipelineStageService, chartRefRepository chartRepoRepository.ChartRefRepository,
	chartTemplateService util.ChartTemplateService, chartService chart.ChartService,
	helmAppService client.HelmAppService,
	deploymentGroupRepository repository.DeploymentGroupRepository) *PipelineBuilderImpl

func (PipelineBuilderImpl) BuildArtifactsForCIParent

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

func (PipelineBuilderImpl) BuildArtifactsForCdStage

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

func (PipelineBuilderImpl) BuildArtifactsForParentStage

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

func (PipelineBuilderImpl) CreateApp

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

func (PipelineBuilderImpl) CreateCdPipelines

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

func (PipelineBuilderImpl) CreateCiPipeline

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

func (PipelineBuilderImpl) CreateMaterialsForApp

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

func (PipelineBuilderImpl) DeleteApp

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

func (PipelineBuilderImpl) DeleteMaterial

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

func (PipelineBuilderImpl) FetchArtifactForRollback

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

func (PipelineBuilderImpl) FetchCDPipelineStrategy

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

func (PipelineBuilderImpl) FetchConfigmapSecretsForCdStages

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

func (PipelineBuilderImpl) FindAllMatchesByAppName

func (impl PipelineBuilderImpl) FindAllMatchesByAppName(appName string) ([]*AppBean, error)

func (PipelineBuilderImpl) FindAppsByTeamId

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

func (PipelineBuilderImpl) FindAppsByTeamName

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

func (PipelineBuilderImpl) FindByIds

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

func (PipelineBuilderImpl) FindPipelineById

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

func (PipelineBuilderImpl) GetApp

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

func (PipelineBuilderImpl) GetAppList

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

func (PipelineBuilderImpl) GetAppListByTeamIds

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

func (PipelineBuilderImpl) GetArtifactsByCDPipeline

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

func (PipelineBuilderImpl) GetArtifactsForCdStage

func (impl PipelineBuilderImpl) GetArtifactsForCdStage(cdPipelineId int, parentId int, parentType bean2.WorkflowType, stage bean2.WorkflowType, parentCdId int) (bean.CiArtifactResponse, error)

func (PipelineBuilderImpl) GetCdParentDetails

func (impl PipelineBuilderImpl) GetCdParentDetails(cdPipelineId int) (parentId int, parentType bean2.WorkflowType, err error)

func (PipelineBuilderImpl) GetCdPipelineById

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

func (PipelineBuilderImpl) GetCdPipelinesForApp

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

func (PipelineBuilderImpl) GetCdPipelinesForAppAndEnv

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

func (PipelineBuilderImpl) GetCiPipeline

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

func (PipelineBuilderImpl) GetCiPipelineById

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

func (PipelineBuilderImpl) GetCiPipelineMin

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

func (PipelineBuilderImpl) GetEnvironmentByCdPipelineId

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

func (PipelineBuilderImpl) GetMaterialsForAppId

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

func (PipelineBuilderImpl) PatchCdPipelines

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

func (PipelineBuilderImpl) PatchCiPipeline

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

func (PipelineBuilderImpl) UpdateCiTemplate

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

func (PipelineBuilderImpl) UpdateMaterialsForApp

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

type PipelineStageService

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

type PipelineStageServiceImpl

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

func NewPipelineStageService

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

func (*PipelineStageServiceImpl) BuildCiStageData

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

func (*PipelineStageServiceImpl) BuildCiStageDataForWfRequest

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

func (*PipelineStageServiceImpl) BuildCiStepDataForWfRequest

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

func (*PipelineStageServiceImpl) BuildInlineStepData

func (*PipelineStageServiceImpl) BuildPluginStepDataForWfRequest

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

func (*PipelineStageServiceImpl) BuildPluginVariableAndConditionDataForWfRequest

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

func (*PipelineStageServiceImpl) BuildPrePostAndRefPluginStepsDataForWfRequest

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

BuildPrePostAndRefPluginStepsDataForWfRequest and related methods starts

func (*PipelineStageServiceImpl) BuildRefPluginStepData

func (*PipelineStageServiceImpl) BuildRefPluginStepDataForWfRequest

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

func (*PipelineStageServiceImpl) BuildVariableAndConditionDataByStepId

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

func (*PipelineStageServiceImpl) BuildVariableAndConditionDataForWfRequest

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

func (*PipelineStageServiceImpl) CreateCiStage

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

CreateCiStage and related methods starts

func (*PipelineStageServiceImpl) CreateConditions

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

func (*PipelineStageServiceImpl) CreateConditionsEntryInDb

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

func (*PipelineStageServiceImpl) CreateInputAndOutputVariables

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

func (*PipelineStageServiceImpl) CreateScriptAndMappingForInlineStep

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

func (*PipelineStageServiceImpl) CreateStageSteps

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

func (*PipelineStageServiceImpl) CreateVariablesEntryInDb

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

func (*PipelineStageServiceImpl) DeleteCiStage

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

DeleteCiStage and related methods starts

func (*PipelineStageServiceImpl) FilterAndActOnStepsInCiStageUpdateRequest

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

func (*PipelineStageServiceImpl) GetCiPipelineStageData

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

GetCiPipelineStageData and related methods starts

func (*PipelineStageServiceImpl) GetRefPluginStepsByIds

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

func (*PipelineStageServiceImpl) UpdateCiStage

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

UpdateCiStage and related methods starts

func (*PipelineStageServiceImpl) UpdateInputAndOutputVariables

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

func (*PipelineStageServiceImpl) UpdatePipelineStageStepConditions

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

func (*PipelineStageServiceImpl) UpdatePipelineStageStepVariables

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

func (*PipelineStageServiceImpl) UpdateScriptAndMappingForInlineStep

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

func (*PipelineStageServiceImpl) UpdateStageSteps

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 pipelineConfig.DeploymentTemplate `json:"deploymentTemplate,omitempty" validate:"oneof=BLUE-GREEN ROLLING"` //
	Config             json.RawMessage                   `json:"config"`
	Default            bool                              `json:"default"`
}

type PropertiesConfigService

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

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

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

type PropertiesConfigServiceImpl

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

func NewPropertiesConfigServiceImpl

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

func (PropertiesConfigServiceImpl) CreateEnvironmentProperties

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

func (PropertiesConfigServiceImpl) CreateEnvironmentPropertiesWithNamespace

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

func (PropertiesConfigServiceImpl) CreateIfRequired

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

func (PropertiesConfigServiceImpl) EnvMetricsEnableDisable

func (PropertiesConfigServiceImpl) GetAppIdByChartEnvId

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

func (PropertiesConfigServiceImpl) GetEnvironmentProperties

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

func (PropertiesConfigServiceImpl) GetEnvironmentPropertiesById

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

func (PropertiesConfigServiceImpl) GetLatestEnvironmentProperties

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

func (PropertiesConfigServiceImpl) ResetEnvironmentProperties

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

func (PropertiesConfigServiceImpl) UpdateEnvironmentProperties

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

type Recreate

type Recreate struct {
}

type RequestType

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

type Rolling

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

type RolloutPause

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

type SecretsList

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

type StopAppRequest

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

type StopDeploymentGroupRequest

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

type Strategy

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

type TeamAppBean

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

type Trigger

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

type WebhookEventDataConfig

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

type WebhookEventDataConfigImpl

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

func NewWebhookEventDataConfigImpl

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

func (WebhookEventDataConfigImpl) GetById

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

func (WebhookEventDataConfigImpl) Save

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

type WebhookEventDataRequest

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)
	SaveCiArtifactWebhook(ciPipelineId int, request *CiArtifactWebhookRequest) (id int, err error)
}

type WebhookServiceImpl

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

func NewWebhookServiceImpl

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

func (WebhookServiceImpl) AuthenticateExternalCiWebhook

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

func (*WebhookServiceImpl) BuildPayload

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

func (WebhookServiceImpl) SaveCiArtifactWebhook

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

func (*WebhookServiceImpl) WriteCISuccessEvent

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

type WorkflowDagExecutor

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

type WorkflowDagExecutorImpl

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

func NewWorkflowDagExecutorImpl

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

func (*WorkflowDagExecutorImpl) HandleCiSuccessEvent

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

func (*WorkflowDagExecutorImpl) HandleDeploymentSuccessEvent

func (impl *WorkflowDagExecutorImpl) HandleDeploymentSuccessEvent(gitHash string, pipelineOverrideId int) error

func (*WorkflowDagExecutorImpl) HandlePostStageSuccessEvent

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

func (*WorkflowDagExecutorImpl) HandlePreStageSuccessEvent

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

func (*WorkflowDagExecutorImpl) ManualCdTrigger

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

func (*WorkflowDagExecutorImpl) StopStartApp

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

func (*WorkflowDagExecutorImpl) Subscribe

func (impl *WorkflowDagExecutorImpl) Subscribe() error

func (*WorkflowDagExecutorImpl) TriggerBulkDeploymentAsync

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

func (*WorkflowDagExecutorImpl) TriggerBulkHibernateAsync

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

func (*WorkflowDagExecutorImpl) TriggerDeployment

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

Only used for auto trigger

func (*WorkflowDagExecutorImpl) TriggerPostStage

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

func (*WorkflowDagExecutorImpl) TriggerPreStage

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

type WorkflowRequest

type WorkflowRequest struct {
	WorkflowNamePrefix         string                   `json:"workflowNamePrefix"`
	PipelineName               string                   `json:"pipelineName"`
	PipelineId                 int                      `json:"pipelineId"`
	DockerImageTag             string                   `json:"dockerImageTag"`
	DockerRegistryId           string                   `json:"dockerRegistryId"`
	DockerRegistryType         string                   `json:"dockerRegistryType"`
	DockerRegistryURL          string                   `json:"dockerRegistryURL"`
	DockerConnection           string                   `json:"dockerConnection"`
	DockerCert                 string                   `json:"dockerCert"`
	DockerBuildArgs            string                   `json:"dockerBuildArgs"`
	DockerRepository           string                   `json:"dockerRepository"`
	DockerFileLocation         string                   `json:"dockerfileLocation"`
	DockerUsername             string                   `json:"dockerUsername"`
	DockerPassword             string                   `json:"dockerPassword"`
	AwsRegion                  string                   `json:"awsRegion"`
	AccessKey                  string                   `json:"accessKey"`
	SecretKey                  string                   `json:"secretKey"`
	CiCacheLocation            string                   `json:"ciCacheLocation"`
	CiCacheRegion              string                   `json:"ciCacheRegion"`
	CiCacheFileName            string                   `json:"ciCacheFileName"`
	CiProjectDetails           []CiProjectDetails       `json:"ciProjectDetails"`
	ContainerResources         ContainerResources       `json:"containerResources"`
	ActiveDeadlineSeconds      int64                    `json:"activeDeadlineSeconds"`
	CiImage                    string                   `json:"ciImage"`
	Namespace                  string                   `json:"namespace"`
	WorkflowId                 int                      `json:"workflowId"`
	TriggeredBy                int32                    `json:"triggeredBy"`
	CacheLimit                 int64                    `json:"cacheLimit"`
	BeforeDockerBuildScripts   []*bean.CiScript         `json:"beforeDockerBuildScripts"`
	AfterDockerBuildScripts    []*bean.CiScript         `json:"afterDockerBuildScripts"`
	CiArtifactLocation         string                   `json:"ciArtifactLocation"`
	InvalidateCache            bool                     `json:"invalidateCache"`
	ScanEnabled                bool                     `json:"scanEnabled"`
	CloudProvider              string                   `json:"cloudProvider"`
	AzureBlobConfig            *AzureBlobConfig         `json:"azureBlobConfig"`
	MinioEndpoint              string                   `json:"minioEndpoint"`
	DefaultAddressPoolBaseCidr string                   `json:"defaultAddressPoolBaseCidr"`
	DefaultAddressPoolSize     int                      `json:"defaultAddressPoolSize"`
	PreCiSteps                 []*bean2.StepObject      `json:"preCiSteps"`
	PostCiSteps                []*bean2.StepObject      `json:"postCiSteps"`
	RefPlugins                 []*bean2.RefPluginObject `json:"refPlugins"`
	AppName                    string                   `json:"appName"`
	TriggerByAuthor            string                   `json:"triggerByAuthor"`
}

type WorkflowResponse

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

type WorkflowService

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

type WorkflowServiceImpl

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

func NewWorkflowServiceImpl

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

func (*WorkflowServiceImpl) DeleteWorkflow

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

func (*WorkflowServiceImpl) GetWorkflow

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

func (*WorkflowServiceImpl) ListAllWorkflows

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

func (*WorkflowServiceImpl) SubmitWorkflow

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

func (*WorkflowServiceImpl) TerminateWorkflow

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

func (*WorkflowServiceImpl) UpdateWorkflow

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

type WorkflowStatus

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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