repository

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TRIGGER_ADD    = "add"
	TRIGGER_UPDATE = "update"
	TRIGGER_DELETE = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CdStageType

type CdStageType string
const (
	PRE_CD_TYPE  CdStageType = "PRE_CD"
	POST_CD_TYPE CdStageType = "POST_CD"
)

type CiEnvMappingHistory added in v0.6.21

type CiEnvMappingHistory struct {
	Id            int `sql:"id,pk"`
	CiPipelineId  int `sql:"ci_pipeline_id"`
	EnvironmentId int `sql:"environment_id"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiPipelineHistory added in v0.6.8

type CiPipelineHistory struct {
	Id                        int    `sql:"id,pk"`
	CiPipelineId              int    `sql:"ci_pipeline_id"`
	CiTemplateOverrideHistory string `sql:"ci_template_override_history"`
	CiPipelineMaterialHistory string `sql:"ci_pipeline_material_history"`
	Trigger                   string `sql:"trigger"`
	ScanEnabled               bool   `sql:"scan_enabled,notnull"`
	Manual                    bool   `sql:"manual,notnull"`
	// contains filtered or unexported fields
}

type CiPipelineHistoryRepository added in v0.6.8

type CiPipelineHistoryRepository interface {
	Save(ciPipelineHistory *CiPipelineHistory) error
	SaveCiEnvMappingHistory(CiEnvMappingHistory *CiEnvMappingHistory) error
}

type CiPipelineHistoryRepositoryImpl added in v0.6.8

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

func NewCiPipelineHistoryRepositoryImpl added in v0.6.8

func NewCiPipelineHistoryRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiPipelineHistoryRepositoryImpl

func (*CiPipelineHistoryRepositoryImpl) Save added in v0.6.8

func (impl *CiPipelineHistoryRepositoryImpl) Save(CiPipelineHistory *CiPipelineHistory) error

func (*CiPipelineHistoryRepositoryImpl) SaveCiEnvMappingHistory added in v0.6.21

func (impl *CiPipelineHistoryRepositoryImpl) SaveCiEnvMappingHistory(CiEnvMappingHistory *CiEnvMappingHistory) error

type CiPipelineMaterialHistoryDTO added in v0.6.8

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

type CiPipelineTemplateOverrideHistoryDTO added in v0.6.8

type CiPipelineTemplateOverrideHistoryDTO struct {
	DockerRegistryId      string `json:"docker_registry_id"`
	DockerRepository      string `json:"docker_repository"`
	DockerfilePath        string `json:"dockerfile_path"`
	Active                bool   `json:"active,notnull"`
	CiBuildConfigId       int    `json:"ci_build_config_id"`
	BuildMetaDataType     string `json:"build_meta_data_type"`
	BuildMetadata         string `json:"build_metadata"`
	IsCiTemplateOverriden bool   `json:"is_ci_template_overriden"`
	sql.AuditLog
}

type CiTemplateHistory added in v0.6.8

type CiTemplateHistory struct {
	Id                 int     `sql:"id,pk"`
	CiTemplateId       int     `sql:"ci_template_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"`
	BuildMetaDataType  string  `sql:"build_meta_data_type"`
	BuildMetadata      string  `sql:"build_metadata"`
	Trigger            string  `sql:"trigger"`
	sql.AuditLog
	App            *app.App
	DockerRegistry *repository2.DockerArtifactStore
	// contains filtered or unexported fields
}

type CiTemplateHistoryRepository added in v0.6.8

type CiTemplateHistoryRepository interface {
	Save(material *CiTemplateHistory) error
}

type CiTemplateHistoryRepositoryImpl added in v0.6.8

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

func NewCiTemplateHistoryRepositoryImpl added in v0.6.8

func NewCiTemplateHistoryRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiTemplateHistoryRepositoryImpl

func (CiTemplateHistoryRepositoryImpl) Save added in v0.6.8

type ConfigMapHistoryRepository

type ConfigMapHistoryRepository interface {
	sql.TransactionWrapper
	CreateHistory(tx *pg.Tx, model *ConfigmapAndSecretHistory) (*ConfigmapAndSecretHistory, error)
	GetHistoryForDeployedCMCSById(id, pipelineId int, configType ConfigType) (*ConfigmapAndSecretHistory, error)
	GetHistoryByPipelineIdAndWfrId(pipelineId, wfrId int, configType ConfigType) (*ConfigmapAndSecretHistory, error)
	GetDeployedHistoryForPipelineIdOnTime(pipelineId int, deployedOn time.Time, configType ConfigType) (*ConfigmapAndSecretHistory, error)
	GetDeployedHistoryList(pipelineId, baseConfigId int, configType ConfigType, componentName string) ([]*ConfigmapAndSecretHistory, error)
}

type ConfigMapHistoryRepositoryImpl

type ConfigMapHistoryRepositoryImpl struct {
	*sql.TransactionUtilImpl
	// contains filtered or unexported fields
}

func NewConfigMapHistoryRepositoryImpl

func NewConfigMapHistoryRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB, transactionUtilImpl *sql.TransactionUtilImpl) *ConfigMapHistoryRepositoryImpl

func (ConfigMapHistoryRepositoryImpl) CreateHistory

func (ConfigMapHistoryRepositoryImpl) GetDeployedHistoryForPipelineIdOnTime added in v0.7.1

func (impl ConfigMapHistoryRepositoryImpl) GetDeployedHistoryForPipelineIdOnTime(pipelineId int, deployedOn time.Time, configType ConfigType) (*ConfigmapAndSecretHistory, error)

func (ConfigMapHistoryRepositoryImpl) GetDeployedHistoryList added in v0.4.4

func (impl ConfigMapHistoryRepositoryImpl) GetDeployedHistoryList(pipelineId, baseConfigId int, configType ConfigType, componentName string) ([]*ConfigmapAndSecretHistory, error)

func (ConfigMapHistoryRepositoryImpl) GetHistoryByPipelineIdAndWfrId added in v0.4.4

func (impl ConfigMapHistoryRepositoryImpl) GetHistoryByPipelineIdAndWfrId(pipelineId, wfrId int, configType ConfigType) (*ConfigmapAndSecretHistory, error)

func (ConfigMapHistoryRepositoryImpl) GetHistoryForDeployedCMCSById

func (impl ConfigMapHistoryRepositoryImpl) GetHistoryForDeployedCMCSById(id, pipelineId int, configType ConfigType) (*ConfigmapAndSecretHistory, error)

type ConfigType

type ConfigType string
const (
	CONFIGMAP_TYPE ConfigType = "CONFIGMAP"
	SECRET_TYPE    ConfigType = "SECRET"
)

type ConfigmapAndSecretHistory

type ConfigmapAndSecretHistory struct {
	TableName  struct{}   `sql:"config_map_history" pg:",discard_unknown_columns"`
	Id         int        `sql:"id,pk"`
	PipelineId int        `sql:"pipeline_id"`
	AppId      int        `sql:"app_id"`
	DataType   ConfigType `sql:"data_type"`
	Data       string     `sql:"data"`
	Deployed   bool       `sql:"deployed"`
	DeployedOn time.Time  `sql:"deployed_on"`
	DeployedBy int32      `sql:"deployed_by"`
	sql.AuditLog
	//getting below data from cd_workflow_runner join
	DeploymentStatus  string `sql:"-"`
	DeployedByEmailId string `sql:"-"`
}

func (*ConfigmapAndSecretHistory) IsConfigmapHistoryConfigMapType added in v1.0.0

func (r *ConfigmapAndSecretHistory) IsConfigmapHistoryConfigMapType() bool

func (*ConfigmapAndSecretHistory) IsConfigmapHistorySecretType added in v1.0.0

func (r *ConfigmapAndSecretHistory) IsConfigmapHistorySecretType() bool

type DeploymentTemplateHistory

type DeploymentTemplateHistory struct {
	Id                      int       `sql:"id,pk"`
	PipelineId              int       `sql:"pipeline_id"`
	AppId                   int       `sql:"app_id"`
	ImageDescriptorTemplate string    `sql:"image_descriptor_template"`
	Template                string    `sql:"template"`
	TargetEnvironment       int       `sql:"target_environment"`
	TemplateName            string    `sql:"template_name"`
	TemplateVersion         string    `sql:"template_version"`
	IsAppMetricsEnabled     bool      `sql:"is_app_metrics_enabled,notnull"`
	Deployed                bool      `sql:"deployed"`
	DeployedOn              time.Time `sql:"deployed_on"`
	DeployedBy              int32     `sql:"deployed_by"`
	MergeStrategy           string    `sql:"merge_strategy"`
	sql.AuditLog
	//getting below data from cd_workflow_runner and users join
	DeploymentStatus  string `sql:"-"`
	DeployedByEmailId string `sql:"-"`
	// contains filtered or unexported fields
}

type DeploymentTemplateHistoryRepository

type DeploymentTemplateHistoryRepository interface {
	CreateHistory(chart *DeploymentTemplateHistory) (*DeploymentTemplateHistory, error)
	CreateHistoryWithTxn(chart *DeploymentTemplateHistory, tx *pg.Tx) (*DeploymentTemplateHistory, error)
	GetHistoryForDeployedTemplateById(id, pipelineId int) (*DeploymentTemplateHistory, error)
	GetHistoryByPipelineIdAndWfrId(pipelineId, wfrId int) (*DeploymentTemplateHistory, error)
	GetDeployedHistoryForPipelineIdOnTime(pipelineId int, deployedOn time.Time) (*DeploymentTemplateHistory, error)
	GetDeployedHistoryList(pipelineId, baseConfigId int) ([]*DeploymentTemplateHistory, error)
	GetDeployedOnByDeploymentTemplateAndPipelineId(id, pipelineId int) (time.Time, error)
}

type DeploymentTemplateHistoryRepositoryImpl

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

func NewDeploymentTemplateHistoryRepositoryImpl

func NewDeploymentTemplateHistoryRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB) *DeploymentTemplateHistoryRepositoryImpl

func (DeploymentTemplateHistoryRepositoryImpl) CreateHistory

func (DeploymentTemplateHistoryRepositoryImpl) CreateHistoryWithTxn

func (DeploymentTemplateHistoryRepositoryImpl) GetDeployedHistoryForPipelineIdOnTime added in v0.7.1

func (impl DeploymentTemplateHistoryRepositoryImpl) GetDeployedHistoryForPipelineIdOnTime(pipelineId int, deployedOn time.Time) (*DeploymentTemplateHistory, error)

func (DeploymentTemplateHistoryRepositoryImpl) GetDeployedHistoryList added in v0.4.4

func (impl DeploymentTemplateHistoryRepositoryImpl) GetDeployedHistoryList(pipelineId, baseConfigId int) ([]*DeploymentTemplateHistory, error)

func (DeploymentTemplateHistoryRepositoryImpl) GetDeployedOnByDeploymentTemplateAndPipelineId added in v1.1.0

func (impl DeploymentTemplateHistoryRepositoryImpl) GetDeployedOnByDeploymentTemplateAndPipelineId(id, pipelineId int) (time.Time, error)

func (DeploymentTemplateHistoryRepositoryImpl) GetHistoryByPipelineIdAndWfrId added in v0.4.4

func (impl DeploymentTemplateHistoryRepositoryImpl) GetHistoryByPipelineIdAndWfrId(pipelineId, wfrId int) (*DeploymentTemplateHistory, error)

func (DeploymentTemplateHistoryRepositoryImpl) GetHistoryForDeployedTemplateById

func (impl DeploymentTemplateHistoryRepositoryImpl) GetHistoryForDeployedTemplateById(id, pipelineId int) (*DeploymentTemplateHistory, error)

type GitMaterialHistory added in v0.6.8

type GitMaterialHistory struct {
	Id              int      `sql:"id,pk"`
	GitMaterialId   int      `sql:"git_material_id"`
	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"`
	FilterPattern   []string `sql:"filter_pattern"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type GitMaterialHistoryRepository added in v0.6.8

type GitMaterialHistoryRepository interface {
	SaveGitMaterialHistory(tx *pg.Tx, material *GitMaterialHistory) error
	SaveDeleteMaterialHistory(materials []*GitMaterialHistory) error
}

type GitMaterialHistoryRepositoryImpl added in v0.6.8

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

func NewGitMaterialHistoryRepositoyImpl added in v0.6.8

func NewGitMaterialHistoryRepositoyImpl(dbConnection *pg.DB) *GitMaterialHistoryRepositoryImpl

func (GitMaterialHistoryRepositoryImpl) SaveDeleteMaterialHistory added in v0.6.8

func (repo GitMaterialHistoryRepositoryImpl) SaveDeleteMaterialHistory(materials []*GitMaterialHistory) error

func (GitMaterialHistoryRepositoryImpl) SaveGitMaterialHistory added in v0.6.8

func (repo GitMaterialHistoryRepositoryImpl) SaveGitMaterialHistory(tx *pg.Tx, material *GitMaterialHistory) error

type PipelineStrategyHistory

type PipelineStrategyHistory struct {
	TableName           struct{}                               `sql:"pipeline_strategy_history" pg:",discard_unknown_columns"`
	Id                  int                                    `sql:"id,pk"`
	PipelineId          int                                    `sql:"pipeline_id, notnull"`
	Strategy            chartRepoRepository.DeploymentStrategy `sql:"strategy,notnull"`
	Config              string                                 `sql:"config"`
	Default             bool                                   `sql:"default,notnull"`
	Deployed            bool                                   `sql:"deployed"`
	DeployedOn          time.Time                              `sql:"deployed_on"`
	DeployedBy          int32                                  `sql:"deployed_by"`
	PipelineTriggerType pipelineConfig.TriggerType             `sql:"pipeline_trigger_type"`
	sql.AuditLog
	//getting below data from cd_workflow_runner and users join
	DeploymentStatus  string `sql:"-"`
	DeployedByEmailId string `sql:"-"`
}

type PipelineStrategyHistoryRepository

type PipelineStrategyHistoryRepository interface {
	CreateHistory(model *PipelineStrategyHistory) (*PipelineStrategyHistory, error)
	CreateHistoryWithTxn(model *PipelineStrategyHistory, tx *pg.Tx) (*PipelineStrategyHistory, error)
	GetHistoryForDeployedStrategyById(id, pipelineId int) (*PipelineStrategyHistory, error)
	GetDeploymentDetailsForDeployedStrategyHistory(pipelineId int) ([]*PipelineStrategyHistory, error)
	GetHistoryByPipelineIdAndWfrId(ctx context.Context, pipelineId, wfrId int) (*PipelineStrategyHistory, error)
	CheckIfTriggerHistoryExistsForPipelineIdOnTime(pipelineId int, deployedOn time.Time) (bool, error)
	GetDeployedHistoryList(pipelineId, baseConfigId int) ([]*PipelineStrategyHistory, error)
}

type PipelineStrategyHistoryRepositoryImpl

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

func NewPipelineStrategyHistoryRepositoryImpl

func NewPipelineStrategyHistoryRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB) *PipelineStrategyHistoryRepositoryImpl

func (PipelineStrategyHistoryRepositoryImpl) CheckIfTriggerHistoryExistsForPipelineIdOnTime added in v0.7.1

func (impl PipelineStrategyHistoryRepositoryImpl) CheckIfTriggerHistoryExistsForPipelineIdOnTime(pipelineId int, deployedOn time.Time) (bool, error)

func (PipelineStrategyHistoryRepositoryImpl) CreateHistory

func (PipelineStrategyHistoryRepositoryImpl) CreateHistoryWithTxn

func (PipelineStrategyHistoryRepositoryImpl) GetDeployedHistoryList added in v0.4.4

func (impl PipelineStrategyHistoryRepositoryImpl) GetDeployedHistoryList(pipelineId, baseConfigId int) ([]*PipelineStrategyHistory, error)

func (PipelineStrategyHistoryRepositoryImpl) GetDeploymentDetailsForDeployedStrategyHistory

func (impl PipelineStrategyHistoryRepositoryImpl) GetDeploymentDetailsForDeployedStrategyHistory(pipelineId int) ([]*PipelineStrategyHistory, error)

func (PipelineStrategyHistoryRepositoryImpl) GetHistoryByPipelineIdAndWfrId added in v0.4.4

func (impl PipelineStrategyHistoryRepositoryImpl) GetHistoryByPipelineIdAndWfrId(ctx context.Context, pipelineId, wfrId int) (*PipelineStrategyHistory, error)

func (PipelineStrategyHistoryRepositoryImpl) GetHistoryForDeployedStrategyById

func (impl PipelineStrategyHistoryRepositoryImpl) GetHistoryForDeployedStrategyById(id, pipelineId int) (*PipelineStrategyHistory, error)

type PrePostCdScriptHistory

type PrePostCdScriptHistory struct {
	Id                   int                        `sql:"id,pk"`
	PipelineId           int                        `sql:"pipeline_id, notnull"`
	Script               string                     `sql:"script"`
	Stage                CdStageType                `sql:"stage"`
	TriggerType          pipelineConfig.TriggerType `sql:"trigger_type"`
	ConfigMapSecretNames string                     `sql:"configmap_secret_names"`
	ConfigMapData        string                     `sql:"configmap_data"`
	SecretData           string                     `sql:"secret_data"`
	ExecInEnv            bool                       `sql:"exec_in_env,notnull"`
	Deployed             bool                       `sql:"deployed"`
	DeployedOn           time.Time                  `sql:"deployed_on"`
	DeployedBy           int32                      `sql:"deployed_by"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PrePostCdScriptHistoryRepository

type PrePostCdScriptHistoryRepository interface {
	CreateHistoryWithTxn(history *PrePostCdScriptHistory, tx *pg.Tx) (*PrePostCdScriptHistory, error)
	CreateHistory(history *PrePostCdScriptHistory) (*PrePostCdScriptHistory, error)
	GetHistoryForDeployedPrePostScriptByStage(pipelineId int, stage CdStageType) ([]*PrePostCdScriptHistory, error)
}

type PrePostCdScriptHistoryRepositoryImpl

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

func NewPrePostCdScriptHistoryRepositoryImpl

func NewPrePostCdScriptHistoryRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB) *PrePostCdScriptHistoryRepositoryImpl

