gitea install script; rename resolvers; fix lfs
This commit is contained in:
@@ -21,8 +21,9 @@ sections:
|
|||||||
ROOT_URL: https://localhost/
|
ROOT_URL: https://localhost/
|
||||||
DISABLE_SSH: 'true'
|
DISABLE_SSH: 'true'
|
||||||
LFS_START_SERVER: 'false'
|
LFS_START_SERVER: 'false'
|
||||||
LFS_CONTENT_PATH: data/lfs
|
|
||||||
OFFLINE_MODE: 'true'
|
OFFLINE_MODE: 'true'
|
||||||
|
lfs:
|
||||||
|
PATH: data/lfs
|
||||||
mailer:
|
mailer:
|
||||||
ENABLED: 'false'
|
ENABLED: 'false'
|
||||||
service:
|
service:
|
||||||
|
|||||||
17
gitea/files/install.sh
Normal file
17
gitea/files/install.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
{% set gitea_version = salt.pillar.get('gitea:version') %}
|
||||||
|
{% set base_path = salt.pillar.get('gitea:path') %}
|
||||||
|
|
||||||
|
URL="https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64"
|
||||||
|
|
||||||
|
# We can't replace the gitea bin while it's running
|
||||||
|
systemctl stop gitea || true
|
||||||
|
|
||||||
|
wget --quiet "${URL}" -O "{{ base_path }}/bin/gitea.tmp"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
chmod +x "{{ base_path }}/bin/gitea.tmp"
|
||||||
|
mv -v "{{ base_path }}/bin/gitea.tmp" "{{ base_path }}/bin/gitea"
|
||||||
|
else
|
||||||
|
rm -f "{{ base_path }}/bin/gitea.tmp"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
{% set ver = salt.pillar.get('gitea:version') %}
|
{% set ver = salt.pillar.get('gitea:version') %}
|
||||||
{% set url = 'https://github.com/go-gitea/gitea/releases/download/v' +
|
|
||||||
ver + '/gitea-' + ver + '-linux-amd64'
|
|
||||||
%}
|
|
||||||
{% set basepath = salt.pillar.get('gitea:path') %}
|
{% set basepath = salt.pillar.get('gitea:path') %}
|
||||||
|
|
||||||
# FIXME: this could be file.managed with source_hash set
|
|
||||||
'download gitea':
|
'download gitea':
|
||||||
cmd.run:
|
cmd.script:
|
||||||
- name: 'wget {{ url }} -O {{ basepath }}/bin/gitea && chmod +x {{ basepath }}/bin/gitea && echo {{ ver }} > {{ basepath }}/VERSION'
|
- shell: /bin/bash
|
||||||
- unless: grep -P '^{{ ver }}$' {{ basepath }}/VERSION
|
- source: 'salt://gitea/files/install.sh'
|
||||||
- runas: {{ salt.pillar.get('gitea:user') }}
|
- runas: {{ salt.pillar.get('gitea:user') }}
|
||||||
|
- template: jinja
|
||||||
|
- unless: "{{ basepath }}/bin/gitea --version | grep 'Gitea version {{ ver }} '"
|
||||||
- require:
|
- require:
|
||||||
- sls: gitea.dirs
|
- sls: gitea.dirs
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,5 @@ gitea:
|
|||||||
- watch:
|
- watch:
|
||||||
- file: /etc/systemd/system/gitea.service
|
- file: /etc/systemd/system/gitea.service
|
||||||
- file: {{ salt.pillar.get('gitea:path') }}/etc/app.ini
|
- file: {{ salt.pillar.get('gitea:path') }}/etc/app.ini
|
||||||
|
- cmd: download gitea
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ restic-{{ name }}:
|
|||||||
cmd.script:
|
cmd.script:
|
||||||
- shell: /bin/bash
|
- shell: /bin/bash
|
||||||
- source: 'salt://restic/files/install.sh'
|
- source: 'salt://restic/files/install.sh'
|
||||||
- templates: jinja
|
- template: jinja
|
||||||
- unless: "/bin/restic version | grep 'restic 0.16.2 '"
|
- unless: "/bin/restic version | grep 'restic 0.16.2 '"
|
||||||
- env:
|
- env:
|
||||||
- RESTIC_VERSION: 0.16.2
|
- RESTIC_VERSION: 0.16.2
|
||||||
|
|||||||
Reference in New Issue
Block a user