mirror of
https://github.com/roles-ansible/ansible_role_gitea.git
synced 2024-08-16 11:39:50 +02:00
Create better error message for forgejo releases
+ Incremented simple version check + Added better error messages for chosing the wrong forgejo version SOLVE https://github.com/roles-ansible/ansible_role_gitea/issues/106
This commit is contained in:
parent
643d9c32f3
commit
446d20c23d
2 changed files with 14 additions and 8 deletions
|
@ -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: "Download forgejo version {{ gitea_version_target }}"
|
||||||
|
when: not ansible_check_mode
|
||||||
|
block:
|
||||||
- name: "Get specific forgejo release metadata"
|
- 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:
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in a new issue