Improved and simplified download url (#60)

I have simplified the download URL since now it's consistent and could be easily derived. Also as an aftermath of implementing styling guide, some of the shell/command tasks had to be adjusted.

Reviewed-on: #60
Co-authored-by: muppeth <muppeth@disroot.org>
Co-committed-by: muppeth <muppeth@disroot.org>
This commit is contained in:
muppeth 2024-11-29 14:42:42 +01:00 committed by muppeth
parent 7d6b50c74c
commit 882231d776
3 changed files with 4 additions and 14 deletions

View file

@ -9,7 +9,7 @@ forgejo_dump_path: '/srv/forgejo-dump'
forgejo_flavor: 'forgejo'
forgejo_version: '9.0.2'
forgejo_arch: 'linux-amd64'
# forgejo_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ forgejo_version }}/gitea-{{ forgejo_version }}-{{ forgejo_arch }}'
forgejo_download_url: 'https://codeberg.org/forgejo/forgejo/releases/download/v{{ forgejo_version }}/forgejo-{{ forgejo_version }}-{{ forgejo_arch }}'
# Uncomment below if you want to add custom themes or images
# forgejo_extra_files_path: '../img' # the folder name where you have the images you want to deploy

View file

@ -13,7 +13,8 @@
# First, remove the css files from public folder, then theme repos
- name: '[THEME] - Remove css files from the css folder'
command:
cmd: find "{{ forgejo_theme_dir }}/{{ item.name }}" -type f -name "*.css" -printf "%f\n" | xargs -I{} rm public/assets/css/{}
cmd: bash -c 'find "{{ forgejo_theme_dir }}/{{ item.name }}" -type f -name "*.css" -printf "%f\n" | xargs -I{} rm public/assets/css/{}'
# find "{{ forgejo_theme_dir }}/{{ item.name }}" -type f -name "*.css" -printf "%f\n" | xargs -I{} rm public/assets/css/{}
chdir: '{{ forgejo_theme_dir }}'
loop: '{{ forgejo_custom_themes }}'
when: item.enable == 'false'
@ -73,7 +74,7 @@
# Lastly, update app.ini by adding the theme's name list.
- name: '[THEME] - Get and prepare a list for app.ini of css files in public folder, register it'
command:
cmd: ls "{{ forgejo_theme_dir }}/public/assets/css" | awk '{ if ($0 ~ /^theme-/) { gsub(/^theme-/, "", $0) }; gsub(/.css$/, "", $0); print }' | paste -s -d,
cmd: bash -c "ls '{{ forgejo_theme_dir }}/public/assets/css' | awk '{ if ($0 ~ /^theme-/) { gsub(/^theme-/, \"\", $0) }; gsub(/.css$/, \"\", $0); print }' | paste -s -d,"
chdir: "{{ forgejo_theme_dir }}"
register: 'theme_name'
tags:

View file

@ -5,17 +5,6 @@
name: '{{ forgejo_apt_list }}'
update_cache: true
- name: '[INSTALL] - Get forgejo download url'
command:
cmd: wget -O - https://codeberg.org/forgejo/forgejo/releases | grep -B 1 'forgejo-{{ forgejo_version }}-{{ forgejo_arch }}' | grep -o 'href="[^"]*"' | sed 's/href="//; s/"//' | grep -E '{{ forgejo_arch }}$'
register: 'forgejo_url'
when: forgejo_flavor == 'forgejo'
- name: '[INSTALL] - Set forgejo download url'
set_fact:
forgejo_download_url: '{{ forgejo_url.stdout }}'
when: forgejo_flavor == 'forgejo'
- name: '[INSTALL] - Check if forgejo is already installed'
shell:
cmd: '{{ forgejo_bindir }}/forgejo --version -c {{ forgejo_confdir }}'