pipelineConfig

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const WORKFLOW_EXECUTOR_TYPE_AWF = "AWF"
View Source
const WORKFLOW_EXECUTOR_TYPE_SYSTEM = "SYSTEM"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLabel added in v0.2.23

type AppLabel struct {
	Id    int    `sql:"id,pk"`
	AppId int    `sql:"app_id,notnull"`
	Key   string `sql:"key,notnull"`
	Value string `sql:"value,notnull"`
	App   app.App
	sql.AuditLog
	// contains filtered or unexported fields
}

type AppLabelRepository added in v0.2.23

type AppLabelRepository interface {
	Create(model *AppLabel, tx *pg.Tx) (*AppLabel, error)
	Update(model *AppLabel) (*AppLabel, error)
	Delete(model *AppLabel, tx *pg.Tx) error
	FindById(id int) (*AppLabel, error)
	FindAllByIds(ids []int) ([]*AppLabel, error)
	FindAll() ([]*AppLabel, error)
	FindByLabelKey(key string) ([]*AppLabel, error)
	FindByAppIdAndKeyAndValue(appId int, key string, value string) (*AppLabel, error)
	FindByLabelValue(label string) ([]*AppLabel, error)
	FindAllByAppId(appId int) ([]*AppLabel, error)
}

type AppLabelRepositoryImpl added in v0.2.23

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

func NewAppLabelRepositoryImpl added in v0.2.23

func NewAppLabelRepositoryImpl(dbConnection *pg.DB) *AppLabelRepositoryImpl

func (AppLabelRepositoryImpl) Create added in v0.2.23

func (impl AppLabelRepositoryImpl) Create(model *AppLabel, tx *pg.Tx) (*AppLabel, error)

func (AppLabelRepositoryImpl) Delete added in v0.2.23

func (impl AppLabelRepositoryImpl) Delete(model *AppLabel, tx *pg.Tx) error

func (AppLabelRepositoryImpl) FindAll added in v0.2.23

func (impl AppLabelRepositoryImpl) FindAll() ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindAllByAppId added in v0.2.23

func (impl AppLabelRepositoryImpl) FindAllByAppId(appId int) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindAllByIds added in v0.2.23

func (impl AppLabelRepositoryImpl) FindAllByIds(ids []int) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindByAppIdAndKeyAndValue added in v0.2.23

func (impl AppLabelRepositoryImpl) FindByAppIdAndKeyAndValue(appId int, key string, value string) (*AppLabel, error)

func (AppLabelRepositoryImpl) FindById added in v0.2.23

func (impl AppLabelRepositoryImpl) FindById(id int) (*AppLabel, error)

func (AppLabelRepositoryImpl) FindByLabelKey added in v0.2.23

func (impl AppLabelRepositoryImpl) FindByLabelKey(key string) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindByLabelValue added in v0.2.23

func (impl AppLabelRepositoryImpl) FindByLabelValue(label string) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) Update added in v0.2.23

func (impl AppLabelRepositoryImpl) Update(model *AppLabel) (*AppLabel, error)

type BuildTypeCount added in v0.6.6

type BuildTypeCount struct {
	Status string `json:"status"`
	Type   string `json:"type"`
	Count  int    `json:"count"`
}

type CdWorkflow

type CdWorkflow struct {
	Id               int            `sql:"id,pk"`
	CiArtifactId     int            `sql:"ci_artifact_id"`
	PipelineId       int            `sql:"pipeline_id"`
	WorkflowStatus   WorkflowStatus `sql:"workflow_status,notnull"`
	Pipeline         *Pipeline
	CiArtifact       *repository.CiArtifact
	CdWorkflowRunner []CdWorkflowRunner
	sql.AuditLog
	// contains filtered or unexported fields
}

type CdWorkflowConfig

type CdWorkflowConfig struct {
	Id                       int    `sql:"id,pk"`
	CdTimeout                int64  `sql:"cd_timeout"`
	MinCpu                   string `sql:"min_cpu"`
	MaxCpu                   string `sql:"max_cpu"`
	MinMem                   string `sql:"min_mem"`
	MaxMem                   string `sql:"max_mem"`
	MinStorage               string `sql:"min_storage"`
	MaxStorage               string `sql:"max_storage"`
	MinEphStorage            string `sql:"min_eph_storage"`
	MaxEphStorage            string `sql:"max_eph_storage"`
	CdCacheBucket            string `sql:"cd_cache_bucket"`
	CdCacheRegion            string `sql:"cd_cache_region"`
	CdImage                  string `sql:"cd_image"`
	Namespace                string `sql:"wf_namespace"`
	CdPipelineId             int    `sql:"cd_pipeline_id"`
	LogsBucket               string `sql:"logs_bucket"`
	CdArtifactLocationFormat string `sql:"cd_artifact_location_format"`
	// contains filtered or unexported fields
}

type CdWorkflowRepository

type CdWorkflowRepository interface {
	SaveWorkFlow(wf *CdWorkflow) error
	UpdateWorkFlow(wf *CdWorkflow) error
	FindById(wfId int) (*CdWorkflow, error)
	FindCdWorkflowMetaByEnvironmentId(appId int, environmentId int, offset int, size int) ([]CdWorkflowRunner, error)
	FindCdWorkflowMetaByPipelineId(pipelineId int, offset int, size int) ([]CdWorkflowRunner, error)
	FindArtifactByPipelineIdAndRunnerType(pipelineId int, runnerType bean.WorkflowType, limit int) ([]CdWorkflowRunner, error)

	SaveWorkFlowRunner(wfr *CdWorkflowRunner) (*CdWorkflowRunner, error)
	UpdateWorkFlowRunner(wfr *CdWorkflowRunner) error
	UpdateWorkFlowRunnersWithTxn(wfrs []CdWorkflowRunner, tx *pg.Tx) error
	UpdateWorkFlowRunners(wfr []*CdWorkflowRunner) error
	FindWorkflowRunnerByCdWorkflowId(wfIds []int) ([]*CdWorkflowRunner, error)
	FindPreviousCdWfRunnerByStatus(pipelineId int, currentWFRunnerId int, status []string) ([]*CdWorkflowRunner, error)
	FindConfigByPipelineId(pipelineId int) (*CdWorkflowConfig, error)
	FindWorkflowRunnerById(wfrId int) (*CdWorkflowRunner, error)
	FindLatestWfrByAppIdAndEnvironmentId(appId int, environmentId int) (CdWorkflowRunner, error)
	FindCdWorkflowRunnerByEnvironmentIdAndRunnerType(appId int, environmentId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)

	GetConnection() *pg.DB

	FindLastPreOrPostTriggeredByPipelineId(pipelineId int) (CdWorkflowRunner, error)
	FindLastPreOrPostTriggeredByEnvironmentId(appId int, environmentId int) (CdWorkflowRunner, error)

	FindByWorkflowIdAndRunnerType(wfId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)
	FindLastStatusByPipelineIdAndRunnerType(pipelineId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)
	SaveWorkFlows(wfs ...*CdWorkflow) error
	IsLatestWf(pipelineId int, wfId int) (bool, error)
	FindLatestCdWorkflowByPipelineId(pipelineIds []int) (*CdWorkflow, error)
	FindLatestCdWorkflowByPipelineIdV2(pipelineIds []int) ([]*CdWorkflow, error)
	FetchAllCdStagesLatestEntity(pipelineIds []int) ([]*CdWorkflowStatus, error)
	FetchAllCdStagesLatestEntityStatus(wfrIds []int) ([]*CdWorkflowRunner, error)
	ExistsByStatus(status string) (bool, error)

	FetchArtifactsByCdPipelineId(pipelineId int, runnerType bean.WorkflowType, offset, limit int) ([]CdWorkflowRunner, error)
}

