Franziska Kunsmann
0531ecd217
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
we're stopping gitea beforehand, then start it again afterwards. No need to restart it again.
68 lines
1.6 KiB
Python
68 lines
1.6 KiB
Python
users = {
|
|
'git': {},
|
|
}
|
|
|
|
directories = {
|
|
'/home/git': {
|
|
'mode': '0755',
|
|
'owner': 'git',
|
|
'group': 'git',
|
|
},
|
|
'/home/git/.ssh': {
|
|
'mode': '0755',
|
|
'owner': 'git',
|
|
'group': 'git',
|
|
},
|
|
'/var/lib/gitea': {
|
|
'owner': 'git',
|
|
'mode': '0700',
|
|
'triggers': {
|
|
'svc_systemd:gitea:restart',
|
|
},
|
|
},
|
|
}
|
|
|
|
files = {
|
|
'/etc/systemd/system/gitea.service': {
|
|
'content_type': 'mako',
|
|
'context': node.metadata.get('gitea'),
|
|
'triggers': {
|
|
'action:systemd-reload',
|
|
'svc_systemd:gitea:restart',
|
|
},
|
|
},
|
|
'/etc/gitea/app.ini': {
|
|
'content_type': 'mako',
|
|
'context': node.metadata.get('gitea'),
|
|
'triggers': {
|
|
'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.get('gitea/sha1', None),
|
|
'mode': '0755',
|
|
'preceded_by': {
|
|
'svc_systemd:gitea:stop',
|
|
},
|
|
},
|
|
}
|
|
|
|
if node.metadata['gitea'].get('install_ssh_key', False):
|
|
files['/home/git/.ssh/id_ed25519'] = {
|
|
'content': repo.vault.decrypt_file(f'gitea/files/ssh-keys/{node.name}.key.vault'),
|
|
'mode': '0600',
|
|
'owner': 'git',
|
|
'group': 'git',
|
|
}
|
|
|
|
svc_systemd = {
|
|
'gitea': {
|
|
'needs': {
|
|
'file:/etc/gitea/app.ini',
|
|
'file:/etc/systemd/system/gitea.service',
|
|
'file:/usr/local/bin/gitea',
|
|
},
|
|
},
|
|
}
|