2020-08-18 13:27:55 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
2022-03-06 11:50:04 +00:00
|
|
|
'additional_update_commands': {
|
2024-07-19 17:19:45 +00:00
|
|
|
# update npm and yarn to latest version
|
|
|
|
'npm install -g npm@latest',
|
2022-04-03 06:16:35 +00:00
|
|
|
'npm install -g yarn@latest',
|
2022-03-06 11:50:04 +00:00
|
|
|
},
|
2020-08-18 13:27:55 +00:00
|
|
|
'packages': {
|
2024-07-19 17:19:45 +00:00
|
|
|
'nodejs': {
|
|
|
|
'triggers': {
|
|
|
|
'action:apt_execute_update_commands',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'npm': {
|
|
|
|
'installed': False,
|
|
|
|
'triggers': {
|
|
|
|
'action:apt_execute_update_commands',
|
|
|
|
},
|
|
|
|
},
|
2020-08-18 13:27:55 +00:00
|
|
|
},
|
|
|
|
},
|
2024-01-01 09:11:11 +00:00
|
|
|
}
|
|
|
|
|
2022-11-16 17:54:11 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'apt/repos/nodejs/items',
|
|
|
|
)
|
|
|
|
def nodejs_from_version(metadata):
|
2022-11-27 18:56:36 +00:00
|
|
|
version = metadata.get('nodejs/version')
|
2024-01-01 09:11:11 +00:00
|
|
|
|
2024-07-19 17:19:45 +00:00
|
|
|
return {
|
|
|
|
'apt': {
|
|
|
|
'repos': {
|
|
|
|
'nodejs': {
|
|
|
|
'items': {
|
|
|
|
f'deb https://deb.nodesource.com/node_{version}.x nodistro main',
|
2022-11-16 17:54:11 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-07-19 17:19:45 +00:00
|
|
|
},
|
|
|
|
}
|