mirror of https://code.forgejo.org/forgejo/runner
fix: example uses code.forgejo.org/oci
Otherwise it may get rate limited in the CI verifying it workspull/434/head
parent
48e0db5ddb
commit
564134560b
|
@ -80,8 +80,9 @@ A new repository is created in root/test with the following workflows:
|
|||
on: [push]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
runs-on: node-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||
- run: echo All Good
|
||||
```
|
||||
|
||||
|
@ -91,7 +92,7 @@ jobs:
|
|||
on: [push]
|
||||
jobs:
|
||||
test_docker:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: docker-cli
|
||||
steps:
|
||||
- run: docker info
|
||||
```
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
services:
|
||||
|
||||
demo-workflow:
|
||||
image: code.forgejo.org/oci/alpine:3.19
|
||||
image: code.forgejo.org/oci/alpine:3.21
|
||||
links:
|
||||
- forgejo
|
||||
command: >-
|
||||
|
@ -14,8 +14,8 @@ services:
|
|||
cd /srv/demo ;
|
||||
git init --initial-branch=main ;
|
||||
mkdir -p .forgejo/workflows ;
|
||||
echo "{ on: [push], jobs: { test: { runs-on: docker, steps: [ {uses: actions/checkout@v4}, { run: echo All Good } ] } } }" > .forgejo/workflows/demo.yml ;
|
||||
echo "{ on: [push], jobs: { test_docker: { runs-on: ubuntu-22.04, steps: [ { run: docker info } ] } } }" > .forgejo/workflows/demo_docker.yml ;
|
||||
echo "{ on: [push], jobs: { test: { runs-on: node-bookworm, steps: [ {uses: https://code.forgejo.org/actions/checkout@v4}, { run: echo All Good } ] } } }" > .forgejo/workflows/demo.yml ;
|
||||
echo "{ on: [push], jobs: { test_docker: { runs-on: docker-cli, steps: [ { run: docker info, shell: sh } ] } } }" > .forgejo/workflows/demo_docker.yml ;
|
||||
git add . ;
|
||||
git config user.email root@example.com ;
|
||||
git config user.name username ;
|
||||
|
|
|
@ -30,7 +30,7 @@ services:
|
|||
- docker_certs:/certs
|
||||
|
||||
forgejo:
|
||||
image: codeberg.org/forgejo/forgejo:1.21
|
||||
image: codeberg.org/forgejo/forgejo:9.0
|
||||
command: >-
|
||||
bash -c '
|
||||
/bin/s6-svscan /etc/s6 &
|
||||
|
@ -51,7 +51,7 @@ services:
|
|||
- 8080:3000
|
||||
|
||||
runner-register:
|
||||
image: code.forgejo.org/forgejo/runner:5.0.4
|
||||
image: code.forgejo.org/forgejo/runner:6.0.1
|
||||
links:
|
||||
- docker-in-docker
|
||||
- forgejo
|
||||
|
@ -66,7 +66,7 @@ services:
|
|||
forgejo-runner create-runner-file --connect --instance http://forgejo:3000 --name runner --secret {SHARED_SECRET} && break ;
|
||||
sleep 1 ;
|
||||
done ;
|
||||
sed -i -e "s|\"labels\": null|\"labels\": [\"docker:docker://code.forgejo.org/oci/node:20-bookworm\", \"ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04\"]|" .runner ;
|
||||
sed -i -e "s|\"labels\": null|\"labels\": [\"docker-cli:docker://code.forgejo.org/oci/docker:cli\",\"node-bookworm:docker://code.forgejo.org/oci/node:20-bookworm\"]|" .runner ;
|
||||
forgejo-runner generate-config > config.yml ;
|
||||
sed -i -e "s| level: info| level: debug|" config.yml ;
|
||||
sed -i -e "s|network: .*|network: host|" config.yml ;
|
||||
|
@ -77,7 +77,7 @@ services:
|
|||
'
|
||||
|
||||
runner-daemon:
|
||||
image: code.forgejo.org/forgejo/runner:5.0.4
|
||||
image: code.forgejo.org/forgejo/runner:6.0.1
|
||||
links:
|
||||
- docker-in-docker
|
||||
- forgejo
|
||||
|
|
|
@ -6,7 +6,7 @@ The following assumes:
|
|||
* a `runner-config.yml` file exists in /tmp/data
|
||||
|
||||
```sh
|
||||
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/data:/data --user 1000:133 --rm code.forgejo.org/forgejo/runner:5.0.4 forgejo-runner --config runner-config.yaml daemon
|
||||
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/data:/data --user 1000:133 --rm code.forgejo.org/forgejo/runner:6.0.1 forgejo-runner --config runner-config.yaml daemon
|
||||
```
|
||||
|
||||
The workflows will run using the host docker srever
|
||||
The workflows will run using the host docker server
|
||||
|
|
|
@ -38,7 +38,7 @@ spec:
|
|||
# https://forgejo.org/docs/v1.21/admin/actions/#offline-registration
|
||||
initContainers:
|
||||
- name: runner-register
|
||||
image: code.forgejo.org/forgejo/runner:5.0.4
|
||||
image: code.forgejo.org/forgejo/runner:6.0.1
|
||||
command: ["forgejo-runner", "register", "--no-interactive", "--token", $(RUNNER_SECRET), "--name", $(RUNNER_NAME), "--instance", $(FORGEJO_INSTANCE_URL)]
|
||||
env:
|
||||
- name: RUNNER_NAME
|
||||
|
@ -61,7 +61,7 @@ spec:
|
|||
mountPath: /data
|
||||
containers:
|
||||
- name: runner
|
||||
image: code.forgejo.org/forgejo/runner:5.0.4
|
||||
image: code.forgejo.org/forgejo/runner:6.0.1
|
||||
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner daemon"]
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
|
|
Loading…
Reference in New Issue