add WorkSpaceBase to Step struct, set as default workingDir

This commit is contained in:
pat-s 2024-10-02 10:20:14 +02:00
parent 102833b54e
commit baa72e044f
No known key found for this signature in database
GPG key ID: 3C6318841EF78925
3 changed files with 3 additions and 1 deletions

View file

@ -182,7 +182,7 @@ func podContainer(step *types.Step, podName, goos string, options BackendOptions
container := v1.Container{ container := v1.Container{
Name: podName, Name: podName,
Image: step.Image, Image: step.Image,
WorkingDir: step.WorkingDir, WorkingDir: step.WorkSpaceBase,
Ports: containerPorts(step.Ports), Ports: containerPorts(step.Ports),
SecurityContext: containerSecurityContext(options.SecurityContext, step.Privileged), SecurityContext: containerSecurityContext(options.SecurityContext, step.Privileged),
} }

View file

@ -24,6 +24,7 @@ type Step struct {
Detached bool `json:"detach,omitempty"` Detached bool `json:"detach,omitempty"`
Privileged bool `json:"privileged,omitempty"` Privileged bool `json:"privileged,omitempty"`
WorkingDir string `json:"working_dir,omitempty"` WorkingDir string `json:"working_dir,omitempty"`
WorkSpaceBase string `json:"workspace_base,omitempty"`
Environment map[string]string `json:"environment,omitempty"` Environment map[string]string `json:"environment,omitempty"`
Entrypoint []string `json:"entrypoint,omitempty"` Entrypoint []string `json:"entrypoint,omitempty"`
Commands []string `json:"commands,omitempty"` Commands []string `json:"commands,omitempty"`

View file

@ -179,6 +179,7 @@ func (c *Compiler) createProcess(container *yaml_types.Container, stepType backe
Detached: detached, Detached: detached,
Privileged: privileged, Privileged: privileged,
WorkingDir: workingDir, WorkingDir: workingDir,
WorkSpaceBase: workspaceBase,
Environment: environment, Environment: environment,
Commands: container.Commands, Commands: container.Commands,
Entrypoint: container.Entrypoint, Entrypoint: container.Entrypoint,