|
@@ -5,9 +5,9 @@ import (
|
|
|
"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/strutils"
|
|
|
"gopkg.in/yaml.v3"
|
|
|
"os"
|
|
|
+ "strings"
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
@@ -43,7 +43,7 @@ func (p *Pipeline) Run(globalRunParams map[string]any, dynamicParams map[string]
|
|
|
}
|
|
|
|
|
|
func NewPipelineFromYaml(yamlPath string) (*Pipeline, error) {
|
|
|
- if strutils.IsStringEmpty(yamlPath) {
|
|
|
+ if strings.TrimSpace(yamlPath) == "" {
|
|
|
return nil, errors.New("没有传递流水线定义文件")
|
|
|
}
|
|
|
|
|
@@ -66,7 +66,7 @@ func NewPipelineFromYaml(yamlPath string) (*Pipeline, error) {
|
|
|
}
|
|
|
|
|
|
func NewPipelineFromYamlStr(yamlStr string) (*Pipeline, error) {
|
|
|
- if strutils.IsStringEmpty(yamlStr) {
|
|
|
+ if strings.TrimSpace(yamlStr) == "" {
|
|
|
return nil, errors.New("没有传递流水线定义")
|
|
|
}
|
|
|
|
|
@@ -80,7 +80,7 @@ func NewPipelineFromYamlStr(yamlStr string) (*Pipeline, error) {
|
|
|
}
|
|
|
|
|
|
func LoadDynamicParamsFromYaml(yamlPath string) (map[string]any, error) {
|
|
|
- if strutils.IsStringEmpty(yamlPath) {
|
|
|
+ if strings.TrimSpace(yamlPath) == "" {
|
|
|
return nil, errors.New("没有传递流水线动态参数文件不存在")
|
|
|
}
|
|
|
|
|
@@ -103,7 +103,7 @@ func LoadDynamicParamsFromYaml(yamlPath string) (map[string]any, error) {
|
|
|
}
|
|
|
|
|
|
func LoadDynamicParamsFromYamlStr(yamlStr string) (map[string]any, error) {
|
|
|
- if strutils.IsStringEmpty(yamlStr) {
|
|
|
+ if strings.TrimSpace(yamlStr) == "" {
|
|
|
return nil, errors.New("没有传递流水线动态参数不存在")
|
|
|
}
|
|
|
|