implement basic exec [ci skip]

This commit is contained in:
Brad Rydzewski
2019-10-22 15:21:57 -07:00
parent 00df09b842
commit 4d3f9c66af
24 changed files with 304 additions and 60 deletions

View File

@@ -43,7 +43,7 @@ func createStep(spec *resource.Pipeline, src *resource.Step) *engine.Step {
Networks: nil, // set in compiler.go
Files: nil, // set below
Volumes: nil, // set below
// Devices: nil, // TODO
Devices: nil, // see below
// Resources: toResources(src), // TODO
}
@@ -55,6 +55,14 @@ func createStep(spec *resource.Pipeline, src *resource.Step) *engine.Step {
})
}
// appends the devices to the container def.
for _, vol := range src.Devices {
dst.Devices = append(dst.Devices, &engine.VolumeDevice{
Name: vol.Name,
DevicePath: vol.DevicePath,
})
}
// appends the settings variables to the
// container definition.
for key, value := range src.Settings {
@@ -82,19 +90,6 @@ func createStep(spec *resource.Pipeline, src *resource.Step) *engine.Step {
}
}
// // if the step specifies shell commands we generate a
// // script. The script is copied to the container at
// // runtime (or mounted as a config map) and then executed
// // as the entrypoint.
// if len(src.Commands) > 0 {
// switch spec.Platform.OS {
// case "windows":
// setupScriptWin(spec, dst, src)
// default:
// setupScript(spec, dst, src)
// }
// }
// set the pipeline step run policy. steps run on
// success by default, but may be optionally configured
// to run on failure.