Help us shape the future of Go! Take the 2026 Go Developer Survey

bean

package
v0.6.21 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	VARIABLE_TYPE_VALUE       = "VALUE"
	VARIABLE_TYPE_REF_PRE_CI  = "REF_PRE_CI"
	VARIABLE_TYPE_REF_POST_CI = "REF_POST_CI"
	VARIABLE_TYPE_REF_GLOBAL  = "REF_GLOBAL"
	VARIABLE_TYPE_REF_PLUGIN  = "REF_PLUGIN"
)
View Source
const Main = "main"

Variables

This section is empty.

Functions

func ConvertBuildConfigBeanToDbEntity added in v0.6.6

func ConvertBuildConfigBeanToDbEntity(templateId int, overrideTemplateId int, ciBuildConfigBean *CiBuildConfigBean, userId int32) (*pipelineConfig.CiBuildConfig, error)

func ConvertToEncodedForm added in v0.6.18

func ConvertToEncodedForm(data map[string]string) ([]byte, error)

ConvertToEncodedForm Function to encode the values in the input map values

Types

type BuildPackConfig added in v0.6.6

type BuildPackConfig struct {
	BuilderId       string            `json:"builderId"`
	Language        string            `json:"language"`
	LanguageVersion string            `json:"languageVersion"`
	BuildPacks      []string          `json:"buildPacks"`
	Args            map[string]string `json:"args"`
	ProjectPath     string            `json:"projectPath,omitempty"`
}

type CiBuildConfigBean added in v0.6.6

type CiBuildConfigBean struct {
	Id                        int                `json:"id"`
	GitMaterialId             int                `json:"gitMaterialId,omitempty" validate:"required"`
	BuildContextGitMaterialId int                `json:"buildContextGitMaterialId,omitempty" validate:"required"`
	UseRootBuildContext       bool               `json:"useRootBuildContext"`
	CiBuildType               CiBuildType        `json:"ciBuildType"`
	DockerBuildConfig         *DockerBuildConfig `json:"dockerBuildConfig,omitempty"`
	BuildPackConfig           *BuildPackConfig   `json:"buildPackConfig"`
}

func ConvertDbBuildConfigToBean added in v0.6.6

func ConvertDbBuildConfigToBean(dbBuildConfig *pipelineConfig.CiBuildConfig) (*CiBuildConfigBean, error)

func OverrideCiBuildConfig added in v0.6.6

func OverrideCiBuildConfig(dockerfilePath string, oldArgs string, ciLevelArgs string, dockerBuildOptions string, targetPlatform string, ciBuildConfigBean *CiBuildConfigBean) (*CiBuildConfigBean, error)

type CiBuildType added in v0.6.6

type CiBuildType string
const (
	SELF_DOCKERFILE_BUILD_TYPE    CiBuildType = "self-dockerfile-build"
	MANAGED_DOCKERFILE_BUILD_TYPE CiBuildType = "managed-dockerfile-build"
	SKIP_BUILD_BUILD_TYPE         CiBuildType = "skip-build"
	BUILDPACK_BUILD_TYPE          CiBuildType = "buildpack-build"
)

type CiTemplateBean added in v0.6.6

type CiTemplateBean struct {
	CiTemplate         *pipelineConfig.CiTemplate
	CiTemplateOverride *pipelineConfig.CiTemplateOverride
	CiBuildConfig      *CiBuildConfigBean
	UserId             int32
}

type CommandArgsMap

type CommandArgsMap struct {
	Command string   `json:"command"`
	Args    []string `json:"args"`
}

type ConditionDetailDto

type ConditionDetailDto struct {
	Id                  int                                       `json:"id"`
	ConditionOnVariable string                                    `json:"conditionOnVariable"` //name of variable on which condition is written
	ConditionType       repository.PipelineStageStepConditionType `json:"conditionType" validate:"oneof=SKIP TRIGGER SUCCESS FAIL"`
	ConditionalOperator string                                    `json:"conditionOperator"`
	ConditionalValue    string                                    `json:"conditionalValue"`
}

type ConditionObject

type ConditionObject struct {
	ConditionType       string `json:"conditionType"`       //TRIGGER, SKIP, SUCCESS, FAIL
	ConditionOnVariable string `json:"conditionOnVariable"` //name of variable
	ConditionalOperator string `json:"conditionalOperator"`
	ConditionalValue    string `json:"conditionalValue"`
}

type DockerBuildConfig added in v0.6.6

