repository

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PIPELINE_STAGE_TYPE_PRE_CI                       PipelineStageType                   = "PRE_CI"
	PIPELINE_STAGE_TYPE_POST_CI                      PipelineStageType                   = "POST_CI"
	PIPELINE_STAGE_TYPE_PRE_CD                       PipelineStageType                   = "PRE_CD"
	PIPELINE_STAGE_TYPE_POST_CD                      PipelineStageType                   = "POST_CD"
	PIPELINE_STEP_TYPE_INLINE                        PipelineStepType                    = "INLINE"
	PIPELINE_STEP_TYPE_REF_PLUGIN                    PipelineStepType                    = "REF_PLUGIN"
	PIPELINE_STAGE_STEP_VARIABLE_TYPE_INPUT          PipelineStageStepVariableType       = "INPUT"
	PIPELINE_STAGE_STEP_VARIABLE_TYPE_OUTPUT         PipelineStageStepVariableType       = "OUTPUT"
	PIPELINE_STAGE_STEP_VARIABLE_VALUE_TYPE_NEW      PipelineStageStepVariableValueType  = "NEW"
	PIPELINE_STAGE_STEP_VARIABLE_VALUE_TYPE_PREVIOUS PipelineStageStepVariableValueType  = "FROM_PREVIOUS_STEP"
	PIPELINE_STAGE_STEP_VARIABLE_VALUE_TYPE_GLOBAL   PipelineStageStepVariableValueType  = "GLOBAL"
	PIPELINE_STAGE_STEP_CONDITION_TYPE_SKIP          PipelineStageStepConditionType      = "SKIP"
	PIPELINE_STAGE_STEP_CONDITION_TYPE_TRIGGER       PipelineStageStepConditionType      = "TRIGGER"
	PIPELINE_STAGE_STEP_CONDITION_TYPE_SUCCESS       PipelineStageStepConditionType      = "SUCCESS"
	PIPELINE_STAGE_STEP_CONDITION_TYPE_FAIL          PipelineStageStepConditionType      = "FAIL"
	PIPELINE_STAGE_STEP_VARIABLE_FORMAT_TYPE_STRING  PipelineStageStepVariableFormatType = "STRING"
	PIPELINE_STAGE_STEP_VARIABLE_FORMAT_TYPE_NUMBER  PipelineStageStepVariableFormatType = "NUMBER"
	PIPELINE_STAGE_STEP_VARIABLE_FORMAT_TYPE_BOOL    PipelineStageStepVariableFormatType = "BOOL"
	PIPELINE_STAGE_STEP_VARIABLE_FORMAT_TYPE_DATE    PipelineStageStepVariableFormatType = "DATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PipelineStage

type PipelineStage struct {
	Id           int               `sql:"id,pk"`
	Name         string            `sql:"name"`
	Description  string            `sql:"description"`
	Type         PipelineStageType `sql:"type"`
	Deleted      bool              `sql:"deleted, notnull"`
	CiPipelineId int               `sql:"ci_pipeline_id"`
	CdPipelineId int               `sql:"cd_pipeline_id"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStageRepository

type PipelineStageRepository interface {
	GetConnection() *pg.DB

	CreateCiStage(ciStage *PipelineStage) (*PipelineStage, error)
	UpdateCiStage(ciStage *PipelineStage) (*PipelineStage, error)
	MarkCiStageDeletedById(ciStageId int, updatedBy int32, tx *pg.Tx) error
	GetAllCiStagesByCiPipelineId(ciPipelineId int) ([]*PipelineStage, error)
	GetCiStageByCiPipelineIdAndStageType(ciPipelineId int, stageType PipelineStageType) (*PipelineStage, error)

	GetStepIdsByStageId(stageId int) ([]int, error)
	CreatePipelineStageStep(step *PipelineStageStep) (*PipelineStageStep, error)
	UpdatePipelineStageStep(step *PipelineStageStep) (*PipelineStageStep, error)
	MarkCiStageStepsDeletedByStageId(ciStageId int, updatedBy int32, tx *pg.Tx) error
	GetAllStepsByStageId(stageId int) ([]*PipelineStageStep, error)
	GetStepById(stepId int) (*PipelineStageStep, error)
	MarkStepsDeletedByStageId(stageId int) error
	MarkStepsDeletedExcludingActiveStepsInUpdateReq(activeStepIdsPresentInReq []int, stageId int) error

	CreatePipelineScript(pipelineScript *PluginPipelineScript) (*PluginPipelineScript, error)
	UpdatePipelineScript(pipelineScript *PluginPipelineScript) (*PluginPipelineScript, error)
	GetScriptIdsByStageId(stageId int) ([]int, error)
	MarkPipelineScriptsDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error
	GetScriptDetailById(id int) (*PluginPipelineScript, error)
	MarkScriptDeletedById(scriptId int) error

	MarkScriptMappingDeletedByScriptId(scriptId int) error
	CreateScriptMapping(mappings []ScriptPathArgPortMapping) error
	GetScriptMappingIdsByStageId(stageId int) ([]int, error)
	MarkPipelineScriptMappingsDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error
	GetScriptMappingDetailByScriptId(scriptId int) ([]*ScriptPathArgPortMapping, error)
	CheckIfFilePathMappingExists(filePathOnDisk string, filePathOnContainer string, scriptId int) (bool, error)
	CheckIfCommandArgMappingExists(command string, arg string, scriptId int) (bool, error)
	CheckIfPortMappingExists(portOnLocal int, portOnContainer int, scriptId int) (bool, error)

	CreatePipelineStageStepVariables([]PipelineStageStepVariable, *pg.Tx) ([]PipelineStageStepVariable, error)
	UpdatePipelineStageStepVariables(variables []PipelineStageStepVariable, tx *pg.Tx) ([]PipelineStageStepVariable, error)
	GetVariableIdsByStageId(stageId int) ([]int, error)
	MarkPipelineStageStepVariablesDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error
	GetVariablesByStepId(stepId int) ([]*PipelineStageStepVariable, error)
	GetVariableIdsByStepIdAndVariableType(stepId int, variableType PipelineStageStepVariableType) ([]int, error)
	MarkVariablesDeletedByStepIdAndVariableType(stepId int, variableType PipelineStageStepVariableType, tx *pg.Tx) error
	MarkVariablesDeletedExcludingActiveVariablesInUpdateReq(activeVariableIdsPresentInReq []int, stepId int, variableType PipelineStageStepVariableType, tx *pg.Tx) error

	CreatePipelineStageStepConditions([]PipelineStageStepCondition, *pg.Tx) ([]PipelineStageStepCondition, error)
	UpdatePipelineStageStepConditions(conditions []PipelineStageStepCondition, tx *pg.Tx) ([]PipelineStageStepCondition, error)
	GetConditionIdsByStageId(stageId int) ([]int, error)
	MarkPipelineStageStepConditionDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error
	GetConditionsByStepId(stepId int) ([]*PipelineStageStepCondition, error)
	GetConditionsByVariableId(variableId int) ([]*PipelineStageStepCondition, error)
	GetConditionIdsByStepId(stepId int) ([]int, error)
	MarkConditionsDeletedByStepId(stepId int, tx *pg.Tx) error
	MarkConditionsDeletedExcludingActiveVariablesInUpdateReq(activeConditionIdsPresentInReq []int, stepId int, tx *pg.Tx) error
}

type PipelineStageRepositoryImpl

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

func NewPipelineStageRepository

func NewPipelineStageRepository(logger *zap.SugaredLogger,
	dbConnection *pg.DB) *PipelineStageRepositoryImpl

func (*PipelineStageRepositoryImpl) CheckIfCommandArgMappingExists

func (impl *PipelineStageRepositoryImpl) CheckIfCommandArgMappingExists(command string, arg string, scriptId int) (bool, error)

func (*PipelineStageRepositoryImpl) CheckIfFilePathMappingExists

func (impl *PipelineStageRepositoryImpl) CheckIfFilePathMappingExists(filePathOnDisk string, filePathOnContainer string, scriptId int) (bool, error)

func (*PipelineStageRepositoryImpl) CheckIfPortMappingExists

func (impl *PipelineStageRepositoryImpl) CheckIfPortMappingExists(portOnLocal int, portOnContainer int, scriptId int) (bool, error)

func (*PipelineStageRepositoryImpl) CreateCiStage

func (impl *PipelineStageRepositoryImpl) CreateCiStage(ciStage *PipelineStage) (*PipelineStage, error)

func (*PipelineStageRepositoryImpl) CreatePipelineScript

func (impl *PipelineStageRepositoryImpl) CreatePipelineScript(pipelineScript *PluginPipelineScript) (*PluginPipelineScript, error)

func (*PipelineStageRepositoryImpl) CreatePipelineStageStep

func (impl *PipelineStageRepositoryImpl) CreatePipelineStageStep(step *PipelineStageStep) (*PipelineStageStep, error)

func (*PipelineStageRepositoryImpl) CreatePipelineStageStepConditions

func (impl *PipelineStageRepositoryImpl) CreatePipelineStageStepConditions(conditions []PipelineStageStepCondition, tx *pg.Tx) ([]PipelineStageStepCondition, error)

func (*PipelineStageRepositoryImpl) CreatePipelineStageStepVariables

func (impl *PipelineStageRepositoryImpl) CreatePipelineStageStepVariables(variables []PipelineStageStepVariable, tx *pg.Tx) ([]PipelineStageStepVariable, error)

func (*PipelineStageRepositoryImpl) CreateScriptMapping

func (impl *PipelineStageRepositoryImpl) CreateScriptMapping(mappings []ScriptPathArgPortMapping) error

func (*PipelineStageRepositoryImpl) GetAllCiStagesByCiPipelineId

func (impl *PipelineStageRepositoryImpl) GetAllCiStagesByCiPipelineId(ciPipelineId int) ([]*PipelineStage, error)

func (*PipelineStageRepositoryImpl) GetAllStepsByStageId

func (impl *PipelineStageRepositoryImpl) GetAllStepsByStageId(stageId int) ([]*PipelineStageStep, error)

func (*PipelineStageRepositoryImpl) GetCiStageByCiPipelineIdAndStageType

func (impl *PipelineStageRepositoryImpl) GetCiStageByCiPipelineIdAndStageType(ciPipelineId int, stageType PipelineStageType) (*PipelineStage, error)

func (*PipelineStageRepositoryImpl) GetConditionIdsByStageId

func (impl *PipelineStageRepositoryImpl) GetConditionIdsByStageId(stageId int) ([]int, error)

func (*PipelineStageRepositoryImpl) GetConditionIdsByStepId

func (impl *PipelineStageRepositoryImpl) GetConditionIdsByStepId(stepId int) ([]int, error)

func (*PipelineStageRepositoryImpl) GetConditionsByStepId

func (impl *PipelineStageRepositoryImpl) GetConditionsByStepId(stepId int) ([]*PipelineStageStepCondition, error)

func (*PipelineStageRepositoryImpl) GetConditionsByVariableId

func (impl *PipelineStageRepositoryImpl) GetConditionsByVariableId(variableId int) ([]*PipelineStageStepCondition, error)

func (*PipelineStageRepositoryImpl) GetConnection

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

func (*PipelineStageRepositoryImpl) GetScriptDetailById

func (impl *PipelineStageRepositoryImpl) GetScriptDetailById(id int) (*PluginPipelineScript, error)

func (*PipelineStageRepositoryImpl) GetScriptIdsByStageId

func (impl *PipelineStageRepositoryImpl) GetScriptIdsByStageId(stageId int) ([]int, error)

func (*PipelineStageRepositoryImpl) GetScriptMappingDetailByScriptId

func (impl *PipelineStageRepositoryImpl) GetScriptMappingDetailByScriptId(scriptId int) ([]*ScriptPathArgPortMapping, error)

func (*PipelineStageRepositoryImpl) GetScriptMappingIdsByStageId

func (impl *PipelineStageRepositoryImpl) GetScriptMappingIdsByStageId(stageId int) ([]int, error)

func (*PipelineStageRepositoryImpl) GetStepById

func (impl *PipelineStageRepositoryImpl) GetStepById(stepId int) (*PipelineStageStep, error)

func (*PipelineStageRepositoryImpl) GetStepIdsByStageId

func (impl *PipelineStageRepositoryImpl) GetStepIdsByStageId(stageId int) ([]int, error)

func (*PipelineStageRepositoryImpl) GetVariableIdsByStageId

func (impl *PipelineStageRepositoryImpl) GetVariableIdsByStageId(stageId int) ([]int, error)

func (*PipelineStageRepositoryImpl) GetVariableIdsByStepIdAndVariableType

func (impl *PipelineStageRepositoryImpl) GetVariableIdsByStepIdAndVariableType(stepId int, variableType PipelineStageStepVariableType) ([]int, error)

func (*PipelineStageRepositoryImpl) GetVariablesByStepId

func (impl *PipelineStageRepositoryImpl) GetVariablesByStepId(stepId int) ([]*PipelineStageStepVariable, error)

func (*PipelineStageRepositoryImpl) MarkCiStageDeletedById

func (impl *PipelineStageRepositoryImpl) MarkCiStageDeletedById(ciStageId int, updatedBy int32, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkCiStageStepsDeletedByStageId

func (impl *PipelineStageRepositoryImpl) MarkCiStageStepsDeletedByStageId(ciStageId int, updatedBy int32, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkConditionsDeletedByStepId

func (impl *PipelineStageRepositoryImpl) MarkConditionsDeletedByStepId(stepId int, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkConditionsDeletedExcludingActiveVariablesInUpdateReq

func (impl *PipelineStageRepositoryImpl) MarkConditionsDeletedExcludingActiveVariablesInUpdateReq(activeConditionIdsPresentInReq []int, stepId int, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkPipelineScriptMappingsDeletedByIds

func (impl *PipelineStageRepositoryImpl) MarkPipelineScriptMappingsDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkPipelineScriptsDeletedByIds

func (impl *PipelineStageRepositoryImpl) MarkPipelineScriptsDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkPipelineStageStepConditionDeletedByIds

func (impl *PipelineStageRepositoryImpl) MarkPipelineStageStepConditionDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkPipelineStageStepVariablesDeletedByIds

func (impl *PipelineStageRepositoryImpl) MarkPipelineStageStepVariablesDeletedByIds(ids []int, updatedBy int32, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkScriptDeletedById

func (impl *PipelineStageRepositoryImpl) MarkScriptDeletedById(scriptId int) error

func (*PipelineStageRepositoryImpl) MarkScriptMappingDeletedByScriptId

func (impl *PipelineStageRepositoryImpl) MarkScriptMappingDeletedByScriptId(scriptId int) error

func (*PipelineStageRepositoryImpl) MarkStepsDeletedByStageId

func (impl *PipelineStageRepositoryImpl) MarkStepsDeletedByStageId(stageId int) error

func (*PipelineStageRepositoryImpl) MarkStepsDeletedExcludingActiveStepsInUpdateReq

func (impl *PipelineStageRepositoryImpl) MarkStepsDeletedExcludingActiveStepsInUpdateReq(activeStepIdsPresentInReq []int, stageId int) error

func (*PipelineStageRepositoryImpl) MarkVariablesDeletedByStepIdAndVariableType

func (impl *PipelineStageRepositoryImpl) MarkVariablesDeletedByStepIdAndVariableType(stepId int, variableType PipelineStageStepVariableType, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) MarkVariablesDeletedExcludingActiveVariablesInUpdateReq

func (impl *PipelineStageRepositoryImpl) MarkVariablesDeletedExcludingActiveVariablesInUpdateReq(activeVariableIdsPresentInReq []int, stepId int, variableType PipelineStageStepVariableType, tx *pg.Tx) error

func (*PipelineStageRepositoryImpl) UpdateCiStage

func (impl *PipelineStageRepositoryImpl) UpdateCiStage(ciStage *PipelineStage) (*PipelineStage, error)

func (*PipelineStageRepositoryImpl) UpdatePipelineScript

func (impl *PipelineStageRepositoryImpl) UpdatePipelineScript(pipelineScript *PluginPipelineScript) (*PluginPipelineScript, error)

func (*PipelineStageRepositoryImpl) UpdatePipelineStageStep

func (impl *PipelineStageRepositoryImpl) UpdatePipelineStageStep(step *PipelineStageStep) (*PipelineStageStep, error)

func (*PipelineStageRepositoryImpl) UpdatePipelineStageStepConditions

func (impl *PipelineStageRepositoryImpl) UpdatePipelineStageStepConditions(conditions []PipelineStageStepCondition, tx *pg.Tx) ([]PipelineStageStepCondition, error)

func (*PipelineStageRepositoryImpl) UpdatePipelineStageStepVariables

func (impl *PipelineStageRepositoryImpl) UpdatePipelineStageStepVariables(variables []PipelineStageStepVariable, tx *pg.Tx) ([]PipelineStageStepVariable, error)

type PipelineStageStep

type PipelineStageStep struct {
	Id                  int              `sql:"id,pk"`
	PipelineStageId     int              `sql:"pipeline_stage_id"`
	Name                string           `sql:"name"`
	Description         string           `sql:"description"`
	Index               int              `sql:"index"`
	StepType            PipelineStepType `sql:"step_type"`
	ScriptId            int              `sql:"script_id"`
	RefPluginId         int              `sql:"ref_plugin_id"` //id of plugin used as reference
	OutputDirectoryPath []string         `sql:"output_directory_path" pg:",array"`
	DependentOnStep     string           `sql:"dependent_on_step"`
	Deleted             bool             `sql:"deleted,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStageStepCondition

type PipelineStageStepCondition struct {
	Id                  int                            `sql:"id,pk"`
	PipelineStageStepId int                            `sql:"pipeline_stage_step_id"`
	ConditionVariableId int                            `sql:"condition_variable_id"` //id of variable on which condition is written
	ConditionType       PipelineStageStepConditionType `sql:"condition_type"`
	ConditionalOperator string                         `sql:"conditional_operator"`
	ConditionalValue    string                         `sql:"conditional_value"`
	Deleted             bool                           `sql:"deleted,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStageStepConditionType

type PipelineStageStepConditionType string

type PipelineStageStepVariable

type PipelineStageStepVariable struct {
	Id                        int                                 `sql:"id,pk"`
	PipelineStageStepId       int                                 `sql:"pipeline_stage_step_id"`
	Name                      string                              `sql:"name"`
	Format                    PipelineStageStepVariableFormatType `sql:"format"`
	Description               string                              `sql:"description"`
	IsExposed                 bool                                `sql:"is_exposed,notnull"`
	AllowEmptyValue           bool                                `sql:"allow_empty_value,notnull"`
	DefaultValue              string                              `sql:"default_value"`
	Value                     string                              `sql:"value"`
	VariableType              PipelineStageStepVariableType       `sql:"variable_type"`
	ValueType                 PipelineStageStepVariableValueType  `sql:"value_type"`
	PreviousStepIndex         int                                 `sql:"previous_step_index,type:integer"`
	VariableStepIndexInPlugin int                                 `sql:"variable_step_index_in_plugin,type:integer"`
	ReferenceVariableName     string                              `sql:"reference_variable_name,type:text"`
	ReferenceVariableStage    PipelineStageType                   `sql:"reference_variable_stage,type:text"`
	Deleted                   bool                                `sql:"deleted,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStageStepVariableFormatType

type PipelineStageStepVariableFormatType string

type PipelineStageStepVariableType

type PipelineStageStepVariableType string

type PipelineStageStepVariableValueType

type PipelineStageStepVariableValueType string

type PipelineStageType

type PipelineStageType string

type PipelineStepType

type PipelineStepType string

type PluginPipelineScript

type PluginPipelineScript struct {
	Id                       int                                  `sql:"id,pk"`
	Script                   string                               `sql:"script"`
	StoreScriptAt            string                               `sql:"store_script_at"`
	Type                     repository.ScriptType                `sql:"type"`
	DockerfileExists         bool                                 `sql:"dockerfile_exists, notnull"`
	MountPath                string                               `sql:"mount_path"`
	MountCodeToContainer     bool                                 `sql:"mount_code_to_container,notnull"`
	MountCodeToContainerPath string                               `sql:"mount_code_to_container_path"`
	MountDirectoryFromHost   bool                                 `sql:"mount_directory_from_host,notnull"`
	ContainerImagePath       string                               `sql:"container_image_path"`
	ImagePullSecretType      repository.ScriptImagePullSecretType `sql:"image_pull_secret_type"`
	ImagePullSecret          string                               `sql:"image_pull_secret"`
	Deleted                  bool                                 `sql:"deleted, notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type ScriptPathArgPortMapping

type ScriptPathArgPortMapping struct {
	Id                  int                          `sql:"id,pk"`
	TypeOfMapping       repository.ScriptMappingType `sql:"type_of_mapping"`
	FilePathOnDisk      string                       `sql:"file_path_on_disk"`
	FilePathOnContainer string                       `sql:"file_path_on_container"`
	Command             string                       `sql:"command"`
	Args                []string                     `sql:"args" pg:",array"`
	PortOnLocal         int                          `sql:"port_on_local"`
	PortOnContainer     int                          `sql:"port_on_container"`
	ScriptId            int                          `sql:"script_id"`
	Deleted             bool                         `sql:"deleted, notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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