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
...
f21bc49bd2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f21bc49bd2 | ||
|
|
130b9f1877 | ||
|
|
4c35288175 | ||
|
|
990db1bfc0 |
BIN
act_runner.exe
Normal file
BIN
act_runner.exe
Normal file
Binary file not shown.
@@ -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
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ func loadExecCmd(ctx context.Context) *cobra.Command {
|
|||||||
execCmd.PersistentFlags().BoolVarP(&execArg.noSkipCheckout, "no-skip-checkout", "", false, "Do not skip actions/checkout")
|
execCmd.PersistentFlags().BoolVarP(&execArg.noSkipCheckout, "no-skip-checkout", "", false, "Do not skip actions/checkout")
|
||||||
execCmd.PersistentFlags().BoolVarP(&execArg.debug, "debug", "d", false, "enable debug log")
|
execCmd.PersistentFlags().BoolVarP(&execArg.debug, "debug", "d", false, "enable debug log")
|
||||||
execCmd.PersistentFlags().BoolVarP(&execArg.dryrun, "dryrun", "n", false, "dryrun mode")
|
execCmd.PersistentFlags().BoolVarP(&execArg.dryrun, "dryrun", "n", false, "dryrun mode")
|
||||||
execCmd.PersistentFlags().StringVarP(&execArg.image, "image", "i", "node:16-bullseye", "docker image to use")
|
execCmd.PersistentFlags().StringVarP(&execArg.image, "image", "i", "node:16-bullseye", "Docker image to use. Use \"-self-hosted\" to run directly on the host.")
|
||||||
execCmd.PersistentFlags().StringVarP(&execArg.network, "network", "", "", "Specify the network to which the container will connect")
|
execCmd.PersistentFlags().StringVarP(&execArg.network, "network", "", "", "Specify the network to which the container will connect")
|
||||||
execCmd.PersistentFlags().StringVarP(&execArg.githubInstance, "gitea-instance", "", "", "Gitea instance to use.")
|
execCmd.PersistentFlags().StringVarP(&execArg.githubInstance, "gitea-instance", "", "", "Gitea instance to use.")
|
||||||
|
|
||||||
|
|||||||
@@ -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