mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-08 14:40:34 +00:00
Respect directory
option for steps again (#4319)
This commit is contained in:
@@ -183,7 +183,7 @@ func podContainer(step *types.Step, podName, goos string, options BackendOptions
|
||||
container := v1.Container{
|
||||
Name: podName,
|
||||
Image: step.Image,
|
||||
WorkingDir: step.WorkspaceBase,
|
||||
WorkingDir: step.WorkingDir,
|
||||
Ports: containerPorts(step.Ports),
|
||||
SecurityContext: containerSecurityContext(options.SecurityContext, step.Privileged),
|
||||
}
|
||||
@@ -193,9 +193,12 @@ func podContainer(step *types.Step, podName, goos string, options BackendOptions
|
||||
}
|
||||
|
||||
if len(step.Commands) > 0 {
|
||||
scriptEnv, command := common.GenerateContainerConf(step.Commands, goos)
|
||||
scriptEnv, command := common.GenerateContainerConf(step.Commands, goos, step.WorkingDir)
|
||||
container.Command = command
|
||||
maps.Copy(step.Environment, scriptEnv)
|
||||
|
||||
// step.WorkingDir will be respected by the generated script
|
||||
container.WorkingDir = step.WorkspaceBase
|
||||
}
|
||||
if len(step.Entrypoint) > 0 {
|
||||
container.Command = step.Entrypoint
|
||||
|
Reference in New Issue
Block a user