bundlewrap/bundles/php/metadata.py

48 lines
1 KiB
Python
Raw Normal View History

2020-10-31 12:00:38 +00:00
defaults = {
'apt': {
'repos': {
'php': {
'items': {
'deb https://packages.sury.org/php/ {os_release} main',
},
},
},
},
}
@metadata_reactor
def php_packages_with_features(metadata):
version = metadata.get('php/version')
packages = {
f'php{version}': {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
},
f'php{version}-cli': {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
},
f'php{version}-fpm': {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
},
}
for package in metadata.get('php/packages', set()):
packages[f'php{version}-{package}'] = {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
}
return {
'apt': {
'packages': packages,
},
}