func (PrePostCdScriptHistoryRepositoryImpl) CreateHistory

func (PrePostCdScriptHistoryRepositoryImpl) CreateHistoryWithTxn

func (PrePostCdScriptHistoryRepositoryImpl) GetHistoryForDeployedPrePostScriptByStage

func (impl PrePostCdScriptHistoryRepositoryImpl) GetHistoryForDeployedPrePostScriptByStage(pipelineId int, stage CdStageType) ([]*PrePostCdScriptHistory, error)

type PrePostCiScriptHistory

type PrePostCiScriptHistory struct {
	Id                  int       `sql:"id,pk"`
	CiPipelineScriptsId int       `sql:"ci_pipeline_scripts_id, notnull"`
	Script              string    `sql:"script"`
	Stage               string    `sql:"stage"`
	Name                string    `sql:"name"`
	OutputLocation      string    `sql:"output_location"`
	Built               bool      `sql:"built"`
	BuiltOn             time.Time `sql:"built_on"`
	BuiltBy             int32     `sql:"built_by"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PrePostCiScriptHistoryRepository

type PrePostCiScriptHistoryRepository interface {
	CreateHistoryWithTxn(history *PrePostCiScriptHistory, tx *pg.Tx) (*PrePostCiScriptHistory, error)
	CreateHistory(history *PrePostCiScriptHistory) (*PrePostCiScriptHistory, error)
}

type PrePostCiScriptHistoryRepositoryImpl

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

func NewPrePostCiScriptHistoryRepositoryImpl

func NewPrePostCiScriptHistoryRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB) *PrePostCiScriptHistoryRepositoryImpl

func (PrePostCiScriptHistoryRepositoryImpl) CreateHistory

func (PrePostCiScriptHistoryRepositoryImpl) CreateHistoryWithTxn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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