Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
fix: merge conflict with mod
Browse files Browse the repository at this point in the history
  • Loading branch information
kneal committed Jan 11, 2021
2 parents 2d5a35d + 3f2f8a7 commit b832d37
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 75 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>go-vela/renovate-config"
]
}
6 changes: 4 additions & 2 deletions compiler/native/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const (
serviceID = "service_%s_%s_%d_%s"
// default ID for secrets in a pipeline.
// format: `secret_<org name>_<repo name>_<build number>_<secret name>`
//
// nolint: gosec // ignore gosec keying off of secret as no credentials are hardcoded
secretID = "secret_%s_%s_%d_%s"
)

Expand Down Expand Up @@ -59,7 +61,7 @@ func (c *client) TransformStages(r *pipeline.RuleData, p *yaml.Build) (*pipeline
step.ID = pattern

// set the workspace directory
step.Directory = fmt.Sprintf("/vela/src/%s/%s/%s", c.metadata.Source.Host, org, name)
step.Directory = step.Environment["VELA_WORKSPACE"]
}
}

Expand Down Expand Up @@ -118,7 +120,7 @@ func (c *client) TransformSteps(r *pipeline.RuleData, p *yaml.Build) (*pipeline.
step.ID = pattern

// set the workspace directory
step.Directory = fmt.Sprintf("/vela/src/%s/%s/%s", c.metadata.Source.Host, org, name)
step.Directory = step.Environment["VELA_WORKSPACE"]
}

// set the unique ID for each service in the executable pipeline
Expand Down
66 changes: 36 additions & 30 deletions compiler/native/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ func TestNative_TransformStages(t *testing.T) {
Name: "install deps",
Steps: yaml.StepSlice{
&yaml.Step{
Commands: []string{"./gradlew downloadDependencies"},
Image: "openjdk:latest",
Name: "install",
Pull: "always",
Commands: []string{"./gradlew downloadDependencies"},
Environment: environment(nil, nil, nil, nil),
Image: "openjdk:latest",
Name: "install",
Pull: "always",
},
},
},
Expand All @@ -71,10 +72,11 @@ func TestNative_TransformStages(t *testing.T) {
Needs: []string{"install"},
Steps: yaml.StepSlice{
&yaml.Step{
Commands: []string{"./gradlew check"},
Image: "openjdk:latest",
Name: "test",
Pull: "always",
Commands: []string{"./gradlew check"},
Environment: environment(nil, nil, nil, nil),
Image: "openjdk:latest",
Name: "test",
Pull: "always",
Ruleset: yaml.Ruleset{
If: yaml.Rules{
Event: []string{"push"},
Expand Down Expand Up @@ -119,13 +121,14 @@ func TestNative_TransformStages(t *testing.T) {
Name: "install deps",
Steps: pipeline.ContainerSlice{
&pipeline.Container{
ID: "__0_install deps_install",
Directory: "/vela/src/foo//",
Commands: []string{"./gradlew downloadDependencies"},
Image: "openjdk:latest",
Name: "install",
Number: 1,
Pull: "always",
ID: "__0_install deps_install",
Commands: []string{"./gradlew downloadDependencies"},
Directory: "/vela",
Environment: environment(nil, nil, nil, nil),
Image: "openjdk:latest",
Name: "install",
Number: 1,
Pull: "always",
},
},
},
Expand Down Expand Up @@ -214,16 +217,18 @@ func TestNative_TransformSteps(t *testing.T) {
},
Steps: yaml.StepSlice{
&yaml.Step{
Commands: []string{"./gradlew downloadDependencies"},
Image: "openjdk:latest",
Name: "install deps",
Pull: "always",
Commands: []string{"./gradlew downloadDependencies"},
Environment: environment(nil, nil, nil, nil),
Image: "openjdk:latest",
Name: "install deps",
Pull: "always",
},
&yaml.Step{
Commands: []string{"./gradlew check"},
Image: "openjdk:latest",
Name: "test",
Pull: "always",
Commands: []string{"./gradlew check"},
Environment: environment(nil, nil, nil, nil),
Image: "openjdk:latest",
Name: "test",
Pull: "always",
Ruleset: yaml.Ruleset{
If: yaml.Rules{
Event: []string{"push"},
Expand Down Expand Up @@ -263,13 +268,14 @@ func TestNative_TransformSteps(t *testing.T) {
},
Steps: pipeline.ContainerSlice{
&pipeline.Container{
ID: "step___0_install deps",
Directory: "/vela/src/foo//",
Commands: []string{"./gradlew downloadDependencies"},
Image: "openjdk:latest",
Name: "install deps",
Number: 1,
Pull: "always",
ID: "step___0_install deps",
Commands: []string{"./gradlew downloadDependencies"},
Directory: "/vela",
Environment: environment(nil, nil, nil, nil),
Image: "openjdk:latest",
Name: "install deps",
Number: 1,
Pull: "always",
},
},
Secrets: pipeline.SecretSlice{
Expand Down
21 changes: 8 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,27 @@ module github.com/go-vela/compiler
go 1.15

require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/Masterminds/sprig/v3 v3.2.0
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/drone/envsubst v1.0.2
github.com/gin-gonic/gin v1.6.3
github.com/go-vela/types v0.6.1-0.20210111181528-d3bb371e9ec6
github.com/goccy/go-yaml v1.8.4
github.com/google/go-cmp v0.5.1
github.com/google/go-cmp v0.5.4
github.com/google/go-github/v24 v24.0.1
github.com/google/uuid v1.1.2 // indirect
github.com/google/uuid v1.1.4 // indirect
github.com/goware/urlx v0.3.1
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-retryablehttp v0.6.7
github.com/hashicorp/go-retryablehttp v0.6.8
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/sirupsen/logrus v1.7.0
github.com/ugorji/go v1.1.11 // indirect
github.com/urfave/cli/v2 v2.2.0
github.com/urfave/cli/v2 v2.3.0
go.starlark.net v0.0.0-20201014215153-dff0ae5b4820
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee // indirect
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5
golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.19.3
k8s.io/apimachinery v0.20.1
)
Loading

0 comments on commit b832d37

Please sign in to comment.