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:
parent
b8589c4e9b
commit
12ac03a755
6 changed files with 23 additions and 14 deletions
|
@ -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":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue