Skip to content
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

refactor: remove hcl support #2460

Merged
merged 1 commit into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions cli/cds/action/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ func cmdActionAdd() *cobra.Command {
Short: "cds action add [<actionName>]",
Long: `cds action add [<actionName>]

<actionName> is mandatory if you don't use --url flag

Examples of usage:

$cds action add --url $HOME/src/github.com/ovh/cds/contrib/actions/action-scripts/cds-docker-package.hcl
<actionName> is mandatory

`,
Run: addAction,
Expand Down
2 changes: 1 addition & 1 deletion cli/cds/environment/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func exportCmd() *cobra.Command {
},
}

cmd.Flags().StringVarP(&exportFormat, "format", "", "yaml", "Format: json|yaml|hcl")
cmd.Flags().StringVarP(&exportFormat, "format", "", "yaml", "Format: json|yaml")
cmd.Flags().StringVarP(&exportOutput, "output", "", "", "Output filename")

return cmd
Expand Down
2 changes: 1 addition & 1 deletion cli/cds/pipeline/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func exportCmd() *cobra.Command {
},
}

cmd.Flags().StringVarP(&exportFormat, "format", "", "yaml", "Format: json|yaml|hcl")
cmd.Flags().StringVarP(&exportFormat, "format", "", "yaml", "Format: json|yaml")
cmd.Flags().StringVarP(&exportOutput, "output", "", "", "Output filename")
cmd.Flags().BoolVarP(&exportWithPermissions, "withPermissions", "", false, "Export pipeline configuration with permission")

Expand Down
2 changes: 0 additions & 2 deletions cli/cds/pipeline/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ func importCmd() *cobra.Command {
importFormat = "yaml"
if strings.HasSuffix(name, ".json") {
importFormat = "json"
} else if strings.HasSuffix(name, ".hcl") {
importFormat = "hcl"
}
var err error
btes, _, err = exportentities.ReadFile(name)
Expand Down
2 changes: 0 additions & 2 deletions cli/cdsctl/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ func pipelineImportRun(v cli.Values) error {

if strings.HasSuffix(v["path"], ".json") {
format = "json"
} else if strings.HasSuffix(v["path"], ".hcl") {
format = "hcl"
}

isURL, _ := regexp.MatchString(`http[s]?:\/\/(.*)`, v["path"])
Expand Down
295 changes: 0 additions & 295 deletions sdk/action_script_test.go

This file was deleted.

2 changes: 0 additions & 2 deletions sdk/exportentities/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ func GetFormat(f string) (Format, error) {
return FormatJSON, nil
case "toml", "tml":
return FormatTOML, nil
case "hcl":
return FormatHCL, nil
default:
return UnknownFormat, ErrUnsupportedFormat
}
Expand Down
5 changes: 1 addition & 4 deletions sdk/exportentities/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import (
)

func TestReadURL(t *testing.T) {
b, _, _ := ReadURL("https://raw.githubusercontent.com/ovh/cds/master/contrib/actions/cds-docker-package.hcl", "hcl")
assert.True(t, len(b) > 0)

b, _, _ = ReadURL("https://raw.githubusercontent.com/ovh/tat/master/.travis.yml", "yml")
b, _, _ := ReadURL("https://raw.githubusercontent.com/ovh/tat/master/.travis.yml", "yml")
assert.True(t, len(b) > 0)
}
12 changes: 6 additions & 6 deletions sdk/exportentities/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type Pipeline struct {
Parameters map[string]ParameterValue `json:"parameters,omitempty" yaml:"parameters,omitempty"`
Stages map[string]Stage `json:"stages,omitempty" yaml:"stages,omitempty"`
Jobs map[string]Job `json:"jobs,omitempty" yaml:"jobs,omitempty"`
Requirements []Requirement `json:"requirements,omitempty" yaml:"requirements,omitempty" hcl:"requirement,omitempty"`
Steps []Step `json:"steps,omitempty" yaml:"steps,omitempty" hcl:"step,omitempty"`
Requirements []Requirement `json:"requirements,omitempty" yaml:"requirements,omitempty"`
Steps []Step `json:"steps,omitempty" yaml:"steps,omitempty"`
}

// Stage represents exported sdk.Stage
Expand All @@ -49,10 +49,10 @@ type Job struct {
Stage string `json:"stage,omitempty" yaml:"stage,omitempty"` //This will ONLY be set with Pipelinev1
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
Steps []Step `json:"steps,omitempty" yaml:"steps,omitempty" hcl:"step,omitempty"`
Requirements []Requirement `json:"requirements,omitempty" yaml:"requirements,omitempty" hcl:"requirement,omitempty"`
Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty" hcl:"optional,omitempty"`
AlwaysExecuted *bool `json:"always_executed,omitempty" yaml:"always_executed,omitempty" hcl:"always_executed,omitempty"`
Steps []Step `json:"steps,omitempty" yaml:"steps,omitempty"`
Requirements []Requirement `json:"requirements,omitempty" yaml:"requirements,omitempty"`
Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"`
AlwaysExecuted *bool `json:"always_executed,omitempty" yaml:"always_executed,omitempty"`
}

// Step represents exported step used in a job
Expand Down
1 change: 0 additions & 1 deletion sdk/exportentities/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const (
FormatJSON Format = iota
FormatYAML
FormatTOML
FormatHCL
UnknownFormat
)

Expand Down