Expand documentation
Generate config.yaml with logging set to debug
This commit is contained in:
+30
-6
@@ -2,6 +2,7 @@
|
||||
|
||||
Act runner is a runner for Gitea based on Gitea fork of act.
|
||||
|
||||
|
||||
## Quickstart
|
||||
|
||||
Actions are disabled by default, so you need to add the following to the configuration file of your Gitea instance to enable it:
|
||||
@@ -11,7 +12,9 @@ Actions are disabled by default, so you need to add the following to the configu
|
||||
ENABLED=true
|
||||
```
|
||||
|
||||
|
||||
### Register
|
||||
Before the runner can be started you need to register it on the Gitea server:
|
||||
|
||||
```bash
|
||||
/usr/share/gitea-act-runner/act_runner-register.sh
|
||||
@@ -34,7 +37,7 @@ INFO Enter the Gitea instance URL (for example, https://gitea.com/):
|
||||
http://192.168.8.8:3000/
|
||||
INFO Enter the runner token:
|
||||
fe884e8027dc292970d4e0303fe82b14xxxxxxxx
|
||||
INFO Enter the runner name (if set empty, use hostname: Test.local):
|
||||
INFO Enter the runner name (if set empty, use hostname: server.example.com):
|
||||
|
||||
INFO Enter the runner labels, leave blank to use the default labels (comma-separated, for example, ubuntu-latest:docker://gitea/runner-images:ubuntu-latest):
|
||||
|
||||
@@ -43,6 +46,10 @@ DEBU Successfully pinged the Gitea instance server
|
||||
INFO Runner registered successfully.
|
||||
```
|
||||
|
||||
The script is not on the path to avoid accidentally overwriting a working registration.
|
||||
|
||||
##### Manual registration
|
||||
|
||||
You can also register manually with command line arguments.
|
||||
|
||||
```bash
|
||||
@@ -50,19 +57,36 @@ cd ~act-runner
|
||||
sudo -u act-runner -H act_runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --no-interactive
|
||||
```
|
||||
|
||||
If the registry succeed, it will run immediately. Next time, you could run the runner directly.
|
||||
If the registry succeeds, it will run immediately. Next time, you can run the runner directly by enabling the systemd service.
|
||||
|
||||
|
||||
### Run
|
||||
|
||||
Enable the systemd service:
|
||||
```bash
|
||||
systemctl enable --now gitea-act-runner.service
|
||||
```
|
||||
|
||||
You can also manually start the daemon:
|
||||
|
||||
```bash
|
||||
act_runner daemon
|
||||
```
|
||||
|
||||
This is mostly useful to debugging, when the systemd service fails to start.
|
||||
|
||||
|
||||
### Configuration
|
||||
|
||||
You can also configure the runner with a configuration file.
|
||||
The configuration file is a YAML file, you can generate a sample configuration file with `./act_runner generate-config`.
|
||||
The systemd service file expects the file to be in the /etc/gitea-act-runner
|
||||
The runner can be configured with a configuration file.
|
||||
The systemd service file expects the file to be `/etc/gitea-act-runner/config.yaml`.
|
||||
The config file installed by the package has removed the example `envs:` and `labels:` values.
|
||||
|
||||
> **NB**: The value of `labels:` in the config file, if they are specified, override any labels configured during registration on the next startup.
|
||||
|
||||
The log level is set to debug, to assist first setup and should be changed to `info` during normal operation.
|
||||
|
||||
The configuration file is a YAML file, which can also generated as a sample configuration file with `./act_runner generate-config`.
|
||||
|
||||
```bash
|
||||
act_runner generate-config > /etc/gitea-act-runner/config.yaml
|
||||
@@ -78,4 +102,4 @@ act_runner -c /etc/gitea-act-runner/config.yaml daemon # run with config file
|
||||
|
||||
You can read the latest version of the configuration file online at [config.example.yaml](internal/pkg/config/config.example.yaml).
|
||||
|
||||
https://gitea.com/gitea/act_runner
|
||||
https://gitea.com/gitea/runner
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Gitea actions in rootless docker containers
|
||||
|
||||
This package configures a rootless docker instance owned by the docker-rootless user
|
||||
This package configures a rootless docker instance owned by the `docker-rootless` user
|
||||
to enable gitea actions in a non-root docker environment.
|
||||
|
||||
## Post-installation steps
|
||||
@@ -15,12 +15,33 @@ systemctl -M act-runner-rootless@ --user enable --now gitea-act-runner-rootless
|
||||
|
||||
You will be asked to input:
|
||||
|
||||
1. Gitea instance URL, like `http://192.168.8.8:3000/`. You should use your gitea instance ROOT_URL as the instance argument
|
||||
and you should not use `localhost` or `127.0.0.1` as instance IP;
|
||||
1. Gitea instance URL, like `http://192.168.8.8:3000/`. You should use your gitea instance ROOT_URL as the instance argument and you should not use `localhost` or `127.0.0.1` as instance IP;
|
||||
2. Runner token, you can get it from `http://192.168.8.8:3000/admin/actions/runners`;
|
||||
3. Runner name, you can just leave it blank;
|
||||
4. Runner labels, you can just leave it blank.
|
||||
|
||||
Apart from registering the docker instance, the script also produces a default config file in the `/home/act_runner` directory.
|
||||
Apart from registering the docker instance, the script also produces a default config file in the `/home/act-runner-rootless/act_runner` directory.
|
||||
|
||||
If you uninstall the package, you need to manually remove the registration in the Gitea UI.
|
||||
### Configuration
|
||||
|
||||
The runner can be configured with a configuration file.
|
||||
The systemd user service file expects the file to be `/home/gitea-act-runner/act_runner/config.yaml`.
|
||||
The registration script generates a default config file with the `envs:` and `labels:` values removed in the above-mentioned directory.
|
||||
|
||||
> **NB**: The value of `labels:` in the config file, if they are specified, override any labels configured during registration on the next startup.
|
||||
|
||||
The log level is set to debug, to assist first setup and should be changed to `info` during normal operation.
|
||||
|
||||
The configuration file is a YAML file, which can also generated as a sample configuration file with `./act_runner generate-config`.
|
||||
|
||||
```bash
|
||||
cd ~act-runner-rootless/act_runner
|
||||
act_runner generate-config > config.yaml
|
||||
chown act-runner-rootless:act-runner-rootless config.yaml
|
||||
chmod 0640 config.yaml
|
||||
```
|
||||
|
||||
> **NB**: The generated config file has the default values of `labels:`, which override any labels configured during registration on the next startup. There are also some default `envs:` values, that result in environment variables in all runs.
|
||||
|
||||
## Uninstallation
|
||||
If you uninstall the package, you need to manually remove the registration in the Gitea UI and remove the /home/gitea-act-runner directory, if required.
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
mkdir -p -m 0750 ~act-runner-rootless/act_runner
|
||||
cd ~act-runner-rootless/act_runner
|
||||
act_runner register
|
||||
act_runner generate-config | sed -e '/^ A_TEST_ENV/d' -e '/^ - "ubuntu-/d' -e "s:file\: .runner:file\: ${PWD}/.runner:" > config.yaml
|
||||
act_runner generate-config | \
|
||||
sed -e '/^ A_TEST_ENV/d' -e '/^ - "ubuntu-/d' -e "s:file\: .runner:file\: ${PWD}/.runner:" -e 's/level: info/level: debug/' \
|
||||
> config.yaml
|
||||
chmod 0640 config.yaml
|
||||
chown -R act-runner-rootless:act-runner-rootless ~act-runner-rootless/act_runner
|
||||
|
||||
Reference in New Issue
Block a user