1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

Merge pull request #110 from roles-ansible/v

Create better error message for forgejo releases
This commit is contained in:
L3D 2023-05-10 00:11:16 +02:00 committed by GitHub
commit 2efc177642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View file

@ -35,18 +35,24 @@
gitea_version_target: "{{ gitea_remote_version }}" gitea_version_target: "{{ gitea_remote_version }}"
when: not ansible_check_mode when: not ansible_check_mode
- name: "Set gitea version target {{ gitea_version }}" - name: "Set forgejo version target {{ gitea_version }}"
ansible.builtin.set_fact: ansible.builtin.set_fact:
gitea_version_target: "{{ gitea_version }}" gitea_version_target: "{{ gitea_version }}"
when: gitea_version != "latest" when: gitea_version != "latest"
- name: "Get specific forgejo release metadata" - name: "Download forgejo version {{ gitea_version_target }}"
when: not ansible_check_mode
block:
- name: "Get specific forgejo release metadata"
ansible.builtin.uri: ansible.builtin.uri:
url: 'https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/tags/v{{ gitea_version_target }}' url: 'https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/tags/v{{ gitea_version_target }}'
return_content: true return_content: true
register: gitea_forgejo_remote_tags_metadata register: gitea_forgejo_remote_tags_metadata
become: false become: false
when: not ansible_check_mode rescue:
- name: "Error Downloading https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/tags/v{{ gitea_version_target }}"
ansible.builtin.fail:
msg: "We did not find the forgejo version you specified. Are you sure that '{{ gitea_version_target }}' is a valid forgejo version?"
- name: "Generate forgejo download url" - name: "Generate forgejo download url"
ansible.builtin.set_fact: ansible.builtin.set_fact:

View file

@ -62,5 +62,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl' - 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl' - 'files/extra_links_footer.tmpl'
playbook_version_number: 45 # should be int playbook_version_number: 46 # should be int
playbook_version_path: 'do1jlr.gitea.version' playbook_version_path: 'do1jlr.gitea.version'