mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-12 23:39:54 +00:00
@@ -96,7 +96,7 @@ func TestCompilerCompile(t *testing.T) {
|
||||
OnSuccess: true,
|
||||
Failure: "fail",
|
||||
Volumes: []string{defaultVolume.Name + ":/woodpecker"},
|
||||
WorkingDir: "/woodpecker",
|
||||
WorkingDir: "/woodpecker/src/github.com/octocat/hello-world",
|
||||
WorkspaceBase: "/woodpecker",
|
||||
Networks: []backend_types.Conn{{Name: "test_default", Aliases: []string{"clone"}}},
|
||||
ExtraHosts: []backend_types.HostAlias{},
|
||||
|
@@ -96,7 +96,7 @@ func (c *Compiler) createProcess(container *yaml_types.Container, workflow *yaml
|
||||
detached = true
|
||||
}
|
||||
|
||||
workingDir = c.stepWorkingDir(container, stepType)
|
||||
workingDir = c.stepWorkingDir(container)
|
||||
|
||||
getSecretValue := func(name string) (string, error) {
|
||||
name = strings.ToLower(name)
|
||||
@@ -185,7 +185,7 @@ func (c *Compiler) createProcess(container *yaml_types.Container, workflow *yaml
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *Compiler) stepWorkingDir(container *yaml_types.Container, stepType backend_types.StepType) string {
|
||||
func (c *Compiler) stepWorkingDir(container *yaml_types.Container) string {
|
||||
if path.IsAbs(container.Directory) {
|
||||
return container.Directory
|
||||
}
|
||||
@@ -193,9 +193,6 @@ func (c *Compiler) stepWorkingDir(container *yaml_types.Container, stepType back
|
||||
if container.IsPlugin() {
|
||||
base = pluginWorkspaceBase
|
||||
}
|
||||
if stepType == backend_types.StepTypeClone {
|
||||
return base
|
||||
}
|
||||
return path.Join(base, c.workspacePath, container.Directory)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user