type CdWorkflowRepositoryImpl

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

func NewCdWorkflowRepositoryImpl

func NewCdWorkflowRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CdWorkflowRepositoryImpl

func (*CdWorkflowRepositoryImpl) ExistsByStatus added in v0.4.3

func (impl *CdWorkflowRepositoryImpl) ExistsByStatus(status string) (bool, error)

func (*CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntity

func (impl *CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntity(pipelineIds []int) ([]*CdWorkflowStatus, error)

func (*CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntityStatus

func (impl *CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntityStatus(wfrIds []int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FetchArtifactsByCdPipelineId added in v0.6.2

func (impl *CdWorkflowRepositoryImpl) FetchArtifactsByCdPipelineId(pipelineId int, runnerType bean.WorkflowType, offset, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindArtifactByPipelineIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindArtifactByPipelineIdAndRunnerType(pipelineId int, runnerType bean.WorkflowType, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindById

func (impl *CdWorkflowRepositoryImpl) FindById(wfId int) (*CdWorkflow, error)

func (*CdWorkflowRepositoryImpl) FindByWorkflowIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindByWorkflowIdAndRunnerType(wfId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindCdWorkflowMetaByEnvironmentId

func (impl *CdWorkflowRepositoryImpl) FindCdWorkflowMetaByEnvironmentId(appId int, environmentId int, offset int, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindCdWorkflowMetaByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindCdWorkflowMetaByPipelineId(pipelineId int, offset int, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindCdWorkflowRunnerByEnvironmentIdAndRunnerType added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) FindCdWorkflowRunnerByEnvironmentIdAndRunnerType(appId int, environmentId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindConfigByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindConfigByPipelineId(pipelineId int) (*CdWorkflowConfig, error)

func (*CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByEnvironmentId

func (impl *CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByEnvironmentId(appId int, environmentId int) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByPipelineId(pipelineId int) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLastStatusByPipelineIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindLastStatusByPipelineIdAndRunnerType(pipelineId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineId(pipelineIds []int) (*CdWorkflow, error)

func (*CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineIdV2

func (impl *CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineIdV2(pipelineIds []int) ([]*CdWorkflow, error)

func (*CdWorkflowRepositoryImpl) FindLatestWfrByAppIdAndEnvironmentId added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) FindLatestWfrByAppIdAndEnvironmentId(appId int, environmentId int) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindPreviousCdWfRunnerByStatus

func (impl *CdWorkflowRepositoryImpl) FindPreviousCdWfRunnerByStatus(pipelineId int, currentWFRunnerId int, status []string) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindWorkflowRunnerByCdWorkflowId

func (impl *CdWorkflowRepositoryImpl) FindWorkflowRunnerByCdWorkflowId(wfIds []int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindWorkflowRunnerById

func (impl *CdWorkflowRepositoryImpl) FindWorkflowRunnerById(wfrId int) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) GetConnection added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) GetConnection() *pg.DB

func (*CdWorkflowRepositoryImpl) IsLatestWf

func (impl *CdWorkflowRepositoryImpl) IsLatestWf(pipelineId int, wfId int) (bool, error)

func (*CdWorkflowRepositoryImpl) SaveWorkFlow

func (impl *CdWorkflowRepositoryImpl) SaveWorkFlow(wf *CdWorkflow) error

func (*CdWorkflowRepositoryImpl) SaveWorkFlowRunner

func (impl *CdWorkflowRepositoryImpl) SaveWorkFlowRunner(wfr *CdWorkflowRunner) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) SaveWorkFlows

func (impl *CdWorkflowRepositoryImpl) SaveWorkFlows(wfs ...*CdWorkflow) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlow

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlow(wf *CdWorkflow) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlowRunner

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlowRunner(wfr *CdWorkflowRunner) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlowRunners

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlowRunners(wfr []*CdWorkflowRunner) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlowRunnersWithTxn added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlowRunnersWithTxn(wfrs []CdWorkflowRunner, tx *pg.Tx) error

type CdWorkflowRunner

type CdWorkflowRunner struct {
	Id                 int                  `sql:"id,pk"`
	Name               string               `sql:"name"`
	WorkflowType       bean.WorkflowType    `sql:"workflow_type"` //pre,post,deploy
	ExecutorType       WorkflowExecutorType `sql:"executor_type"` //awf, system
	Status             string               `sql:"status"`
	PodStatus          string               `sql:"pod_status"`
	Message            string               `sql:"message"`
	StartedOn          time.Time            `sql:"started_on"`
	FinishedOn         time.Time            `sql:"finished_on"`
	Namespace          string               `sql:"namespace"`
	LogLocation        string               `sql:"log_file_path"`
	TriggeredBy        int32                `sql:"triggered_by"`
	CdWorkflowId       int                  `sql:"cd_workflow_id"`
	PodName            string               `sql:"pod_name"`
	BlobStorageEnabled bool                 `sql:"blob_storage_enabled,notnull"`
	CdWorkflow         *CdWorkflow
	// contains filtered or unexported fields
}

type CdWorkflowStatus

type CdWorkflowStatus struct {
	CiPipelineId int    `json:"ci_pipeline_id"`
	PipelineId   int    `json:"pipeline_id"`
	PipelineName string `json:"pipeline_name,omitempty"`
	DeployStatus string `json:"deploy_status"`
	PreStatus    string `json:"pre_status"`
	PostStatus   string `json:"post_status"`
	WorkflowType string `json:"workflow_type,omitempty"`
	WfrId        int    `json:"wfr_id,omitempty"`
}

type CdWorkflowWithArtifact

type CdWorkflowWithArtifact struct {
	Id                 int       `json:"id"`
	CdWorkflowId       int       `json:"cd_workflow_id"`
	Name               string    `json:"name"`
	Status             string    `json:"status"`
	PodStatus          string    `json:"pod_status"`
	Message            string    `json:"message"`
	StartedOn          time.Time `json:"started_on"`
	FinishedOn         time.Time `json:"finished_on"`
	PipelineId         int       `json:"pipeline_id"`
	Namespace          string    `json:"namespace"`
	LogFilePath        string    `json:"log_file_path"`
	TriggeredBy        int32     `json:"triggered_by"`
	EmailId            string    `json:"email_id"`
	Image              string    `json:"image"`
	MaterialInfo       string    `json:"material_info,omitempty"`
	DataSource         string    `json:"data_source,omitempty"`
	CiArtifactId       int       `json:"ci_artifact_id,omitempty"`
	WorkflowType       string    `json:"workflow_type,omitempty"`
	ExecutorType       string    `json:"executor_type,omitempty"`
	BlobStorageEnabled bool      `json:"blobStorageEnabled"`
}

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"`
}

type CiBuildConfig added in v0.6.6

type CiBuildConfig struct {
	Id                   int    `sql:"id"`
	Type                 string `sql:"type"`
	CiTemplateId         int    `sql:"ci_template_id"`
	CiTemplateOverrideId int    `sql:"ci_template_override_id"`
	BuildMetadata        string `sql:"build_metadata"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiBuildConfigRepository added in v0.6.6

type CiBuildConfigRepository interface {
	Save(ciBuildConfig *CiBuildConfig) error
	Update(ciBuildConfig *CiBuildConfig) error
	Delete(ciBuildConfigId int) error
	GetCountByBuildType() (map[string]int, error)
}

type CiBuildConfigRepositoryImpl added in v0.6.6

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

func NewCiBuildConfigRepositoryImpl added in v0.6.6

func NewCiBuildConfigRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiBuildConfigRepositoryImpl

func (CiBuildConfigRepositoryImpl) Delete added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) Delete(ciBuildConfigId int) error

func (CiBuildConfigRepositoryImpl) GetCountByBuildType added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) GetCountByBuildType() (map[string]int, error)

func (CiBuildConfigRepositoryImpl) Save added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) Save(ciBuildConfig *CiBuildConfig) error

func (CiBuildConfigRepositoryImpl) Update added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) Update(ciBuildConfig *CiBuildConfig) error

type CiPipeline

type CiPipeline struct {
	Id                       int `sql:"id,pk"`
	AppId                    int `sql:"app_id"`
	App                      *app.App
	CiTemplateId             int    `sql:"ci_template_id"`
	DockerArgs               string `sql:"docker_args"`
	Name                     string `sql:"name"`
	Version                  string `sql:"version"`
	Active                   bool   `sql:"active,notnull"`
	Deleted                  bool   `sql:"deleted,notnull"`
	IsManual                 bool   `sql:"manual,notnull"`
	IsExternal               bool   `sql:"external,notnull"`
	ParentCiPipeline         int    `sql:"parent_ci_pipeline"`
	ScanEnabled              bool   `sql:"scan_enabled,notnull"`
	IsDockerConfigOverridden bool   `sql:"is_docker_config_overridden, notnull"`
	sql.AuditLog
	CiPipelineMaterials []*CiPipelineMaterial
	CiTemplate          *CiTemplate
	// contains filtered or unexported fields
}

type CiPipelineMaterial

type CiPipelineMaterial struct {
	Id            int    `sql:"id"`
	GitMaterialId int    `sql:"git_material_id"` //id stored in db GitMaterial( foreign key)
	CiPipelineId  int    `sql:"ci_pipeline_id"`
	Path          string `sql:"path"` // defaults to root of git repo
	//depricated was used in gocd remove this
	CheckoutPath string     `sql:"checkout_path"` //path where code will be checked out for single source `./` default for multiSource configured by user
	Type         SourceType `sql:"type"`
	Value        string     `sql:"value"`
	ScmId        string     `sql:"scm_id"`      //id of gocd object
	ScmName      string     `sql:"scm_name"`    //gocd scm name
	ScmVersion   string     `sql:"scm_version"` //gocd scm version
	Active       bool       `sql:"active,notnull"`
	Regex        string     `json:"regex"`
	GitTag       string     `sql:"-"`
	CiPipeline   *CiPipeline
	GitMaterial  *GitMaterial
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiPipelineMaterialRepository

type CiPipelineMaterialRepository interface {
	Save(tx *pg.Tx, pipeline ...*CiPipelineMaterial) error
	Update(tx *pg.Tx, material ...*CiPipelineMaterial) error
	FindByCiPipelineIdsIn(ids []int) ([]*CiPipelineMaterial, error)
	GetById(id int) (*CiPipelineMaterial, error)
	GetByPipelineId(id int) ([]*CiPipelineMaterial, error)
	GetRegexByPipelineId(id int) ([]*CiPipelineMaterial, error)
	CheckRegexExistsForMaterial(id int) bool
}

type CiPipelineMaterialRepositoryImpl

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

func NewCiPipelineMaterialRepositoryImpl

func NewCiPipelineMaterialRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiPipelineMaterialRepositoryImpl

func (CiPipelineMaterialRepositoryImpl) CheckRegexExistsForMaterial added in v0.4.28

func (impl CiPipelineMaterialRepositoryImpl) CheckRegexExistsForMaterial(id int) bool

func (CiPipelineMaterialRepositoryImpl) FindByCiPipelineIdsIn

func (impl CiPipelineMaterialRepositoryImpl) FindByCiPipelineIdsIn(ids []int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetById

func (CiPipelineMaterialRepositoryImpl) GetByPipelineId

func (impl CiPipelineMaterialRepositoryImpl) GetByPipelineId(id int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetRegexByPipelineId added in v0.4.28

func (impl CiPipelineMaterialRepositoryImpl) GetRegexByPipelineId(id int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) Save

func (impl CiPipelineMaterialRepositoryImpl) Save(tx *pg.Tx, material ...*CiPipelineMaterial) error

func (CiPipelineMaterialRepositoryImpl) Update

func (impl CiPipelineMaterialRepositoryImpl) Update(tx *pg.Tx, materials ...*CiPipelineMaterial) error

type CiPipelineRepository

type CiPipelineRepository interface {
	Save(pipeline *CiPipeline, tx *pg.Tx) error
	SaveExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)
	UpdateExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)
	FindExternalCiByCiPipelineId(ciPipelineId int) (*ExternalCiPipeline, error)
	FindExternalCiById(id int) (*ExternalCiPipeline, error)
	FindExternalCiByAppId(appId int) ([]*ExternalCiPipeline, error)
	FindCiScriptsByCiPipelineId(ciPipelineId int) ([]*CiPipelineScript, error)
	SaveCiPipelineScript(ciPipelineScript *CiPipelineScript, tx *pg.Tx) error
	UpdateCiPipelineScript(script *CiPipelineScript, tx *pg.Tx) error
	MarkCiPipelineScriptsInactiveByCiPipelineId(ciPipelineId int, tx *pg.Tx) error
	FindByAppId(appId int) (pipelines []*CiPipeline, err error)
	//find non deleted pipeline
	FindById(id int) (pipeline *CiPipeline, err error)
	FindByCiAndAppDetailsById(pipelineId int) (pipeline *CiPipeline, err error)
	FindByIdsIn(ids []int) ([]*CiPipeline, error)
	Update(pipeline *CiPipeline, tx *pg.Tx) error
	PipelineExistsByName(names []string) (found []string, err error)
	FindByName(pipelineName string) (pipeline *CiPipeline, err error)
	FindByParentCiPipelineId(parentCiPipelineId int) ([]*CiPipeline, error)

	FetchParentCiPipelinesForDG() ([]*CiPipelinesMap, error)
	FetchCiPipelinesForDG(parentId int, childCiPipelineIds []int) (*CiPipeline, int, error)
	FinDByParentCiPipelineAndAppId(parentCiPipeline int, appIds []int) ([]*CiPipeline, error)
	FindAllPipelineInLast24Hour() (pipelines []*CiPipeline, err error)
	FindNumberOfAppsWithCiPipeline(appIds []int) (count int, err error)
}

type CiPipelineRepositoryImpl

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

func NewCiPipelineRepositoryImpl

func NewCiPipelineRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiPipelineRepositoryImpl

func (CiPipelineRepositoryImpl) FetchCiPipelinesForDG

func (impl CiPipelineRepositoryImpl) FetchCiPipelinesForDG(parentId int, childCiPipelineIds []int) (*CiPipeline, int, error)

func (CiPipelineRepositoryImpl) FetchParentCiPipelinesForDG

func (impl CiPipelineRepositoryImpl) FetchParentCiPipelinesForDG() ([]*CiPipelinesMap, error)

func (*CiPipelineRepositoryImpl) FinDByParentCiPipelineAndAppId

func (impl *CiPipelineRepositoryImpl) FinDByParentCiPipelineAndAppId(parentCiPipeline int, appIds []int) ([]*CiPipeline, error)

func (CiPipelineRepositoryImpl) FindAllPipelineInLast24Hour added in v0.2.14

func (impl CiPipelineRepositoryImpl) FindAllPipelineInLast24Hour() (pipelines []*CiPipeline, err error)

func (CiPipelineRepositoryImpl) FindByAppId

func (impl CiPipelineRepositoryImpl) FindByAppId(appId int) (pipelines []*CiPipeline, err error)

func (CiPipelineRepositoryImpl) FindByCiAndAppDetailsById

func (impl CiPipelineRepositoryImpl) FindByCiAndAppDetailsById(pipelineId int) (pipeline *CiPipeline, err error)

func (CiPipelineRepositoryImpl) FindById

func (impl CiPipelineRepositoryImpl) FindById(id int) (pipeline *CiPipeline, err error)

func (CiPipelineRepositoryImpl) FindByIdsIn

func (impl CiPipelineRepositoryImpl) FindByIdsIn(ids []int) ([]*CiPipeline, error)

func (CiPipelineRepositoryImpl) FindByName

func (impl CiPipelineRepositoryImpl) FindByName(pipelineName string) (pipeline *CiPipeline, err error)

func (CiPipelineRepositoryImpl) FindByParentCiPipelineId

func (impl CiPipelineRepositoryImpl) FindByParentCiPipelineId(parentCiPipelineId int) ([]*CiPipeline, error)

func (CiPipelineRepositoryImpl) FindCiScriptsByCiPipelineId

func (impl CiPipelineRepositoryImpl) FindCiScriptsByCiPipelineId(ciPipelineId int) ([]*CiPipelineScript, error)

func (CiPipelineRepositoryImpl) FindExternalCiByAppId added in v0.6.9

func (impl CiPipelineRepositoryImpl) FindExternalCiByAppId(appId int) ([]*ExternalCiPipeline, error)

func (CiPipelineRepositoryImpl) FindExternalCiByCiPipelineId

func (impl CiPipelineRepositoryImpl) FindExternalCiByCiPipelineId(ciPipelineId int) (*ExternalCiPipeline, error)

func (CiPipelineRepositoryImpl) FindExternalCiById added in v0.6.9

func (impl CiPipelineRepositoryImpl) FindExternalCiById(id int) (*ExternalCiPipeline, error)

func (CiPipelineRepositoryImpl) FindNumberOfAppsWithCiPipeline added in v0.4.14

func (impl CiPipelineRepositoryImpl) FindNumberOfAppsWithCiPipeline(appIds []int) (count int, err error)

func (CiPipelineRepositoryImpl) MarkCiPipelineScriptsInactiveByCiPipelineId added in v0.4.2

func (impl CiPipelineRepositoryImpl) MarkCiPipelineScriptsInactiveByCiPipelineId(ciPipelineId int, tx *pg.Tx) error

func (CiPipelineRepositoryImpl) PipelineExistsByName

func (impl CiPipelineRepositoryImpl) PipelineExistsByName(names []string) (found []string, err error)

func (CiPipelineRepositoryImpl) Save

func (impl CiPipelineRepositoryImpl) Save(pipeline *CiPipeline, tx *pg.Tx) error

func (CiPipelineRepositoryImpl) SaveCiPipelineScript

func (impl CiPipelineRepositoryImpl) SaveCiPipelineScript(ciPipelineScript *CiPipelineScript, tx *pg.Tx) error

func (CiPipelineRepositoryImpl) SaveExternalCi

func (impl CiPipelineRepositoryImpl) SaveExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)

func (CiPipelineRepositoryImpl) Update

func (impl CiPipelineRepositoryImpl) Update(pipeline *CiPipeline, tx *pg.Tx) error

func (CiPipelineRepositoryImpl) UpdateCiPipelineScript

func (impl CiPipelineRepositoryImpl) UpdateCiPipelineScript(script *CiPipelineScript, tx *pg.Tx) error

func (CiPipelineRepositoryImpl) UpdateExternalCi

func (impl CiPipelineRepositoryImpl) UpdateExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)

type CiPipelineScript

type CiPipelineScript struct {
	Id             int    `sql:"id,pk"`
	Name           string `sql:"name"`
	Index          int    `sql:"index"`
	CiPipelineId   int    `sql:"ci_pipeline_id"`
	Script         string `sql:"script"`
	Stage          string `sql:"stage"`
	OutputLocation string `sql:"output_location"`
	Active         bool   `sql:"active,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiPipelinesMap

type CiPipelinesMap struct {
	Id               int `json:"id"`
	ParentCiPipeline int `json:"parentCiPipeline"`
}

type CiTemplate

type CiTemplate struct {
	Id                 int    `sql:"id"`
	AppId              int    `sql:"app_id"`             //foreign key of app
	DockerRegistryId   string `sql:"docker_registry_id"` //foreign key of registry
	DockerRepository   string `sql:"docker_repository"`
	DockerfilePath     string `sql:"dockerfile_path"`
	Args               string `sql:"args"` //json string format of map[string]string
	TargetPlatform     string `sql:"target_platform,notnull"`
	BeforeDockerBuild  string `sql:"before_docker_build"` //json string  format of []*Task
	AfterDockerBuild   string `sql:"after_docker_build"`  //json string  format of []*Task
	TemplateName       string `sql:"template_name"`
	Version            string `sql:"version"` //gocd etage
	Active             bool   `sql:"active,notnull"`
	GitMaterialId      int    `sql:"git_material_id"`
	DockerBuildOptions string `sql:"docker_build_options"` //json string format of map[string]string
	CiBuildConfigId    int    `sql:"ci_build_config_id"`
	sql.AuditLog
	App            *app.App
	DockerRegistry *dockerRegistryRepository.DockerArtifactStore
	GitMaterial    *GitMaterial
	CiBuildConfig  *CiBuildConfig
	// contains filtered or unexported fields
}

type CiTemplateOverride added in v0.6.0

type CiTemplateOverride struct {
	Id               int    `sql:"id"`
	CiPipelineId     int    `sql:"ci_pipeline_id"`
	DockerRegistryId string `sql:"docker_registry_id"`
	DockerRepository string `sql:"docker_repository"`
	DockerfilePath   string `sql:"dockerfile_path"`
	GitMaterialId    int    `sql:"git_material_id"`
	Active           bool   `sql:"active,notnull"`
	CiBuildConfigId  int    `sql:"ci_build_config_id"`
	sql.AuditLog
	GitMaterial    *GitMaterial
	DockerRegistry *repository.DockerArtifactStore
	CiBuildConfig  *CiBuildConfig
	// contains filtered or unexported fields
}

type CiTemplateOverrideRepository added in v0.6.0

type CiTemplateOverrideRepository interface {
	Save(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)
	Update(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)
	FindByAppId(appId int) ([]*CiTemplateOverride, error)
	FindByCiPipelineId(ciPipelineId int) (*CiTemplateOverride, error)
}

type CiTemplateOverrideRepositoryImpl added in v0.6.0

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

func NewCiTemplateOverrideRepositoryImpl added in v0.6.0

func NewCiTemplateOverrideRepositoryImpl(dbConnection *pg.DB,
	logger *zap.SugaredLogger) *CiTemplateOverrideRepositoryImpl

func (*CiTemplateOverrideRepositoryImpl) FindByAppId added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) FindByAppId(appId int) ([]*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) FindByCiPipelineId added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) FindByCiPipelineId(ciPipelineId int) (*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) Save added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) Save(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) Update added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) Update(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)

type CiTemplateRepository

type CiTemplateRepository interface {
	Save(material *CiTemplate) error
	FindByAppId(appId int) (ciTemplate *CiTemplate, err error)
	Update(material *CiTemplate) error
	FindByDockerRegistryId(dockerRegistryId string) (ciTemplates []*CiTemplate, err error)
	FindNumberOfAppsWithDockerConfigured(appIds []int) (int, error)
}

type CiTemplateRepositoryImpl

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

func NewCiTemplateRepositoryImpl

func NewCiTemplateRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiTemplateRepositoryImpl

func (CiTemplateRepositoryImpl) FindByAppId

func (impl CiTemplateRepositoryImpl) FindByAppId(appId int) (ciTemplate *CiTemplate, err error)

func (CiTemplateRepositoryImpl) FindByDockerRegistryId added in v0.3.15

func (impl CiTemplateRepositoryImpl) FindByDockerRegistryId(dockerRegistryId string) (ciTemplates []*CiTemplate, err error)

func (CiTemplateRepositoryImpl) FindNumberOfAppsWithDockerConfigured added in v0.4.14

func (impl CiTemplateRepositoryImpl) FindNumberOfAppsWithDockerConfigured(appIds []int) (int, error)

func (CiTemplateRepositoryImpl) Save

func (impl CiTemplateRepositoryImpl) Save(material *CiTemplate) error

func (CiTemplateRepositoryImpl) Update

func (impl CiTemplateRepositoryImpl) Update(material *CiTemplate) error

type CiWorkflow

type CiWorkflow struct {
	Id                 int               `sql:"id,pk"`
	Name               string            `sql:"name"`
	Status             string            `sql:"status"`
	PodStatus          string            `sql:"pod_status"`
	Message            string            `sql:"message"`
	StartedOn          time.Time         `sql:"started_on"`
	FinishedOn         time.Time         `sql:"finished_on"`
	CiPipelineId       int               `sql:"ci_pipeline_id"`
	Namespace          string            `sql:"namespace"`
	BlobStorageEnabled bool              `sql:"blob_storage_enabled,notnull"`
	LogLocation        string            `sql:"log_file_path"`
	GitTriggers        map[int]GitCommit `sql:"git_triggers"`
	TriggeredBy        int32             `sql:"triggered_by"`
	CiArtifactLocation string            `sql:"ci_artifact_location"`
	PodName            string            `sql:"pod_name"`
	CiBuildType        string            `sql:"ci_build_type"`
	CiPipeline         *CiPipeline
	// contains filtered or unexported fields
}

type CiWorkflowConfig

type CiWorkflowConfig struct {
	Id                       int    `sql:"id,pk"`
	CiTimeout                int64  `sql:"ci_timeout"`
	MinCpu                   string `sql:"min_cpu"`
	MaxCpu                   string `sql:"max_cpu"`
	MinMem                   string `sql:"min_mem"`
	MaxMem                   string `sql:"max_mem"`
	MinStorage               string `sql:"min_storage"`
	MaxStorage               string `sql:"max_storage"`
	MinEphStorage            string `sql:"min_eph_storage"`
	MaxEphStorage            string `sql:"max_eph_storage"`
	CiCacheBucket            string `sql:"ci_cache_bucket"`
	CiCacheRegion            string `sql:"ci_cache_region"`
	CiImage                  string `sql:"ci_image"`
	Namespace                string `sql:"wf_namespace"`
	CiPipelineId             int    `sql:"ci_pipeline_id"`
	LogsBucket               string `sql:"logs_bucket"`
	CiArtifactLocationFormat string `sql:"ci_artifact_location_format"`
	// contains filtered or unexported fields
}

type CiWorkflowRepository

type CiWorkflowRepository interface {
	SaveWorkFlowConfig(config *CiWorkflowConfig) error
	FindConfigByPipelineId(pipelineId int) (*CiWorkflowConfig, error)

	SaveWorkFlow(wf *CiWorkflow) error
	FindLastTriggeredWorkflow(pipelineId int) (*CiWorkflow, error)
	UpdateWorkFlow(wf *CiWorkflow) error
	FindByStatusesIn(activeStatuses []string) ([]*CiWorkflow, error)
	FindByPipelineId(pipelineId int, offset int, size int) ([]WorkflowWithArtifact, error)
	FindById(id int) (*CiWorkflow, error)
	FindByName(name string) (*CiWorkflow, error)

	FindLastTriggeredWorkflowByCiIds(pipelineId []int) (ciWorkflow []*CiWorkflow, err error)
	FindLastTriggeredWorkflowByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err error)
	ExistsByStatus(status string) (bool, error)
	FindBuildTypeAndStatusDataOfLast1Day() []*BuildTypeCount
}

type CiWorkflowRepositoryImpl

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

func NewCiWorkflowRepositoryImpl

func NewCiWorkflowRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiWorkflowRepositoryImpl

func (*CiWorkflowRepositoryImpl) ExistsByStatus added in v0.4.3

func (impl *CiWorkflowRepositoryImpl) ExistsByStatus(status string) (bool, error)

func (*CiWorkflowRepositoryImpl) FindBuildTypeAndStatusDataOfLast1Day added in v0.6.6

func (impl *CiWorkflowRepositoryImpl) FindBuildTypeAndStatusDataOfLast1Day() []*BuildTypeCount

func (*CiWorkflowRepositoryImpl) FindById

func (impl *CiWorkflowRepositoryImpl) FindById(id int) (*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindByName

func (impl *CiWorkflowRepositoryImpl) FindByName(name string) (*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindByPipelineId

func (impl *CiWorkflowRepositoryImpl) FindByPipelineId(pipelineId int, offset int, limit int) ([]WorkflowWithArtifact, error)

func (*CiWorkflowRepositoryImpl) FindByStatusesIn

func (impl *CiWorkflowRepositoryImpl) FindByStatusesIn(activeStatuses []string) ([]*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindConfigByPipelineId

func (impl *CiWorkflowRepositoryImpl) FindConfigByPipelineId(pipelineId int) (*CiWorkflowConfig, error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflow

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflow(pipelineId int) (ciWorkflow *CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByArtifactId

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByCiIds

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByCiIds(pipelineId []int) (ciWorkflow []*CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) SaveWorkFlow

func (impl *CiWorkflowRepositoryImpl) SaveWorkFlow(wf *CiWorkflow) error

func (*CiWorkflowRepositoryImpl) SaveWorkFlowConfig

func (impl *CiWorkflowRepositoryImpl) SaveWorkFlowConfig(config *CiWorkflowConfig) error

func (*CiWorkflowRepositoryImpl) UpdateWorkFlow

func (impl *CiWorkflowRepositoryImpl) UpdateWorkFlow(wf *CiWorkflow) error

type CiWorkflowStatus

type CiWorkflowStatus struct {
	CiPipelineId      int    `json:"ciPipelineId"`
	CiPipelineName    string `json:"ciPipelineName,omitempty"`
	CiStatus          string `json:"ciStatus"`
	StorageConfigured bool   `json:"storageConfigured"`
}

type ConnectedPipelinesMap

type ConnectedPipelinesMap struct {
	Id    int `json:"id"`
	Count int `json:"count"`
}

type DbMigrationConfig

type DbMigrationConfig struct {
	Id            int           `sql:"id"`
	DbConfigId    int           `sql:"db_config_id"`
	PipelineId    int           `sql:"pipeline_id"`
	GitMaterialId int           `sql:"git_material_id"`
	ScriptSource  string        `sql:"script_source"` //location of file in git. relative to git root
	MigrationTool MigrationTool `sql:"migration_tool"`
	Active        bool          `sql:"active"`
	sql.AuditLog
	DbConfig    *repository.DbConfig
	GitMaterial *GitMaterial
	// contains filtered or unexported fields
}

type DbMigrationConfigRepository

type DbMigrationConfigRepository interface {
	Save(config *DbMigrationConfig) error
	FindByPipelineId(pipelineId int) (config *DbMigrationConfig, err error)
	Update(config *DbMigrationConfig) error
}

type DbMigrationConfigRepositoryImpl

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

func NewDbMigrationConfigRepositoryImpl

func NewDbMigrationConfigRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *DbMigrationConfigRepositoryImpl

func (DbMigrationConfigRepositoryImpl) FindByPipelineId

func (impl DbMigrationConfigRepositoryImpl) FindByPipelineId(pipelineId int) (config *DbMigrationConfig, err error)

func (DbMigrationConfigRepositoryImpl) Save

func (DbMigrationConfigRepositoryImpl) Update

type DeploymentTemplate

type DeploymentTemplate string
const DEPLOYMENT_TEMPLATE_BLUE_GREEN DeploymentTemplate = "BLUE-GREEN"
const DEPLOYMENT_TEMPLATE_CANARY DeploymentTemplate = "CANARY"
const DEPLOYMENT_TEMPLATE_RECREATE DeploymentTemplate = "RECREATE"
const DEPLOYMENT_TEMPLATE_ROLLING DeploymentTemplate = "ROLLING"

type ExternalCiPipeline

type ExternalCiPipeline struct {
	Id          int    `sql:"id,pk"`
	AppId       int    `sql:"app_id"`
	Active      bool   `sql:"active,notnull"`
	AccessToken string `sql:"access_token"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type GitCommit

type GitCommit struct {
	Commit                 string //git hash
	Author                 string
	Date                   time.Time
	Message                string
	Changes                []string
	WebhookData            WebhookData
	CiConfigureSourceValue string
	GitRepoUrl             string
	GitRepoName            string
	CiConfigureSourceType  SourceType
}

type GitMaterial

type GitMaterial struct {
	Id              int    `sql:"id,pk"`
	AppId           int    `sql:"app_id,notnull"`
	GitProviderId   int    `sql:"git_provider_id,notnull"`
	Active          bool   `sql:"active,notnull"`
	Url             string `sql:"url,omitempty"`
	Name            string `sql:"name, omitempty"`
	CheckoutPath    string `sql:"checkout_path, omitempty"`
	FetchSubmodules bool   `sql:"fetch_submodules,notnull"`
	sql.AuditLog
	App         *app.App
	GitProvider *repository.GitProvider
	// contains filtered or unexported fields
}

TODO: add support for submodule

type MaterialRepository

type MaterialRepository interface {
	MaterialExists(url string) (bool, error)
	SaveMaterial(material *GitMaterial) error
	UpdateMaterial(material *GitMaterial) error
	Update(materials []*GitMaterial) error
	FindByAppId(appId int) ([]*GitMaterial, error)
	FindById(Id int) (*GitMaterial, error)
	UpdateMaterialScmId(material *GitMaterial) error
	FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)
	FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)
	MarkMaterialDeleted(material *GitMaterial) error
	FindNumberOfAppsWithGitRepo(appIds []int) (int, error)
}

type MaterialRepositoryImpl

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

func NewMaterialRepositoryImpl

func NewMaterialRepositoryImpl(dbConnection *pg.DB) *MaterialRepositoryImpl

func (MaterialRepositoryImpl) FindByAppId

func (repo MaterialRepositoryImpl) FindByAppId(appId int) ([]*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIdAndCheckoutPath added in v0.3.6

func (repo MaterialRepositoryImpl) FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindByGitProviderId added in v0.3.15

func (repo MaterialRepositoryImpl) FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)

func (MaterialRepositoryImpl) FindById

func (repo MaterialRepositoryImpl) FindById(Id int) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindNumberOfAppsWithGitRepo added in v0.4.14

func (repo MaterialRepositoryImpl) FindNumberOfAppsWithGitRepo(appIds []int) (int, error)

func (MaterialRepositoryImpl) MarkMaterialDeleted added in v0.3.15

func (repo MaterialRepositoryImpl) MarkMaterialDeleted(material *GitMaterial) error

func (MaterialRepositoryImpl) MaterialExists

func (repo MaterialRepositoryImpl) MaterialExists(url string) (bool, error)

func (MaterialRepositoryImpl) SaveMaterial

func (repo MaterialRepositoryImpl) SaveMaterial(material *GitMaterial) error

func (MaterialRepositoryImpl) Update

func (impl MaterialRepositoryImpl) Update(materials []*GitMaterial) error

func (MaterialRepositoryImpl) UpdateMaterial

func (repo MaterialRepositoryImpl) UpdateMaterial(material *GitMaterial) error

func (MaterialRepositoryImpl) UpdateMaterialScmId

func (repo MaterialRepositoryImpl) UpdateMaterialScmId(material *GitMaterial) error

type MigrationTool

type MigrationTool string
const MIGRATION_TOOL_MIGRATE MigrationTool = "migrate"

func (MigrationTool) IsValid

func (t MigrationTool) IsValid() bool

type Pipeline

type Pipeline struct {
	Id                            int `sql:"id,pk"`
	AppId                         int `sql:"app_id,notnull"`
	App                           app.App
	CiPipelineId                  int         `sql:"ci_pipeline_id"`
	TriggerType                   TriggerType `sql:"trigger_type,notnull"` // automatic, manual
	EnvironmentId                 int         `sql:"environment_id"`
	Name                          string      `sql:"pipeline_name,notnull"`
	Deleted                       bool        `sql:"deleted,notnull"`
	PreStageConfig                string      `sql:"pre_stage_config_yaml"`
	PostStageConfig               string      `sql:"post_stage_config_yaml"`
	PreTriggerType                TriggerType `sql:"pre_trigger_type"`                   // automatic, manual
	PostTriggerType               TriggerType `sql:"post_trigger_type"`                  // automatic, manual
	PreStageConfigMapSecretNames  string      `sql:"pre_stage_config_map_secret_names"`  // configmap names
	PostStageConfigMapSecretNames string      `sql:"post_stage_config_map_secret_names"` // secret names
	RunPreStageInEnv              bool        `sql:"run_pre_stage_in_env"`               // secret names
	RunPostStageInEnv             bool        `sql:"run_post_stage_in_env"`              // secret names
	DeploymentAppCreated          bool        `sql:"deployment_app_created,notnull"`
	DeploymentAppType             string      `sql:"deployment_app_type,notnull"` //helm, acd
	Environment                   repository.Environment
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineRepository

type PipelineRepository interface {
	Save(pipeline []*Pipeline, tx *pg.Tx) error
	Update(pipeline *Pipeline, tx *pg.Tx) error
	FindActiveByAppId(appId int) (pipelines []*Pipeline, err error)
	Delete(id int, tx *pg.Tx) error
	FindByName(pipelineName string) (pipeline *Pipeline, err error)
	PipelineExists(pipelineName string) (bool, error)
	FindById(id int) (pipeline *Pipeline, err error)
	FindByIdsIn(ids []int) ([]*Pipeline, error)
	FindByCiPipelineIdsIn(ciPipelineIds []int) ([]*Pipeline, error)
	FindAutomaticByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)
	GetByEnvOverrideId(envOverrideId int) ([]Pipeline, error)
	GetByEnvOverrideIdAndEnvId(envOverrideId, envId int) (Pipeline, error)
	FindActiveByAppIdAndEnvironmentId(appId int, environmentId int) (pipelines []*Pipeline, err error)
	UndoDelete(id int) error
	UniqueAppEnvironmentPipelines() ([]*Pipeline, error)
	FindByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)
	FindByParentCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)
	FindByPipelineTriggerGitHash(gitHash string) (pipeline *Pipeline, err error)
	FindByIdsInAndEnvironment(ids []int, environmentId int) ([]*Pipeline, error)
	FindActiveByAppIdAndEnvironmentIdV2() (pipelines []*Pipeline, err error)
	GetConnection() *pg.DB
	FindAllPipelineInLast24Hour() (pipelines []*Pipeline, err error)
	FindActiveByEnvId(envId int) (pipelines []*Pipeline, err error)
	FindActiveByInFilter(envId int, appIdIncludes []int) (pipelines []*Pipeline, err error)
	FindActiveByNotFilter(envId int, appIdExcludes []int) (pipelines []*Pipeline, err error)
	FindAllPipelinesByChartsOverrideAndAppIdAndChartId(chartOverridden bool, appId int, chartId int) (pipelines []*Pipeline, err error)
	FindActiveByAppIdAndPipelineId(appId int, pipelineId int) ([]*Pipeline, error)
	UpdateCdPipeline(pipeline *Pipeline) error
	FindNumberOfAppsWithCdPipeline(appIds []int) (count int, err error)
	GetAppAndEnvDetailsForDeploymentAppTypePipeline(deploymentAppType string, clusterIds []int) ([]*Pipeline, error)
	GetPipelineIdsHavingStatusTimelinesPendingAfterKubectlApplyStatus(pendingSinceSeconds int) ([]int, error)
	FindIdsByAppIdsAndEnvironmentIds(appIds, environmentIds []int) (ids []int, err error)
	FindIdsByProjectIdsAndEnvironmentIds(projectIds, environmentIds []int) ([]int, error)
}

type PipelineRepositoryImpl

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

func NewPipelineRepositoryImpl

func NewPipelineRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *PipelineRepositoryImpl

func (PipelineRepositoryImpl) Delete

func (impl PipelineRepositoryImpl) Delete(id int, tx *pg.Tx) error

func (PipelineRepositoryImpl) FindActiveByAppId

func (impl PipelineRepositoryImpl) FindActiveByAppId(appId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentId

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentId(appId int, environmentId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentIdV2

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentIdV2() (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndPipelineId added in v0.4.8

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndPipelineId(appId int, pipelineId int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindActiveByEnvId added in v0.3.15

func (impl PipelineRepositoryImpl) FindActiveByEnvId(envId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByInFilter added in v0.6.1

func (impl PipelineRepositoryImpl) FindActiveByInFilter(envId int, appIdIncludes []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByNotFilter added in v0.6.1

func (impl PipelineRepositoryImpl) FindActiveByNotFilter(envId int, appIdExcludes []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindAllPipelineInLast24Hour added in v0.2.14

func (impl PipelineRepositoryImpl) FindAllPipelineInLast24Hour() (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindAllPipelinesByChartsOverrideAndAppIdAndChartId added in v0.3.21

func (impl PipelineRepositoryImpl) FindAllPipelinesByChartsOverrideAndAppIdAndChartId(hasConfigOverridden bool, appId int, chartId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindAutomaticByCiPipelineId

func (impl PipelineRepositoryImpl) FindAutomaticByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindByCiPipelineId

func (impl PipelineRepositoryImpl) FindByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindByCiPipelineIdsIn

func (impl PipelineRepositoryImpl) FindByCiPipelineIdsIn(ciPipelineIds []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByEnvOverrideId deprecated

func (impl PipelineRepositoryImpl) FindByEnvOverrideId(envOverrideId int) (pipeline []Pipeline, err error)

Deprecated:

func (PipelineRepositoryImpl) FindById

func (impl PipelineRepositoryImpl) FindById(id int) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindByIdsIn

func (impl PipelineRepositoryImpl) FindByIdsIn(ids []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByIdsInAndEnvironment

func (impl PipelineRepositoryImpl) FindByIdsInAndEnvironment(ids []int, environmentId int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByName

func (impl PipelineRepositoryImpl) FindByName(pipelineName string) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindByParentCiPipelineId added in v0.3.12

func (impl PipelineRepositoryImpl) FindByParentCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindByPipelineTriggerGitHash

func (impl PipelineRepositoryImpl) FindByPipelineTriggerGitHash(gitHash string) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindIdsByAppIdsAndEnvironmentIds added in v0.6.4

func (impl PipelineRepositoryImpl) FindIdsByAppIdsAndEnvironmentIds(appIds, environmentIds []int) ([]int, error)

func (PipelineRepositoryImpl) FindIdsByProjectIdsAndEnvironmentIds added in v0.6.4

func (impl PipelineRepositoryImpl) FindIdsByProjectIdsAndEnvironmentIds(projectIds, environmentIds []int) ([]int, error)

func (PipelineRepositoryImpl) FindNumberOfAppsWithCdPipeline added in v0.4.14

func (impl PipelineRepositoryImpl) FindNumberOfAppsWithCdPipeline(appIds []int) (count int, err error)

func (PipelineRepositoryImpl) GetAppAndEnvDetailsForDeploymentAppTypePipeline added in v0.4.15

func (impl PipelineRepositoryImpl) GetAppAndEnvDetailsForDeploymentAppTypePipeline(deploymentAppType string, clusterIds []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) GetByEnvOverrideId

func (impl PipelineRepositoryImpl) GetByEnvOverrideId(envOverrideId int) ([]Pipeline, error)

func (PipelineRepositoryImpl) GetByEnvOverrideIdAndEnvId added in v0.3.21

func (impl PipelineRepositoryImpl) GetByEnvOverrideIdAndEnvId(envOverrideId, envId int) (Pipeline, error)

func (PipelineRepositoryImpl) GetConnection

func (impl PipelineRepositoryImpl) GetConnection() *pg.DB

func (PipelineRepositoryImpl) GetPipelineIdsHavingStatusTimelinesPendingAfterKubectlApplyStatus added in v0.6.4

func (impl PipelineRepositoryImpl) GetPipelineIdsHavingStatusTimelinesPendingAfterKubectlApplyStatus(pendingSinceSeconds int) ([]int, error)

func (PipelineRepositoryImpl) PipelineExists

func (impl PipelineRepositoryImpl) PipelineExists(pipelineName string) (bool, error)

func (PipelineRepositoryImpl) Save

func (impl PipelineRepositoryImpl) Save(pipeline []*Pipeline, tx *pg.Tx) error

func (PipelineRepositoryImpl) UndoDelete

func (impl PipelineRepositoryImpl) UndoDelete(id int) error

func (PipelineRepositoryImpl) UniqueAppEnvironmentPipelines

func (impl PipelineRepositoryImpl) UniqueAppEnvironmentPipelines() ([]*Pipeline, error)

func (PipelineRepositoryImpl) Update

func (impl PipelineRepositoryImpl) Update(pipeline *Pipeline, tx *pg.Tx) error

func (PipelineRepositoryImpl) UpdateCdPipeline added in v0.4.5

func (impl PipelineRepositoryImpl) UpdateCdPipeline(pipeline *Pipeline) error

type PipelineStatusTimeline added in v0.4.28

type PipelineStatusTimeline struct {
	Id                           int            `sql:"id,pk"`
	InstalledAppVersionHistoryId int            `sql:"installed_app_version_history_id"`
	CdWorkflowRunnerId           int            `sql:"cd_workflow_runner_id"`
	Status                       TimelineStatus `sql:"status"`
	StatusDetail                 string         `sql:"status_detail"`
	StatusTime                   time.Time      `sql:"status_time"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStatusTimelineRepository added in v0.4.28

type PipelineStatusTimelineRepository interface {
	SaveTimeline(timeline *PipelineStatusTimeline) error
	SaveTimelinesWithTxn(timelines []PipelineStatusTimeline, tx *pg.Tx) error
	UpdateTimeline(timeline *PipelineStatusTimeline) error
	FetchTimelinesByPipelineId(pipelineId int) ([]*PipelineStatusTimeline, error)
	FetchTimelinesByWfrId(wfrId int) ([]*PipelineStatusTimeline, error)
	FetchTimelineOfLatestWfByCdWorkflowIdAndStatus(pipelineId int, status TimelineStatus) (*PipelineStatusTimeline, error)
	FetchTimelineByWfrIdAndStatus(wfrId int, status TimelineStatus) (*PipelineStatusTimeline, error)
	CheckIfTerminalStatusTimelinePresentByWfrId(wfrId int) (bool, error)
	FetchLatestTimelineByAppIdAndEnvId(appId, envId int) (*PipelineStatusTimeline, error)
}

type PipelineStatusTimelineRepositoryImpl added in v0.4.28

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

func NewPipelineStatusTimelineRepositoryImpl added in v0.4.28

func NewPipelineStatusTimelineRepositoryImpl(dbConnection *pg.DB,
	logger *zap.SugaredLogger) *PipelineStatusTimelineRepositoryImpl

func (*PipelineStatusTimelineRepositoryImpl) CheckIfTerminalStatusTimelinePresentByWfrId added in v0.5.1

func (impl *PipelineStatusTimelineRepositoryImpl) CheckIfTerminalStatusTimelinePresentByWfrId(wfrId int) (bool, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchLatestTimelineByAppIdAndEnvId added in v0.6.4

func (impl *PipelineStatusTimelineRepositoryImpl) FetchLatestTimelineByAppIdAndEnvId(appId, envId int) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatus added in v0.5.1

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatus(wfrId int, status TimelineStatus) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineOfLatestWfByCdWorkflowIdAndStatus added in v0.4.28

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineOfLatestWfByCdWorkflowIdAndStatus(cdWorkflowId int, status TimelineStatus) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelinesByPipelineId added in v0.4.28

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelinesByPipelineId(pipelineId int) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelinesByWfrId added in v0.4.28

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelinesByWfrId(wfrId int) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) SaveTimeline added in v0.4.28

func (*PipelineStatusTimelineRepositoryImpl) SaveTimelinesWithTxn added in v0.5.1

func (impl *PipelineStatusTimelineRepositoryImpl) SaveTimelinesWithTxn(timelines []PipelineStatusTimeline, tx *pg.Tx) error

func (*PipelineStatusTimelineRepositoryImpl) UpdateTimeline added in v0.4.28

func (impl *PipelineStatusTimelineRepositoryImpl) UpdateTimeline(timeline *PipelineStatusTimeline) error

type PipelineType

type PipelineType string

type SourceType

type SourceType string
const (
	SOURCE_TYPE_BRANCH_FIXED SourceType = "SOURCE_TYPE_BRANCH_FIXED"
	SOURCE_TYPE_BRANCH_REGEX SourceType = "SOURCE_TYPE_BRANCH_REGEX"
	SOURCE_TYPE_TAG_ANY      SourceType = "SOURCE_TYPE_TAG_ANY"
	SOURCE_TYPE_WEBHOOK      SourceType = "WEBHOOK"
)

type TimelineStatus added in v0.4.28

type TimelineStatus string
const (
	TIMELINE_STATUS_DEPLOYMENT_INITIATED  TimelineStatus = "DEPLOYMENT_INITIATED"
	TIMELINE_STATUS_GIT_COMMIT            TimelineStatus = "GIT_COMMIT"
	TIMELINE_STATUS_GIT_COMMIT_FAILED     TimelineStatus = "GIT_COMMIT_FAILED"
	TIMELINE_STATUS_KUBECTL_APPLY_STARTED TimelineStatus = "KUBECTL_APPLY_STARTED"
	TIMELINE_STATUS_KUBECTL_APPLY_SYNCED  TimelineStatus = "KUBECTL_APPLY_SYNCED"
	TIMELINE_STATUS_APP_HEALTHY           TimelineStatus = "HEALTHY"
	TIMELINE_STATUS_APP_DEGRADED          TimelineStatus = "DEGRADED"
	TIMELINE_STATUS_DEPLOYMENT_FAILED     TimelineStatus = "FAILED"
)

type TriggerType

type TriggerType string //HOW pipeline should be triggered
const TRIGGER_TYPE_AUTOMATIC TriggerType = "AUTOMATIC"
const TRIGGER_TYPE_MANUAL TriggerType = "MANUAL"

type TriggerWorkflowStatus

type TriggerWorkflowStatus struct {
	CdWorkflowStatus []*CdWorkflowStatus `json:"cdWorkflowStatus"`
	CiWorkflowStatus []*CiWorkflowStatus `json:"ciWorkflowStatus"`
}

type WebhookData added in v0.2.22

type WebhookData struct {
	Id              int
	EventActionType string
	Data            map[string]string
}

type WorkflowExecutorType

type WorkflowExecutorType string

type WorkflowStatus

type WorkflowStatus int
const (
	WF_UNKNOWN WorkflowStatus = iota
	REQUEST_ACCEPTED
	ENQUEUED
	QUE_ERROR
	WF_STARTED
	DROPPED_STALE
	DEQUE_ERROR
	TRIGGER_ERROR
)

func (WorkflowStatus) String

func (a WorkflowStatus) String() string

type WorkflowWithArtifact

type WorkflowWithArtifact struct {
	Id                 int               `json:"id"`
	Name               string            `json:"name"`
	PodName            string            `json:"podName"`
	Status             string            `json:"status"`
	PodStatus          string            `json:"pod_status"`
	Message            string            `json:"message"`
	StartedOn          time.Time         `json:"started_on"`
	FinishedOn         time.Time         `json:"finished_on"`
	CiPipelineId       int               `json:"ci_pipeline_id"`
	Namespace          string            `json:"namespace"`
	LogFilePath        string            `json:"log_file_path"`
	GitTriggers        map[int]GitCommit `json:"git_triggers"`
	TriggeredBy        int32             `json:"triggered_by"`
	EmailId            string            `json:"email_id"`
	Image              string            `json:"image"`
	CiArtifactLocation string            `json:"ci_artifact_location"`
	CiArtifactId       int               `json:"ci_artifact_d"`
	BlobStorageEnabled bool              `json:"blobStorageEnabled"`
	CiBuildType        string            `json:"ci_build_type"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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