job

package
v1.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OutputNameRegexString = "^[a-zA-Z0-9_]{1,64}$"
	JobNameKey            = "job_name"
)
View Source
const (
	IMAGEKEY    = "IMAGE"
	IMAGETAGKEY = "imageTag"
	PKGFILEKEY  = "PKG_FILE"
)
View Source
const (
	DistributeTimeout int64 = 10

	// WorkflowInputImageTagVariable PreBuildImageTagVariable
	// These variables are not really workflow variables, will convert to real value or workflow variables
	// Not return from GetWorkflowGlobalVars function, instead of frontend
	WorkflowInputImageTagVariable = "{{.workflow.input.imageTag}}"
	PreBuildImageTagVariable      = "{{.job.preBuild.imageTag}}"
)
View Source
const (
	ENVNAMEKEY = "envName"
)

Variables

Functions

func GetRepos

func GetRepos(workflow *commonmodels.WorkflowV4) ([]*types.Repository, error)

func GetWorkflowOutputs

func GetWorkflowOutputs(workflow *commonmodels.WorkflowV4, currentJobName string, log *zap.SugaredLogger) []string

func Instantiate

func Instantiate(job *commonmodels.Job, workflow *commonmodels.WorkflowV4) error

func InstantiateWorkflow

func InstantiateWorkflow(workflow *commonmodels.WorkflowV4) error

func JobPresetSkiped

func JobPresetSkiped(job *commonmodels.Job)

func JobSkiped

func JobSkiped(job *commonmodels.Job) bool

func LintJob

func LintJob(job *commonmodels.Job, workflow *commonmodels.WorkflowV4) error

func MergeArgs

func MergeArgs(workflow, workflowArgs *commonmodels.WorkflowV4) error

func MergeWebhookRepo

func MergeWebhookRepo(workflow *commonmodels.WorkflowV4, repo *types.Repository) error

func RemoveFixedValueMarks

func RemoveFixedValueMarks(workflow *commonmodels.WorkflowV4) error

before workflowflow task was created, we need to remove the fixed mark from variables.

func RenderGlobalVariables

func RenderGlobalVariables(workflow *commonmodels.WorkflowV4, taskID int64, creator string) error

func RenderStageVariables

func RenderStageVariables(workflow *commonmodels.WorkflowV4, taskID int64, creator string) error

func SetPreset

func SetPreset(job *commonmodels.Job, workflow *commonmodels.WorkflowV4) error

func ToJobs

func ToJobs(job *commonmodels.Job, workflow *commonmodels.WorkflowV4, taskID int64) ([]*commonmodels.JobTask, error)

Types

type ApolloJob

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

func (*ApolloJob) Instantiate

func (j *ApolloJob) Instantiate() error

func (*ApolloJob) LintJob

func (j *ApolloJob) LintJob() error

func (*ApolloJob) MergeArgs

func (j *ApolloJob) MergeArgs(args *commonmodels.Job) error

func (*ApolloJob) SetPreset

func (j *ApolloJob) SetPreset() error

func (*ApolloJob) ToJobs

