mirror of https://code.forgejo.org/forgejo/runner
Merge pull request 'expose "ForceRebuild" as a config option' (#406) from gratux/runner:main into main
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/406 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>pull/430/head
commit
483a54dd08
|
@ -209,7 +209,7 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
|
||||||
|
|
||||||
ReuseContainers: false,
|
ReuseContainers: false,
|
||||||
ForcePull: r.cfg.Container.ForcePull,
|
ForcePull: r.cfg.Container.ForcePull,
|
||||||
ForceRebuild: false,
|
ForceRebuild: r.cfg.Container.ForceRebuild,
|
||||||
LogOutput: true,
|
LogOutput: true,
|
||||||
JSONLogger: false,
|
JSONLogger: false,
|
||||||
Env: r.envs,
|
Env: r.envs,
|
||||||
|
|
|
@ -95,6 +95,8 @@ container:
|
||||||
docker_host: "-"
|
docker_host: "-"
|
||||||
# Pull docker image(s) even if already present
|
# Pull docker image(s) even if already present
|
||||||
force_pull: false
|
force_pull: false
|
||||||
|
# Rebuild local docker image(s) even if already present
|
||||||
|
force_rebuild: false
|
||||||
|
|
||||||
host:
|
host:
|
||||||
# The parent directory of a job's working directory.
|
# The parent directory of a job's working directory.
|
||||||
|
|
|
@ -55,6 +55,7 @@ type Container struct {
|
||||||
ValidVolumes []string `yaml:"valid_volumes"` // ValidVolumes specifies the volumes (including bind mounts) can be mounted to containers.
|
ValidVolumes []string `yaml:"valid_volumes"` // ValidVolumes specifies the volumes (including bind mounts) can be mounted to containers.
|
||||||
DockerHost string `yaml:"docker_host"` // DockerHost specifies the Docker host. It overrides the value specified in environment variable DOCKER_HOST.
|
DockerHost string `yaml:"docker_host"` // DockerHost specifies the Docker host. It overrides the value specified in environment variable DOCKER_HOST.
|
||||||
ForcePull bool `yaml:"force_pull"` // Pull docker image(s) even if already present
|
ForcePull bool `yaml:"force_pull"` // Pull docker image(s) even if already present
|
||||||
|
ForceRebuild bool `yaml:"force_rebuild"` // Rebuild local docker image(s) even if already present
|
||||||
}
|
}
|
||||||
|
|
||||||
// Host represents the configuration for the host.
|
// Host represents the configuration for the host.
|
||||||
|
|
|
@ -42,4 +42,5 @@ func TestDefaultSettings(t *testing.T) {
|
||||||
|
|
||||||
assert.EqualValues(t, config.Container.DockerHost, "-")
|
assert.EqualValues(t, config.Container.DockerHost, "-")
|
||||||
assert.EqualValues(t, config.Log.JobLevel, "info")
|
assert.EqualValues(t, config.Log.JobLevel, "info")
|
||||||
|
assert.EqualValues(t, config.Container.ForceRebuild, false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue