diff --git a/cli/exec/exec.go b/cli/exec/exec.go index d33d96c65..0a61c000d 100644 --- a/cli/exec/exec.go +++ b/cli/exec/exec.go @@ -190,17 +190,13 @@ func execWithAxis(ctx context.Context, c *cli.Command, file, repoPath string, ax if c.Bool("local") { var ( workspaceBase = conf.Workspace.Base - workspacePath = conf.Workspace.Path ) if workspaceBase == "" { workspaceBase = c.String("workspace-base") } - if workspacePath == "" { - workspacePath = c.String("workspace-path") - } volumes = append(volumes, prefix+"_default:"+workspaceBase) - volumes = append(volumes, repoPath+":"+path.Join(workspaceBase, workspacePath)) + volumes = append(volumes, repoPath+":"+path.Join(workspaceBase)) } privilegedPlugins := c.StringSlice("plugins-privileged") diff --git a/pipeline/backend/kubernetes/pod.go b/pipeline/backend/kubernetes/pod.go index 42a13e4cc..50ae55dcd 100644 --- a/pipeline/backend/kubernetes/pod.go +++ b/pipeline/backend/kubernetes/pod.go @@ -182,8 +182,7 @@ func podContainer(step *types.Step, podName, goos string, options BackendOptions container := v1.Container{ Name: podName, Image: step.Image, - // WorkingDir: step.WorkingDir, - WorkingDir: "/woodpecker", + WorkingDir: step.WorkingDir, Ports: containerPorts(step.Ports), SecurityContext: containerSecurityContext(options.SecurityContext, step.Privileged), } diff --git a/pipeline/frontend/yaml/compiler/compiler.go b/pipeline/frontend/yaml/compiler/compiler.go index 68eb1495e..319c399ab 100644 --- a/pipeline/frontend/yaml/compiler/compiler.go +++ b/pipeline/frontend/yaml/compiler/compiler.go @@ -91,7 +91,6 @@ type Compiler struct { env map[string]string cloneEnv map[string]string workspaceBase string - workspacePath string metadata metadata.Metadata registries []Registry secrets map[string]Secret @@ -152,9 +151,6 @@ func (c *Compiler) Compile(conf *yaml_types.Workflow) (*backend_types.Config, er if len(conf.Workspace.Base) != 0 { c.workspaceBase = path.Clean(conf.Workspace.Base) } - if len(conf.Workspace.Path) != 0 { - c.workspacePath = path.Clean(conf.Workspace.Path) - } // add default clone step if !c.local && len(conf.Clone.ContainerList) == 0 && !conf.SkipClone && len(c.defaultClonePlugin) != 0 { diff --git a/pipeline/frontend/yaml/compiler/convert.go b/pipeline/frontend/yaml/compiler/convert.go index 792e35505..4c6802518 100644 --- a/pipeline/frontend/yaml/compiler/convert.go +++ b/pipeline/frontend/yaml/compiler/convert.go @@ -90,7 +90,7 @@ func (c *Compiler) createProcess(container *yaml_types.Container, stepType backe environment := map[string]string{} maps.Copy(environment, c.env) - environment["CI_WORKSPACE"] = path.Join(workspaceBase, c.workspacePath) + environment["CI_WORKSPACE"] = path.Join(workspaceBase) if stepType == backend_types.StepTypeService || container.Detached { detached = true @@ -207,7 +207,7 @@ func (c *Compiler) stepWorkingDir(container *yaml_types.Container) string { if container.IsPlugin() { base = pluginWorkspaceBase } - return path.Join(base, c.workspacePath, container.Directory) +return path.Join(base) } func convertPort(portDef string) (backend_types.Port, error) { diff --git a/pipeline/frontend/yaml/compiler/option.go b/pipeline/frontend/yaml/compiler/option.go index 96c18f8c2..17d936fba 100644 --- a/pipeline/frontend/yaml/compiler/option.go +++ b/pipeline/frontend/yaml/compiler/option.go @@ -98,7 +98,6 @@ func WithNetrc(username, password, machine string) Option { func WithWorkspace(base, path string) Option { return func(compiler *Compiler) { compiler.workspaceBase = base - compiler.workspacePath = path } } diff --git a/pipeline/frontend/yaml/compiler/option_test.go b/pipeline/frontend/yaml/compiler/option_test.go index b4c179d20..87d3575b6 100644 --- a/pipeline/frontend/yaml/compiler/option_test.go +++ b/pipeline/frontend/yaml/compiler/option_test.go @@ -31,7 +31,6 @@ func TestWithWorkspace(t *testing.T) { ), ) assert.Equal(t, "/pipeline", compiler.workspaceBase) - assert.Equal(t, "src/github.com/octocat/hello-world", compiler.workspacePath) } func TestWithEscalated(t *testing.T) {