-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cdsctl,api): allow to push a template from url #3810
Conversation
…ow to push a template from url
cli/cdsctl/environment_group.go
Outdated
@@ -63,8 +62,7 @@ func environmentGroupImportRun(v cli.Values) error { | |||
format = "json" | |||
} | |||
|
|||
isURL, _ := regexp.MatchString(`http[s]?:\/\/(.*)`, v["path"]) | |||
if isURL { | |||
if exportentities.IsURL(v["path"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v.GetString
cli/cdsctl/environment_group.go
Outdated
@@ -63,8 +62,7 @@ func environmentGroupImportRun(v cli.Values) error { | |||
format = "json" | |||
} | |||
|
|||
isURL, _ := regexp.MatchString(`http[s]?:\/\/(.*)`, v["path"]) | |||
if isURL { | |||
if exportentities.IsURL(v["path"]) { | |||
var err error | |||
reader, _, err = exportentities.OpenURL(v["path"], format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v.GetString
cli/cdsctl/pipeline.go
Outdated
@@ -130,8 +129,7 @@ func pipelineImportRun(v cli.Values) error { | |||
format = "json" | |||
} | |||
|
|||
isURL, _ := regexp.MatchString(`http[s]?:\/\/(.*)`, v["path"]) | |||
if isURL { | |||
if exportentities.IsURL(v["path"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v.GetString
cli/cdsctl/pipeline_group.go
Outdated
@@ -64,8 +63,7 @@ func pipelineGroupImportRun(v cli.Values) error { | |||
format = "json" | |||
} | |||
|
|||
isURL, _ := regexp.MatchString(`http[s]?:\/\/(.*)`, v["path"]) | |||
if isURL { | |||
if exportentities.IsURL(v["path"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v.GetString
cli/cdsctl/project_group.go
Outdated
@@ -62,8 +61,7 @@ func projectGroupImportRun(v cli.Values) error { | |||
format = "json" | |||
} | |||
|
|||
isURL, _ := regexp.MatchString(`http[s]?:\/\/(.*)`, v["path"]) | |||
if isURL { | |||
if exportentities.IsURL(v["path"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v.GetString
cli/cdsctl/template.go
Outdated
} | ||
buf := new(bytes.Buffer) | ||
if _, err := buf.ReadFrom(contentFile); err != nil { | ||
return fmt.Errorf("Cannot read from given remote file: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error strings should not start with a capital letter because they'll often be prefixed before printing:
cli/cdsctl/template.go
Outdated
} | ||
var t exportentities.Template | ||
if err := yaml.Unmarshal(buf.Bytes(), &t); err != nil { | ||
return fmt.Errorf("Cannot unmarshal given remote yaml file: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error strings should not start with a capital letter because they'll often be prefixed before printing:
cli/cdsctl/template.go
Outdated
for _, file := range files { | ||
fi, err := os.Lstat(file) | ||
if err != nil { | ||
fmt.Printf("Skipping file %s: %v\n", file, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error strings should not start with a capital letter because they'll often be prefixed before printing:
@ovh/cds