diff --git a/defaults/main.yml b/defaults/main.yml index 93c47ab..b699558 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/custom_themes.yml b/tasks/custom_themes.yml index a0d693b..0776d5d 100644 --- a/tasks/custom_themes.yml +++ b/tasks/custom_themes.yml @@ -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: diff --git a/tasks/install_upgrade.yml b/tasks/install_upgrade.yml index 8bf6cb6..a87c4eb 100644 --- a/tasks/install_upgrade.yml +++ b/tasks/install_upgrade.yml @@ -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 }}'