func (j *ApolloJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type BlueGreenDeployJob

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

func (*BlueGreenDeployJob) Instantiate

func (j *BlueGreenDeployJob) Instantiate() error

func (*BlueGreenDeployJob) LintJob

func (j *BlueGreenDeployJob) LintJob() error

func (*BlueGreenDeployJob) MergeArgs

func (j *BlueGreenDeployJob) MergeArgs(args *commonmodels.Job) error

func (*BlueGreenDeployJob) SetPreset

func (j *BlueGreenDeployJob) SetPreset() error

func (*BlueGreenDeployJob) ToJobs

func (j *BlueGreenDeployJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type BlueGreenReleaseJob

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

func (*BlueGreenReleaseJob) Instantiate

func (j *BlueGreenReleaseJob) Instantiate() error

func (*BlueGreenReleaseJob) LintJob

func (j *BlueGreenReleaseJob) LintJob() error

func (*BlueGreenReleaseJob) MergeArgs

func (j *BlueGreenReleaseJob) MergeArgs(args *commonmodels.Job) error

func (*BlueGreenReleaseJob) SetPreset

func (j *BlueGreenReleaseJob) SetPreset() error

func (*BlueGreenReleaseJob) ToJobs

func (j *BlueGreenReleaseJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type BuildJob

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

func (*BuildJob) GetOutPuts

func (j *BuildJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*BuildJob) GetRepos

func (j *BuildJob) GetRepos() ([]*types.Repository, error)

func (*BuildJob) Instantiate

func (j *BuildJob) Instantiate() error

func (*BuildJob) LintJob

func (j *BuildJob) LintJob() error

func (*BuildJob) MergeArgs

func (j *BuildJob) MergeArgs(args *commonmodels.Job) error

func (*BuildJob) MergeWebhookRepo

func (j *BuildJob) MergeWebhookRepo(webhookRepo *types.Repository) error

func (*BuildJob) SetPreset

func (j *BuildJob) SetPreset() error

SetPreset will now update all the possible build service option into serviceOption instead of ServiceAndBuilds Updated @2023-03-30 before v1.17.0 Updated @2023-04-07 after v1.17.0 revert to old version

func (*BuildJob) ToJobs

func (j *BuildJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type CanaryDeployJob

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

func (*CanaryDeployJob) Instantiate

func (j *CanaryDeployJob) Instantiate() error

func (*CanaryDeployJob) LintJob

func (j *CanaryDeployJob) LintJob() error

func (*CanaryDeployJob) MergeArgs

func (j *CanaryDeployJob) MergeArgs(args *commonmodels.Job) error

func (*CanaryDeployJob) SetPreset

func (j *CanaryDeployJob) SetPreset() error

func (*CanaryDeployJob) ToJobs

func (j *CanaryDeployJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type CanaryReleaseJob

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

func (*CanaryReleaseJob) Instantiate

func (j *CanaryReleaseJob) Instantiate() error

func (*CanaryReleaseJob) LintJob

func (j *CanaryReleaseJob) LintJob() error

func (*CanaryReleaseJob) MergeArgs

func (j *CanaryReleaseJob) MergeArgs(args *commonmodels.Job) error

func (*CanaryReleaseJob) SetPreset

func (j *CanaryReleaseJob) SetPreset() error

func (*CanaryReleaseJob) ToJobs

func (j *CanaryReleaseJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type CustomDeployJob

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

func (*CustomDeployJob) Instantiate

func (j *CustomDeployJob) Instantiate() error

func (*CustomDeployJob) LintJob

func (j *CustomDeployJob) LintJob() error

func (*CustomDeployJob) MergeArgs

func (j *CustomDeployJob) MergeArgs(args *commonmodels.Job) error

func (*CustomDeployJob) SetPreset

func (j *CustomDeployJob) SetPreset() error

func (*CustomDeployJob) ToJobs

func (j *CustomDeployJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type DeployJob

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

func (*DeployJob) GetOutPuts

func (j *DeployJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*DeployJob) Instantiate

func (j *DeployJob) Instantiate() error

func (*DeployJob) LintJob

func (j *DeployJob) LintJob() error

func (*DeployJob) MergeArgs

func (j *DeployJob) MergeArgs(args *commonmodels.Job) error

func (*DeployJob) SetPreset

func (j *DeployJob) SetPreset() error

func (*DeployJob) ToJobs

func (j *DeployJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type FreeStyleJob

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

func (*FreeStyleJob) GetOutPuts

func (j *FreeStyleJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*FreeStyleJob) GetRepos

func (j *FreeStyleJob) GetRepos() ([]*types.Repository, error)

func (*FreeStyleJob) Instantiate

func (j *FreeStyleJob) Instantiate() error

func (*FreeStyleJob) LintJob

func (j *FreeStyleJob) LintJob() error

func (*FreeStyleJob) MergeArgs

func (j *FreeStyleJob) MergeArgs(args *commonmodels.Job) error

func (*FreeStyleJob) MergeWebhookRepo

func (j *FreeStyleJob) MergeWebhookRepo(webhookRepo *types.Repository) error

func (*FreeStyleJob) SetPreset

func (j *FreeStyleJob) SetPreset() error

func (*FreeStyleJob) ToJobs

func (j *FreeStyleJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type GrayReleaseJob

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

func (*GrayReleaseJob) Instantiate

func (j *GrayReleaseJob) Instantiate() error

func (*GrayReleaseJob) LintJob

func (j *GrayReleaseJob) LintJob() error

func (*GrayReleaseJob) MergeArgs

func (j *GrayReleaseJob) MergeArgs(args *commonmodels.Job) error

func (*GrayReleaseJob) SetPreset

func (j *GrayReleaseJob) SetPreset() error

func (*GrayReleaseJob) ToJobs

func (j *GrayReleaseJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type GrayRollbackJob

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

func (*GrayRollbackJob) Instantiate

func (j *GrayRollbackJob) Instantiate() error

func (*GrayRollbackJob) LintJob

func (j *GrayRollbackJob) LintJob() error

func (*GrayRollbackJob) MergeArgs

func (j *GrayRollbackJob) MergeArgs(args *commonmodels.Job) error

func (*GrayRollbackJob) SetPreset

func (j *GrayRollbackJob) SetPreset() error

func (*GrayRollbackJob) ToJobs

func (j *GrayRollbackJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type HelmChartDeployJob

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

func (*HelmChartDeployJob) Instantiate

func (j *HelmChartDeployJob) Instantiate() error

func (*HelmChartDeployJob) LintJob

func (j *HelmChartDeployJob) LintJob() error

func (*HelmChartDeployJob) MergeArgs

func (j *HelmChartDeployJob) MergeArgs(args *commonmodels.Job) error

func (*HelmChartDeployJob) SetPreset

func (j *HelmChartDeployJob) SetPreset() error

func (*HelmChartDeployJob) ToJobs

func (j *HelmChartDeployJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type ImageDistributeJob

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

func (*ImageDistributeJob) GetOutPuts

func (j *ImageDistributeJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*ImageDistributeJob) Instantiate

func (j *ImageDistributeJob) Instantiate() error

func (*ImageDistributeJob) LintJob

func (j *ImageDistributeJob) LintJob() error

func (*ImageDistributeJob) MergeArgs

func (j *ImageDistributeJob) MergeArgs(args *commonmodels.Job) error

func (*ImageDistributeJob) SetPreset

func (j *ImageDistributeJob) SetPreset() error

func (*ImageDistributeJob) ToJobs

func (j *ImageDistributeJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type IstioReleaseJob

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

func (*IstioReleaseJob) Instantiate

func (j *IstioReleaseJob) Instantiate() error

func (*IstioReleaseJob) LintJob

func (j *IstioReleaseJob) LintJob() error

func (*IstioReleaseJob) MergeArgs

func (j *IstioReleaseJob) MergeArgs(args *commonmodels.Job) error

func (*IstioReleaseJob) SetPreset

func (j *IstioReleaseJob) SetPreset() error

func (*IstioReleaseJob) ToJobs

func (j *IstioReleaseJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type IstioRollBackJob

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

func (*IstioRollBackJob) Instantiate

func (j *IstioRollBackJob) Instantiate() error

func (*IstioRollBackJob) LintJob

func (j *IstioRollBackJob) LintJob() error

func (*IstioRollBackJob) MergeArgs

func (j *IstioRollBackJob) MergeArgs(args *commonmodels.Job) error

func (*IstioRollBackJob) SetPreset

func (j *IstioRollBackJob) SetPreset() error

func (*IstioRollBackJob) ToJobs

func (j *IstioRollBackJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type JiraJob

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

func (*JiraJob) Instantiate

func (j *JiraJob) Instantiate() error

func (*JiraJob) LintJob

func (j *JiraJob) LintJob() error

func (*JiraJob) MergeArgs

func (j *JiraJob) MergeArgs(args *commonmodels.Job) error

func (*JiraJob) SetPreset

func (j *JiraJob) SetPreset() error

func (*JiraJob) ToJobs

func (j *JiraJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type JobCtl

type JobCtl interface {
	Instantiate() error
	SetPreset() error
	ToJobs(taskID int64) ([]*commonmodels.JobTask, error)
	MergeArgs(args *commonmodels.Job) error
	LintJob() error
}

func InitJobCtl

func InitJobCtl(job *commonmodels.Job, workflow *commonmodels.WorkflowV4) (JobCtl, error)

type K8sPacthJob

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

func (*K8sPacthJob) Instantiate

func (j *K8sPacthJob) Instantiate() error

func (*K8sPacthJob) LintJob

func (j *K8sPacthJob) LintJob() error

func (*K8sPacthJob) MergeArgs

func (j *K8sPacthJob) MergeArgs(args *commonmodels.Job) error

func (*K8sPacthJob) SetPreset

func (j *K8sPacthJob) SetPreset() error

func (*K8sPacthJob) ToJobs

func (j *K8sPacthJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type MeegoTransitionJob

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

func (*MeegoTransitionJob) Instantiate

func (j *MeegoTransitionJob) Instantiate() error

func (*MeegoTransitionJob) LintJob

func (j *MeegoTransitionJob) LintJob() error

func (*MeegoTransitionJob) MergeArgs

func (j *MeegoTransitionJob) MergeArgs(args *commonmodels.Job) error

func (*MeegoTransitionJob) SetPreset

func (j *MeegoTransitionJob) SetPreset() error

func (*MeegoTransitionJob) ToJobs

func (j *MeegoTransitionJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type MseGrayOfflineJob

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

func (*MseGrayOfflineJob) Instantiate

func (j *MseGrayOfflineJob) Instantiate() error

func (*MseGrayOfflineJob) LintJob

func (j *MseGrayOfflineJob) LintJob() error

func (*MseGrayOfflineJob) MergeArgs

func (j *MseGrayOfflineJob) MergeArgs(args *commonmodels.Job) error

func (*MseGrayOfflineJob) SetPreset

func (j *MseGrayOfflineJob) SetPreset() error

func (*MseGrayOfflineJob) ToJobs

func (j *MseGrayOfflineJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type MseGrayReleaseJob

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

func (*MseGrayReleaseJob) Instantiate

func (j *MseGrayReleaseJob) Instantiate() error

func (*MseGrayReleaseJob) LintJob

func (j *MseGrayReleaseJob) LintJob() error

func (*MseGrayReleaseJob) MergeArgs

func (j *MseGrayReleaseJob) MergeArgs(args *commonmodels.Job) error

func (*MseGrayReleaseJob) SetPreset

func (j *MseGrayReleaseJob) SetPreset() error

func (*MseGrayReleaseJob) ToJobs

func (j *MseGrayReleaseJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type NacosJob

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

func (*NacosJob) Instantiate

func (j *NacosJob) Instantiate() error

func (*NacosJob) LintJob

func (j *NacosJob) LintJob() error

func (*NacosJob) MergeArgs

func (j *NacosJob) MergeArgs(args *commonmodels.Job) error

func (*NacosJob) SetPreset

func (j *NacosJob) SetPreset() error

func (*NacosJob) ToJobs

func (j *NacosJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type OfflineServiceJob

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

func (*OfflineServiceJob) Instantiate

func (j *OfflineServiceJob) Instantiate() error

func (*OfflineServiceJob) LintJob

func (j *OfflineServiceJob) LintJob() error

func (*OfflineServiceJob) MergeArgs

func (j *OfflineServiceJob) MergeArgs(args *commonmodels.Job) error

func (*OfflineServiceJob) SetPreset

func (j *OfflineServiceJob) SetPreset() error

func (*OfflineServiceJob) ToJobs

func (j *OfflineServiceJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type PluginJob

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

func (*PluginJob) GetOutPuts

func (j *PluginJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*PluginJob) Instantiate

func (j *PluginJob) Instantiate() error

func (*PluginJob) LintJob

func (j *PluginJob) LintJob() error

func (*PluginJob) MergeArgs

func (j *PluginJob) MergeArgs(args *commonmodels.Job) error

func (*PluginJob) SetPreset

func (j *PluginJob) SetPreset() error

func (*PluginJob) ToJobs

func (j *PluginJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type RepoIndex

type RepoIndex struct {
	JobName       string `json:"job_name"`
	ServiceName   string `json:"service_name"`
	ServiceModule string `json:"service_module"`
	RepoIndex     int    `json:"repo_index"`
}

func GetWorkflowRepoIndex

func GetWorkflowRepoIndex(workflow *commonmodels.WorkflowV4, currentJobName string, log *zap.SugaredLogger) []*RepoIndex

type ScanningJob

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

func (*ScanningJob) GetOutPuts

func (j *ScanningJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*ScanningJob) GetRepos

func (j *ScanningJob) GetRepos() ([]*types.Repository, error)

func (*ScanningJob) Instantiate

func (j *ScanningJob) Instantiate() error

func (*ScanningJob) LintJob

func (j *ScanningJob) LintJob() error

func (*ScanningJob) MergeArgs

func (j *ScanningJob) MergeArgs(args *commonmodels.Job) error

func (*ScanningJob) MergeWebhookRepo

func (j *ScanningJob) MergeWebhookRepo(webhookRepo *types.Repository) error

func (*ScanningJob) SetPreset

func (j *ScanningJob) SetPreset() error

func (*ScanningJob) ToJobs

func (j *ScanningJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type TestingJob

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

func (*TestingJob) GetOutPuts

func (j *TestingJob) GetOutPuts(log *zap.SugaredLogger) []string

func (*TestingJob) GetRepos

func (j *TestingJob) GetRepos() ([]*types.Repository, error)

func (*TestingJob) Instantiate

func (j *TestingJob) Instantiate() error

func (*TestingJob) LintJob

func (j *TestingJob) LintJob() error

func (*TestingJob) MergeArgs

func (j *TestingJob) MergeArgs(args *commonmodels.Job) error

func (*TestingJob) MergeWebhookRepo

func (j *TestingJob) MergeWebhookRepo(webhookRepo *types.Repository) error

func (*TestingJob) SetPreset

func (j *TestingJob) SetPreset() error

func (*TestingJob) ToJobs

func (j *TestingJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

type WorkflowTriggerJob

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

func (*WorkflowTriggerJob) Instantiate

func (j *WorkflowTriggerJob) Instantiate() error

func (*WorkflowTriggerJob) LintJob

func (j *WorkflowTriggerJob) LintJob() error

func (*WorkflowTriggerJob) MergeArgs

func (j *WorkflowTriggerJob) MergeArgs(args *commonmodels.Job) error

func (*WorkflowTriggerJob) SetPreset

func (j *WorkflowTriggerJob) SetPreset() error

func (*WorkflowTriggerJob) ToJobs

func (j *WorkflowTriggerJob) ToJobs(taskID int64) ([]*commonmodels.JobTask, error)

Jump to

Keyboard shortcuts

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