mirror of
https://codeberg.org/Codeberg/Documentation.git
synced 2026-06-16 05:13:54 -07:00
Update content/ci/actions.md (#423)
Update version of runner from 3.3.0 to 3.4.0 Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/423 Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org> Co-authored-by: Eric <eric@pedr0.net> Co-committed-by: Eric <eric@pedr0.net>
This commit is contained in:
parent
1838c492fc
commit
0cf4c81ed3
1 changed files with 24 additions and 14 deletions
|
|
@ -47,10 +47,18 @@ You can add Runners to your account, organization, or repository. Choosing where
|
|||
|
||||
Forgejo Runner is released in both binary and container image (OCI) forms:
|
||||
|
||||
- Get the last released version:
|
||||
|
||||
```bash
|
||||
$ export RUNNER_VERSION=$(curl -X 'GET' https://code.forgejo.org/api/v1/repos/forgejo/runner/releases/latest | jq .name -r | cut -c 2-)
|
||||
```
|
||||
|
||||
You can also manually check directly on the [Forgejo Runner release page](https://code.forgejo.org/forgejo/runner/releases)
|
||||
|
||||
- Download the binary to run on your machine:
|
||||
|
||||
```bash
|
||||
$ wget -O forgejo-runner https://code.forgejo.org/forgejo/runner/releases/download/v3.3.0/forgejo-runner-3.3.0-linux-amd64
|
||||
$ wget -O forgejo-runner https://code.forgejo.org/forgejo/runner/releases/download/v${RUNNER_VERSION}/forgejo-runner-${RUNNER_VERSION}-linux-amd64
|
||||
$ chmod +x forgejo-runner
|
||||
```
|
||||
|
||||
|
|
@ -59,8 +67,8 @@ Forgejo Runner is released in both binary and container image (OCI) forms:
|
|||
- Or download the container image and run it using Docker:
|
||||
|
||||
```bash
|
||||
$ docker run --rm code.forgejo.org/forgejo/runner:3.3.0 forgejo-runner --version
|
||||
forgejo-runner version v3.3.0
|
||||
$ docker run --rm code.forgejo.org/forgejo/runner:${RUNNER_VERSION} forgejo-runner --version
|
||||
forgejo-runner version <runner version>
|
||||
```
|
||||
|
||||
## Preparing configuration files
|
||||
|
|
@ -75,7 +83,7 @@ Make sure to replace `{TOKEN}` with the registration token you copied, and `{NAM
|
|||
|
||||
```bash
|
||||
$ ./forgejo-runner register --no-interactive --token {TOKEN} --name {NAME} --instance https://codeberg.org
|
||||
INFO Registering runner, arch=amd64, os=linux, version=3.3.0.
|
||||
INFO Registering runner, arch=amd64, os=linux, version=<runner version>.
|
||||
DEBUG Successfully pinged the Forgejo instance server
|
||||
INFO Runner registered successfully.
|
||||
$ ./forgejo-runner generate-config > config.yml
|
||||
|
|
@ -84,13 +92,13 @@ $ ./forgejo-runner generate-config > config.yml
|
|||
### Docker
|
||||
|
||||
```bash
|
||||
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/data --rm code.forgejo.org/forgejo/runner:3.3.0 forgejo-runner register --no-interactive --token {TOKEN} --name {NAME} --instance https://codeberg.org
|
||||
Status: Downloaded newer image for code.forgejo.org/forgejo/runner:3.3.0
|
||||
level=info msg="Registering runner, arch=arm64, os=linux, version=v3.3.0."
|
||||
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/data --rm code.forgejo.org/forgejo/runner:${RUNNER_VERSION} forgejo-runner register --no-interactive --token {TOKEN} --name {NAME} --instance https://codeberg.org
|
||||
Status: Downloaded newer image for code.forgejo.org/forgejo/runner:<runner version>
|
||||
level=info msg="Registering runner, arch=arm64, os=linux, version=<runner version>."
|
||||
level=warning msg="Runner in user-mode."
|
||||
level=debug msg="Successfully pinged the Forgejo instance server"
|
||||
level=info msg="Runner registered successfully."
|
||||
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/data --rm code.forgejo.org/forgejo/runner:3.3.0 forgejo-runner generate-config > config.yml
|
||||
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/data --rm code.forgejo.org/forgejo/runner:${RUNNER_VERSION} forgejo-runner generate-config > config.yml
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -131,7 +139,7 @@ $ 996(docker)
|
|||
Make sure to replace `996` with the Docker group GID of the host in the following command:
|
||||
|
||||
```bash
|
||||
$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock --user 1000:996 -v $PWD:/data --rm code.forgejo.org/forgejo/runner:3.3.0 forgejo-runner --config config.yml daemon
|
||||
$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock --user 1000:996 -v $PWD:/data --rm code.forgejo.org/forgejo/runner:${RUNNER_VERSION} forgejo-runner --config config.yml daemon
|
||||
22eae46a021294a213e7f733203f7551250b67367c7507b53b5fd427f0f82d2e
|
||||
```
|
||||
|
||||
|
|
@ -141,7 +149,8 @@ Now your CI Runner should be running in a new container.
|
|||
|
||||
Using Docker Compose, we can configure the Runner container to execute workflows inside another layer of containers (Docker-in-Docker).
|
||||
|
||||
Here is an example snippet of how it can be configured:
|
||||
Here is an example snippet of how it can be configured. It will automatically use the latest version of the runner, feel
|
||||
free to specify the version of the forgejo runner if you need:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
|
@ -154,7 +163,7 @@ services:
|
|||
- certs:/certs
|
||||
|
||||
runner:
|
||||
image: code.forgejo.org/forgejo/runner:3.3.0
|
||||
image: code.forgejo.org/forgejo/runner
|
||||
environment:
|
||||
DOCKER_HOST: tcp://docker:2376
|
||||
DOCKER_TLS_VERIFY: 1
|
||||
|
|
@ -181,7 +190,8 @@ Keep in mind that this is a potential security issue that can allow a malicious
|
|||
|
||||
{% endadmonition %}
|
||||
|
||||
Here is an example snippet of how it can be configured:
|
||||
Here is an example snippet of how it can be configured. It will automatically use the latest version of the runner, feel
|
||||
free to specify the version of the forgejo runner if you need:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
|
|
@ -217,7 +227,7 @@ spec:
|
|||
emptyDir: {}
|
||||
initContainers:
|
||||
- name: runner-config-generation
|
||||
image: code.forgejo.org/forgejo/runner:3.3.0
|
||||
image: code.forgejo.org/forgejo/runner
|
||||
command:
|
||||
['forgejo-runner create-runner-file --instance $FORGEJO_INSTANCE_URL --secret $RUNNER_SECRET --connect']
|
||||
env:
|
||||
|
|
@ -233,7 +243,7 @@ spec:
|
|||
mountPath: /data
|
||||
containers:
|
||||
- name: runner
|
||||
image: code.forgejo.org/forgejo/runner:3.3.0
|
||||
image: code.forgejo.org/forgejo/runner
|
||||
command:
|
||||
[
|
||||
'sh',
|
||||
|
|
|
|||
Loading…
Reference in a new issue