Git: Finish moving to forgejo and update forgejo

This commit is contained in:
Florian RICHER 2024-10-27 18:57:36 +01:00
parent cae68d9a46
commit 1d34a9d71c
5 changed files with 6 additions and 6 deletions

21
roles/git/tasks/base.yml Normal file
View file

@ -0,0 +1,21 @@
---
- name: Check git directory exist
ansible.builtin.file:
path: git
state: directory
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "git/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml', dest: 'docker-compose.yml' }
- { src: 'config.yml', dest: 'config.yml' }
- name: Update and restart container
community.docker.docker_compose_v2:
project_src: git
state: present
pull: always
become: true

4
roles/git/tasks/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
- ansible.builtin.import_tasks: base.yml
name: base

View file

@ -0,0 +1,8 @@
cache:
enabled: true
dir: ""
host: ""
port: 8088
container:
network: "gitea_default"

View file

@ -0,0 +1,59 @@
services:
web:
image: codeberg.org/forgejo/forgejo:9
environment:
- USER_UID=1000
- USER_GID=1000
- FORGEJO__service__DISABLE_REGISTRATION=true
- FORGEJO__actions__ENABLED=true
- FORGEJO__actions__DEFAULT_ACTIONS_URL=self
- FORGEJO__packages__ENABLED=true
restart: unless-stopped
volumes:
- {{ server.work_dir }}/forgejo/data/:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- proxy
- interne
labels:
- traefik.enable=true
- traefik.docker.network=proxy
# HTTP Reverse proxy Gitea
- traefik.http.routers.git-secure.entrypoints=https
- traefik.http.routers.git-secure.rule=Host(`gitea.{{ server.domain }}`) || Host(`git.{{ server.domain }}`)
- traefik.http.routers.git-secure.tls=true
- traefik.http.routers.git-secure.tls.certresolver=sslResolver
- traefik.http.routers.git-secure.service=git
- traefik.http.services.git.loadbalancer.server.port=3000
# TCP SSH Reverse proxy Gitea
- traefik.tcp.routers.git-ssh.rule=HostSNI(`*`)
- traefik.tcp.routers.git-ssh.entrypoints=ssh
- traefik.tcp.routers.git-ssh.service=git-ssh
- traefik.tcp.services.git-ssh.loadbalancer.server.port=22
logging:
driver: loki
options:
loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push"
mode: non-blocking
runner:
image: gitea/act_runner
restart: unless-stopped
depends_on:
- web
volumes:
- ./config.yml:/config.yml
- {{ server.work_dir }}/gitea/runner/:/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
- CONFIG_FILE=/config.yml
- GITEA_INSTANCE_URL=https://gitea.{{ server.domain }}
- GITEA_RUNNER_REGISTRATION_TOKEN={{ gitea.runner_registration_token }}
networks:
interne:
metrics:
external: true
proxy:
external: true