bundlewrap/bundles/build-ci/metadata.py
2022-03-13 18:11:11 +01:00

24 lines
662 B
Python

from shlex import quote
@metadata_reactor.provides(
'users/build-ci/authorized_users',
)
def ssh_keys(metadata):
return {
'users': {
'build-ci': {
'authorized_users': {
f'build-server@{other_node.name}'
for other_node in repo.nodes
if other_node.has_bundle('build-server')
},
},
},
'sudoers': {
'build-ci': {
f"/usr/bin/chown -R build-ci\:{quote(ci['group'])} {quote(ci['path'])}"
for ci in metadata.get('build-ci').values()
}
},
}