You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Renamed procs/jobs to steps in code (#1331)
Renamed `procs` to `steps` in code for the issue #1288 Co-authored-by: Harikesh Prajapati <harikesh.prajapati@druva.com> Co-authored-by: qwerty287 <ndev@web.de> Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -12,73 +12,73 @@ import (
|
||||
)
|
||||
|
||||
// returns a container configuration.
|
||||
func toConfig(proc *types.Step) *container.Config {
|
||||
func toConfig(step *types.Step) *container.Config {
|
||||
config := &container.Config{
|
||||
Image: proc.Image,
|
||||
Labels: proc.Labels,
|
||||
WorkingDir: proc.WorkingDir,
|
||||
Image: step.Image,
|
||||
Labels: step.Labels,
|
||||
WorkingDir: step.WorkingDir,
|
||||
AttachStdout: true,
|
||||
AttachStderr: true,
|
||||
}
|
||||
if len(proc.Environment) != 0 {
|
||||
config.Env = toEnv(proc.Environment)
|
||||
if len(step.Environment) != 0 {
|
||||
config.Env = toEnv(step.Environment)
|
||||
}
|
||||
if len(proc.Command) != 0 {
|
||||
config.Cmd = proc.Command
|
||||
if len(step.Command) != 0 {
|
||||
config.Cmd = step.Command
|
||||
}
|
||||
if len(proc.Entrypoint) != 0 {
|
||||
config.Entrypoint = proc.Entrypoint
|
||||
if len(step.Entrypoint) != 0 {
|
||||
config.Entrypoint = step.Entrypoint
|
||||
}
|
||||
if len(proc.Volumes) != 0 {
|
||||
config.Volumes = toVol(proc.Volumes)
|
||||
if len(step.Volumes) != 0 {
|
||||
config.Volumes = toVol(step.Volumes)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// returns a container host configuration.
|
||||
func toHostConfig(proc *types.Step) *container.HostConfig {
|
||||
func toHostConfig(step *types.Step) *container.HostConfig {
|
||||
config := &container.HostConfig{
|
||||
Resources: container.Resources{
|
||||
CPUQuota: proc.CPUQuota,
|
||||
CPUShares: proc.CPUShares,
|
||||
CpusetCpus: proc.CPUSet,
|
||||
Memory: proc.MemLimit,
|
||||
MemorySwap: proc.MemSwapLimit,
|
||||
CPUQuota: step.CPUQuota,
|
||||
CPUShares: step.CPUShares,
|
||||
CpusetCpus: step.CPUSet,
|
||||
Memory: step.MemLimit,
|
||||
MemorySwap: step.MemSwapLimit,
|
||||
},
|
||||
LogConfig: container.LogConfig{
|
||||
Type: "json-file",
|
||||
},
|
||||
Privileged: proc.Privileged,
|
||||
ShmSize: proc.ShmSize,
|
||||
Sysctls: proc.Sysctls,
|
||||
Privileged: step.Privileged,
|
||||
ShmSize: step.ShmSize,
|
||||
Sysctls: step.Sysctls,
|
||||
}
|
||||
|
||||
// if len(proc.VolumesFrom) != 0 {
|
||||
// config.VolumesFrom = proc.VolumesFrom
|
||||
// if len(step.VolumesFrom) != 0 {
|
||||
// config.VolumesFrom = step.VolumesFrom
|
||||
// }
|
||||
if len(proc.NetworkMode) != 0 {
|
||||
config.NetworkMode = container.NetworkMode(proc.NetworkMode)
|
||||
if len(step.NetworkMode) != 0 {
|
||||
config.NetworkMode = container.NetworkMode(step.NetworkMode)
|
||||
}
|
||||
if len(proc.IpcMode) != 0 {
|
||||
config.IpcMode = container.IpcMode(proc.IpcMode)
|
||||
if len(step.IpcMode) != 0 {
|
||||
config.IpcMode = container.IpcMode(step.IpcMode)
|
||||
}
|
||||
if len(proc.DNS) != 0 {
|
||||
config.DNS = proc.DNS
|
||||
if len(step.DNS) != 0 {
|
||||
config.DNS = step.DNS
|
||||
}
|
||||
if len(proc.DNSSearch) != 0 {
|
||||
config.DNSSearch = proc.DNSSearch
|
||||
if len(step.DNSSearch) != 0 {
|
||||
config.DNSSearch = step.DNSSearch
|
||||
}
|
||||
if len(proc.ExtraHosts) != 0 {
|
||||
config.ExtraHosts = proc.ExtraHosts
|
||||
if len(step.ExtraHosts) != 0 {
|
||||
config.ExtraHosts = step.ExtraHosts
|
||||
}
|
||||
if len(proc.Devices) != 0 {
|
||||
config.Devices = toDev(proc.Devices)
|
||||
if len(step.Devices) != 0 {
|
||||
config.Devices = toDev(step.Devices)
|
||||
}
|
||||
if len(proc.Volumes) != 0 {
|
||||
config.Binds = proc.Volumes
|
||||
if len(step.Volumes) != 0 {
|
||||
config.Binds = step.Volumes
|
||||
}
|
||||
config.Tmpfs = map[string]string{}
|
||||
for _, path := range proc.Tmpfs {
|
||||
for _, path := range step.Tmpfs {
|
||||
if !strings.Contains(path, ":") {
|
||||
config.Tmpfs[path] = ""
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user