forgejo-runner: label stuff so behavior is closer to github actions

This commit is contained in:
Finn 2024-03-22 01:55:50 -07:00
parent 58b092534c
commit ffafbcb331
2 changed files with 10 additions and 7 deletions

View file

@ -29,12 +29,6 @@
- systemctl daemon-reload - systemctl daemon-reload
- restart podman.socket - restart podman.socket
- name: enable podman
service:
name: "{{ item }}"
enabled: true
with_items: [podman.socket, podman.service]
- name: configure forgejo-runner - name: configure forgejo-runner
template: template:
src: forgejo-runner.yaml src: forgejo-runner.yaml
@ -54,3 +48,9 @@
command: podman run --rm --user root -tiv /etc/forgejo-runner:/etc/forgejo-runner:ro -v /var/forgejo-runner:/data code.forgejo.org/forgejo/runner:3.3.0 forgejo-runner register --instance https://git.janky.solutions --name "{{ inventory_hostname }}" --token "{{ lookup('ansible.builtin.ini', 'registration_token section=forgejo_runner file=secrets/git.janky.solutions.ini') }}" --no-interactive command: podman run --rm --user root -tiv /etc/forgejo-runner:/etc/forgejo-runner:ro -v /var/forgejo-runner:/data code.forgejo.org/forgejo/runner:3.3.0 forgejo-runner register --instance https://git.janky.solutions --name "{{ inventory_hostname }}" --token "{{ lookup('ansible.builtin.ini', 'registration_token section=forgejo_runner file=secrets/git.janky.solutions.ini') }}" --no-interactive
args: args:
creates: /var/forgejo-runner/.runner creates: /var/forgejo-runner/.runner
- name: enable services
service:
name: "{{ item }}"
enabled: true
with_items: [podman.socket, podman.service, forgejo-runner.service]

View file

@ -27,7 +27,10 @@ runner:
# Like: ["macos-arm64:host", "ubuntu-latest:docker://node:16-bullseye", "ubuntu-22.04:docker://node:16-bullseye"] # Like: ["macos-arm64:host", "ubuntu-latest:docker://node:16-bullseye", "ubuntu-22.04:docker://node:16-bullseye"]
# If it's empty when registering, it will ask for inputting labels. # If it's empty when registering, it will ask for inputting labels.
# If it's empty when execute `deamon`, will use labels in `.runner` file. # If it's empty when execute `deamon`, will use labels in `.runner` file.
labels: [] labels: [
"ubuntu-latest:docker://node:16-bullseye",
"ubuntu-22.04:docker://node:16-bullseye"
]
cache: cache:
# Enable cache server to use actions/cache. # Enable cache server to use actions/cache.