mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-12-18 12:04:47 +00:00
Compare commits
4 Commits
v0.2.6
...
20914e78dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20914e78dc | ||
|
|
130b9f1877 | ||
|
|
4c35288175 | ||
|
|
990db1bfc0 |
@@ -18,6 +18,29 @@
|
|||||||
- GITEA_INSTANCE_URL=<instance url>
|
- GITEA_INSTANCE_URL=<instance url>
|
||||||
# When using Docker Secrets, it's also possible to use
|
# When using Docker Secrets, it's also possible to use
|
||||||
# GITEA_RUNNER_REGISTRATION_TOKEN_FILE to pass the location.
|
# GITEA_RUNNER_REGISTRATION_TOKEN_FILE to pass the location.
|
||||||
# The env var takes precedence
|
# The env var takes precedence.
|
||||||
|
# Needed only for the first start.
|
||||||
|
- GITEA_RUNNER_REGISTRATION_TOKEN=<registration token>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running `act_runner` using Docker-in-Docker (DIND)
|
||||||
|
|
||||||
|
```yml
|
||||||
|
...
|
||||||
|
runner:
|
||||||
|
image: gitea/act_runner:latest-dind-rootless
|
||||||
|
restart: always
|
||||||
|
privileged: true
|
||||||
|
depends_on:
|
||||||
|
- gitea
|
||||||
|
volumes:
|
||||||
|
- ./data/act_runner:/data
|
||||||
|
environment:
|
||||||
|
- GITEA_INSTANCE_URL=<instance url>
|
||||||
|
- DOCKER_HOST=unix:///var/run/user/1000/docker.sock
|
||||||
|
# When using Docker Secrets, it's also possible to use
|
||||||
|
# GITEA_RUNNER_REGISTRATION_TOKEN_FILE to pass the location.
|
||||||
|
# The env var takes precedence.
|
||||||
|
# Needed only for the first start.
|
||||||
- GITEA_RUNNER_REGISTRATION_TOKEN=<registration token>
|
- GITEA_RUNNER_REGISTRATION_TOKEN=<registration token>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ spec:
|
|||||||
- name: runner-data
|
- name: runner-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: act-runner-vol
|
claimName: act-runner-vol
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 1000
|
||||||
containers:
|
containers:
|
||||||
- name: runner
|
- name: runner
|
||||||
image: gitea/act_runner:nightly-dind-rootless
|
image: gitea/act_runner:nightly-dind-rootless
|
||||||
|
|||||||
@@ -184,7 +184,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,
|
||||||
|
|||||||
@@ -82,6 +82,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 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.
|
||||||
|
|||||||
@@ -51,6 +51,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 docker image(s) even if already present
|
||||||
}
|
}
|
||||||
|
|
||||||
// Host represents the configuration for the host.
|
// Host represents the configuration for the host.
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ fi
|
|||||||
|
|
||||||
cd /data
|
cd /data
|
||||||
|
|
||||||
|
RUNNER_STATE_FILE=${RUNNER_STATE_FILE:-'.runner'}
|
||||||
|
|
||||||
CONFIG_ARG=""
|
CONFIG_ARG=""
|
||||||
if [[ ! -z "${CONFIG_FILE}" ]]; then
|
if [[ ! -z "${CONFIG_FILE}" ]]; then
|
||||||
CONFIG_ARG="--config ${CONFIG_FILE}"
|
CONFIG_ARG="--config ${CONFIG_FILE}"
|
||||||
@@ -21,8 +23,9 @@ if [[ -z "${GITEA_RUNNER_REGISTRATION_TOKEN}" ]] && [[ -f "${GITEA_RUNNER_REGIST
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Use the same ENV variable names as https://github.com/vegardit/docker-gitea-act-runner
|
# Use the same ENV variable names as https://github.com/vegardit/docker-gitea-act-runner
|
||||||
|
test -f "$RUNNER_STATE_FILE" || echo "$RUNNER_STATE_FILE is missing or not a regular file"
|
||||||
|
|
||||||
if [[ ! -s .runner ]]; then
|
if [[ ! -s "$RUNNER_STATE_FILE" ]]; then
|
||||||
try=$((try + 1))
|
try=$((try + 1))
|
||||||
success=0
|
success=0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user