type DockerBuildConfig struct {
	DockerfilePath         string              `json:"dockerfileRelativePath,omitempty"`
	DockerfileContent      string              `json:"dockerfileContent"`
	Args                   map[string]string   `json:"args,omitempty"`
	TargetPlatform         string              `json:"targetPlatform,omitempty"`
	Language               string              `json:"language,omitempty"`
	LanguageFramework      string              `json:"languageFramework,omitempty"`
	DockerBuildOptions     map[string]string   `json:"dockerBuildOptions,omitempty"`
	BuildContext           string              `json:"buildContext,omitempty"`
	UseBuildx              bool                `json:"useBuildx"`
	BuildxK8sDriverOptions []map[string]string `json:"buildxK8SDriverOptions,omitempty"`
}

type GlobalCMCSDto added in v0.6.17

type GlobalCMCSDto struct {
	Id         int    `json:"id"`
	ConfigType string `json:"configType" validate:"oneof=CONFIGMAP SECRET"`
	Name       string `json:"name"  validate:"required"`
	Type       string `json:"type" validate:"oneof=environment volume"`
	//map of key:value, example: '{ "a" : "b", "c" : "d"}'
	Data               map[string]string `json:"data"  validate:"required"`
	MountPath          string            `json:"mountPath"`
	Deleted            bool              `json:"deleted"`
	UserId             int32             `json:"-"`
	SecretIngestionFor string            `json:"SecretIngestionFor"` // value can be one of [ci, cd, ci/cd]
}

func (GlobalCMCSDto) ConvertToConfigSecretMap added in v0.6.17

func (dto GlobalCMCSDto) ConvertToConfigSecretMap() (bean.ConfigSecretMap, error)

type InlineStepDetailDto

type InlineStepDetailDto struct {
	ScriptType               repository2.ScriptType                `json:"scriptType" validate:"omitempty,oneof=SHELL DOCKERFILE CONTAINER_IMAGE"`
	Script                   string                                `json:"script"`
	StoreScriptAt            string                                `json:"storeScriptAt"`
	DockerfileExists         bool                                  `json:"dockerfileExists,omitempty"`
	MountPath                string                                `json:"mountPath,omitempty"`
	MountCodeToContainer     bool                                  `json:"mountCodeToContainer,omitempty"`
	MountCodeToContainerPath string                                `json:"mountCodeToContainerPath,omitempty"`
	MountDirectoryFromHost   bool                                  `json:"mountDirectoryFromHost"`
	ContainerImagePath       string                                `json:"containerImagePath,omitempty"`
	ImagePullSecretType      repository2.ScriptImagePullSecretType `json:"imagePullSecretType,omitempty" validate:"omitempty,oneof=CONTAINER_REGISTRY SECRET_PATH"`
	ImagePullSecret          string                                `json:"imagePullSecret,omitempty"`
	MountPathMap             []*MountPathMap                       `json:"mountPathMap,omitempty"`
	CommandArgsMap           []*CommandArgsMap                     `json:"commandArgsMap,omitempty"`
	PortMap                  []*PortMap                            `json:"portMap,omitempty"`
	InputVariables           []*StepVariableDto                    `json:"inputVariables"`
	OutputVariables          []*StepVariableDto                    `json:"outputVariables"`
	ConditionDetails         []*ConditionDetailDto                 `json:"conditionDetails"`
}

type MountPath

type MountPath struct {
	SourcePath      string `json:"sourcePath"`
	DestinationPath string `json:"destinationPath"`
}

type MountPathMap

type MountPathMap struct {
	FilePathOnDisk      string `json:"filePathOnDisk"`
	FilePathOnContainer string `json:"filePathOnContainer"`
}

type PipelineStageDto

type PipelineStageDto struct {
	Id          int                          `json:"id"`
	Name        string                       `json:"name,omitempty"`
	Description string                       `json:"description,omitempty"`
	Type        repository.PipelineStageType `json:"type,omitempty" validate:"omitempty,oneof=PRE_CI POST_CI PRE_CD POST_CD"`
	Steps       []*PipelineStageStepDto      `json:"steps"`
	TriggerType pipelineConfig.TriggerType   `json:"triggerType,omitempty"`
}

type PipelineStageStepDto

type PipelineStageStepDto struct {
	Id                       int                         `json:"id"`
	Name                     string                      `json:"name"`
	Description              string                      `json:"description"`
	Index                    int                         `json:"index"`
	StepType                 repository.PipelineStepType `json:"stepType" validate:"omitempty,oneof=INLINE REF_PLUGIN"`
	OutputDirectoryPath      []string                    `json:"outputDirectoryPath"`
	InlineStepDetail         *InlineStepDetailDto        `json:"inlineStepDetail"`
	RefPluginStepDetail      *RefPluginStepDetailDto     `json:"pluginRefStepDetail"`
	TriggerIfParentStageFail bool                        `json:"triggerIfParentStageFail"`
}

type PortMap

type PortMap struct {
	PortOnLocal     int `json:"portOnLocal" validate:"number,gt=0"`
	PortOnContainer int `json:"portOnContainer" validate:"number,gt=0"`
}

type RefPluginObject

type RefPluginObject struct {
	Id    int           `json:"id"`
	Steps []*StepObject `json:"steps"`
}

type RefPluginStepDetailDto

type RefPluginStepDetailDto struct {
	PluginId         int                   `json:"pluginId"`
	InputVariables   []*StepVariableDto    `json:"inputVariables"`
	OutputVariables  []*StepVariableDto    `json:"outputVariables"`
	ConditionDetails []*ConditionDetailDto `json:"conditionDetails"`
}

type StepObject

type StepObject struct {
	Name                     string             `json:"name"`
	Index                    int                `json:"index"`
	StepType                 string             `json:"stepType"`               // REF_PLUGIN or INLINE
	ExecutorType             string             `json:"executorType,omitempty"` //SHELL, DOCKERFILE, CONTAINER_IMAGE
	RefPluginId              int                `json:"refPluginId,omitempty"`
	Script                   string             `json:"script,omitempty"`
	InputVars                []*VariableObject  `json:"inputVars"`
	ExposedPorts             map[int]int        `json:"exposedPorts"` //map of host:container
	OutputVars               []*VariableObject  `json:"outputVars"`
	TriggerSkipConditions    []*ConditionObject `json:"triggerSkipConditions"`
	SuccessFailureConditions []*ConditionObject `json:"successFailureConditions"`
	DockerImage              string             `json:"dockerImage"`
	Command                  string             `json:"command"`
	Args                     []string           `json:"args"`
	CustomScriptMount        *MountPath         `json:"customScriptMount"` // destination path - storeScriptAt
	SourceCodeMount          *MountPath         `json:"sourceCodeMount"`   // destination path - mountCodeToContainerPath
	ExtraVolumeMounts        []*MountPath       `json:"extraVolumeMounts"` // filePathMapping
	ArtifactPaths            []string           `json:"artifactPaths"`
	TriggerIfParentStageFail bool               `json:"triggerIfParentStageFail"`
}

type StepVariableDto

type StepVariableDto struct {
	Id                        int                                            `json:"id"`
	Name                      string                                         `json:"name"`
	Format                    repository.PipelineStageStepVariableFormatType `json:"format" validate:"oneof=STRING NUMBER BOOL DATE"`
	Description               string                                         `json:"description"`
	IsExposed                 bool                                           `json:"isExposed,omitempty"`
	AllowEmptyValue           bool                                           `json:"allowEmptyValue,omitempty"`
	DefaultValue              string                                         `json:"defaultValue,omitempty"`
	Value                     string                                         `json:"value"`
	ValueType                 repository.PipelineStageStepVariableValueType  `json:"variableType,omitempty" validate:"oneof=NEW FROM_PREVIOUS_STEP GLOBAL"`
	PreviousStepIndex         int                                            `json:"refVariableStepIndex,omitempty"`
	ReferenceVariableName     string                                         `json:"refVariableName,omitempty"`
	VariableStepIndexInPlugin int                                            `json:"variableStepIndexInPlugin,omitempty"`
	ReferenceVariableStage    repository.PipelineStageType                   `json:"refVariableStage"`
}

type VariableObject

type VariableObject struct {
	Name   string `json:"name"`
	Format string `json:"format"` //STRING, NUMBER, BOOL, DATE
	//only for input type
	Value                      string       `json:"value,omitempty"`
	VariableType               VariableType `json:"variableType,omitempty"`
	ReferenceVariableName      string       `json:"referenceVariableName,omitempty"`
	ReferenceVariableStepIndex int          `json:"referenceVariableStepIndex,omitempty"`
	VariableStepIndexInPlugin  int          `json:"variableStepIndexInPlugin,omitempty"`
}

type VariableType

type VariableType string

type WorkflowTemplate added in v0.6.17

type WorkflowTemplate struct {
	WorkflowId       int
	WorkflowRunnerId int
	v1.PodSpec
	ConfigMaps             []bean.ConfigSecretMap
	Secrets                []bean.ConfigSecretMap
	TTLValue               *int32
	WorkflowRequestJson    string
	WorkflowNamePrefix     string
	WfControllerInstanceID string
	ClusterConfig          *rest.Config
	Namespace              string
	ArchiveLogs            bool
	BlobStorageConfigured  bool
	BlobStorageS3Config    *blob_storage.BlobStorageS3Config
	CloudProvider          blob_storage.BlobStorageType
	AzureBlobConfig        *blob_storage.AzureBlobConfig
	GcpBlobConfig          *blob_storage.GcpBlobConfig
	CloudStorageKey        string
	PrePostDeploySteps     []*StepObject
	RefPlugins             []*RefPluginObject
}

Jump to

Keyboard shortcuts

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