bundles/gitea: switch to new file type 'download'

This commit is contained in:
Franzi 2021-09-17 13:07:04 +02:00
parent fbb13e4c2f
commit b21f7c856a
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 15 additions and 147 deletions

View file

@ -1,16 +1,3 @@
downloads = {
'/usr/local/bin/gitea': {
'url': 'https://dl.gitea.io/gitea/{version}/gitea-{version}-linux-amd64'.format(version=node.metadata['gitea']['version']),
'sha256': node.metadata['gitea']['sha256'],
'triggers': {
'svc_systemd:gitea:restart',
},
'preceded_by': {
'svc_systemd:gitea:stop',
},
},
}
users = {
'git': {},
}
@ -35,16 +22,6 @@ directories = {
},
}
actions = {
'chmod_gitea': {
'command': 'chmod a+x /usr/local/bin/gitea',
'unless': 'test -x /usr/local/bin/gitea',
'needs': {
'download:/usr/local/bin/gitea',
},
},
}
files = {
'/etc/systemd/system/gitea.service': {
'content_type': 'mako',
@ -61,6 +38,18 @@ files = {
'svc_systemd:gitea:restart',
},
},
'/usr/local/bin/gitea': {
'content_type': 'download',
'source': 'https://dl.gitea.io/gitea/{version}/gitea-{version}-linux-amd64'.format(version=node.metadata['gitea']['version']),
'content_hash': node.metadata['gitea']['sha1'],
'mode': '0755',
'triggers': {
'svc_systemd:gitea:restart',
},
'preceded_by': {
'svc_systemd:gitea:stop',
},
},
}
if node.metadata['gitea'].get('install_ssh_key', False):
@ -74,10 +63,9 @@ if node.metadata['gitea'].get('install_ssh_key', False):
svc_systemd = {
'gitea': {
'needs': {
'action:chmod_gitea',
'download:/usr/local/bin/gitea',
'file:/etc/systemd/system/gitea.service',
'file:/etc/gitea/app.ini',
'file:/etc/systemd/system/gitea.service',
'file:/usr/local/bin/gitea',
},
},
}