|
@@ -2,9 +2,10 @@ package pipeline
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
+ "git.sxidc.com/go-tools/utils/fileutils"
|
|
|
"git.sxidc.com/go-tools/utils/pipeline/component"
|
|
|
"git.sxidc.com/go-tools/utils/pipeline/component/flow"
|
|
|
- "git.sxidc.com/go-tools/utils/pipeline/utils"
|
|
|
+ "git.sxidc.com/go-tools/utils/strutils"
|
|
|
"gopkg.in/yaml.v3"
|
|
|
"os"
|
|
|
)
|
|
@@ -42,11 +43,11 @@ func (p *Pipeline) Run(globalRunParams map[string]any, dynamicParams map[string]
|
|
|
}
|
|
|
|
|
|
func NewPipelineFromYaml(yamlPath string) (*Pipeline, error) {
|
|
|
- if utils.IsStringEmpty(yamlPath) {
|
|
|
+ if strutils.IsStringEmpty(yamlPath) {
|
|
|
return nil, errors.New("没有传递流水线定义文件")
|
|
|
}
|
|
|
|
|
|
- if !utils.PathExists(yamlPath) {
|
|
|
+ if !fileutils.PathExists(yamlPath) {
|
|
|
return nil, errors.New("流水线定义文件不存在")
|
|
|
}
|
|
|
|
|
@@ -65,7 +66,7 @@ func NewPipelineFromYaml(yamlPath string) (*Pipeline, error) {
|
|
|
}
|
|
|
|
|
|
func NewPipelineFromYamlStr(yamlStr string) (*Pipeline, error) {
|
|
|
- if utils.IsStringEmpty(yamlStr) {
|
|
|
+ if strutils.IsStringEmpty(yamlStr) {
|
|
|
return nil, errors.New("没有传递流水线定义")
|
|
|
}
|
|
|
|
|
@@ -79,11 +80,11 @@ func NewPipelineFromYamlStr(yamlStr string) (*Pipeline, error) {
|
|
|
}
|
|
|
|
|
|
func LoadDynamicParamsFromYaml(yamlPath string) (map[string]any, error) {
|
|
|
- if utils.IsStringEmpty(yamlPath) {
|
|
|
+ if strutils.IsStringEmpty(yamlPath) {
|
|
|
return nil, errors.New("没有传递流水线动态参数文件不存在")
|
|
|
}
|
|
|
|
|
|
- if !utils.PathExists(yamlPath) {
|
|
|
+ if !fileutils.PathExists(yamlPath) {
|
|
|
return nil, errors.New("流水线动态参数文件不存在")
|
|
|
}
|
|
|
|
|
@@ -102,7 +103,7 @@ func LoadDynamicParamsFromYaml(yamlPath string) (map[string]any, error) {
|
|
|
}
|
|
|
|
|
|
func LoadDynamicParamsFromYamlStr(yamlStr string) (map[string]any, error) {
|
|
|
- if utils.IsStringEmpty(yamlStr) {
|
|
|
+ if strutils.IsStringEmpty(yamlStr) {
|
|
|
return nil, errors.New("没有传递流水线动态参数不存在")
|
|
|
}
|
|
|
|