simplified forgejo deployment
This commit is contained in:
parent
d0eed6f10a
commit
634006fbd0
3 changed files with 26 additions and 22 deletions
14
README.md
14
README.md
|
@ -1,6 +1,6 @@
|
|||
# Gitea - Ansible Role
|
||||
|
||||
This role covers deployment, configuration and software updates of Gitea. This role is released under MIT Licence and we give no warranty for this piece of software. Currently supported OS - Debian.
|
||||
This role covers deployment, configuration and software updates of Gitea/Forgejo. This role is released under MIT Licence and we give no warranty for this piece of software. Currently supported OS - Debian.
|
||||
|
||||
You can deploy test instance using `Vagrantfile` attached to the role.
|
||||
`vagrant up`
|
||||
|
@ -9,6 +9,18 @@ You can deploy test instance using `Vagrantfile` attached to the role.
|
|||
|
||||
Then you can then access gitea from your computer on `http://192.168.33.14:3000`
|
||||
|
||||
# Gitea or Forgejo
|
||||
This role allows for deployment of gitea and forgejo. By default the role dpeloys forgejo and this is the flavor that is supported and maintained. Installing Gitea using the role is possible however starting from version 1.18.2 is no longer maintained by Disroot team.
|
||||
To switch to gitea, update following variables in your Playbook/host_vars:
|
||||
|
||||
|
||||
```
|
||||
gitea_falvour: 'gitea'
|
||||
gitea_version: '1.18.2'
|
||||
gitea_arch: 'linux-amd64'
|
||||
gitea_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64'
|
||||
```
|
||||
|
||||
## Playbook
|
||||
The playbook includes postgresql role and deploys entire stack needed to run Gitea. Additional roles are also available in the Ansible roles repos in git.
|
||||
|
||||
|
|
|
@ -6,10 +6,9 @@ gitea_user: 'git'
|
|||
gitea_group: 'git'
|
||||
gitea_confdir: '/etc/gitea/app.ini'
|
||||
|
||||
gitea_or_forgejo: 'forgejo'
|
||||
gitea_version: '1.18.0'
|
||||
forgejo_version: '1.18.2-0'
|
||||
|
||||
gitea_flavor: 'forgejo'
|
||||
gitea_version: '1.18.2-0'
|
||||
gitea_arch: 'linux-amd64'
|
||||
|
||||
#[CONFIG]
|
||||
|
||||
|
|
|
@ -5,33 +5,26 @@
|
|||
name: "{{ gitea_apt_list }}"
|
||||
update_cache: yes
|
||||
|
||||
- name: '[INSTALL] - Download gitea binary'
|
||||
get_url:
|
||||
url: 'https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64'
|
||||
dest: '{{ gitea_bindir }}/gitea'
|
||||
mode: '0750'
|
||||
owner: '{{ gitea_user }}'
|
||||
group: '{{ gitea_group }}'
|
||||
force: 'yes'
|
||||
notify: 'Restart gitea'
|
||||
when: gitea_or_forgejo == 'gitea'
|
||||
|
||||
- name: '[INSTALL] - Get forgejo download url'
|
||||
shell:
|
||||
cmd: wget -O - https://codeberg.org/forgejo/forgejo/releases | grep -B 1 forgejo-{{ forgejo_version }}-linux-amd64\< | sed -n 's/.*href="\(.*\)".*/\1/p'
|
||||
register: url
|
||||
when: gitea_or_forgejo == 'forgejo'
|
||||
cmd: wget -O - https://codeberg.org/forgejo/forgejo/releases | grep -B 1 forgejo-{{ gitea_version }}-{{ gitea_arch }}\< | sed -n 's/.*href="\(.*\)".*/\1/p'
|
||||
register: forgejo_url
|
||||
when: gitea_flavor == 'forgejo'
|
||||
|
||||
- name: '[INSTALL] - Download forgejo binary'
|
||||
- name: "[INSTALL] - Set forgejo download url"
|
||||
set_fact:
|
||||
gitea_download_url: '{{ forgejo_url.stdout }}'
|
||||
when: gitea_flavor == 'forgejo'
|
||||
|
||||
- name: '[INSTALL] - Download gitea binary'
|
||||
get_url:
|
||||
url: '{{ url.stdout }}'
|
||||
url: '{{ gitea_download_url }}'
|
||||
dest: '{{ gitea_bindir }}/gitea'
|
||||
mode: '0750'
|
||||
owner: '{{ gitea_user }}'
|
||||
group: '{{ gitea_group }}'
|
||||
force: 'yes'
|
||||
notify: 'Restart gitea'
|
||||
when: gitea_or_forgejo == 'forgejo'
|
||||
|
||||
- name: '[INSTALL] - Set /etc/gitea rights to read-only'
|
||||
file:
|
||||
|
|
Loading…
Reference in a new issue