1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

skip unsupported platforms

Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Casey Lee 2020-02-16 22:04:13 -08:00
parent b8589c4e9b
commit 12ac03a755
6 changed files with 23 additions and 14 deletions

View file

@ -34,7 +34,7 @@ func (rc *RunContext) newStepExecutor(step *model.Step) common.Executor {
containerSpec.Volumes = job.Container.Volumes
containerSpec.Options = job.Container.Options
} else {
containerSpec.Image = platformImage(ee.Interpolate(job.RunsOn))
containerSpec.Image = platformImage(rc.PlatformName)
}
return common.NewPipelineExecutor(
rc.setupShellCommand(containerSpec, step.Shell, step.Run),
@ -154,7 +154,7 @@ func (rc *RunContext) setupShellCommand(containerSpec *model.ContainerSpec, shel
}
func platformImage(platform string) string {
switch platform {
switch strings.ToLower(platform) {
case "ubuntu-latest", "ubuntu-18.04":
return "ubuntu:18.04"
case "ubuntu-16.04":