bundles/nodejs: make nodejs version configurable
This commit is contained in:
parent
29dd1ee561
commit
72cbe56b5f
1 changed files with 18 additions and 8 deletions
|
@ -5,16 +5,26 @@ defaults = {
|
|||
'npm install -g npm@latest',
|
||||
'npm install -g yarn@latest',
|
||||
},
|
||||
'repos': {
|
||||
'node': {
|
||||
'items': {
|
||||
'deb https://deb.nodesource.com/node_18.x {os_release} main',
|
||||
'deb-src https://deb.nodesource.com/node_18.x {os_release} main',
|
||||
},
|
||||
},
|
||||
},
|
||||
'packages': {
|
||||
'nodejs': {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'apt/repos/nodejs/items',
|
||||
)
|
||||
def nodejs_from_version(metadata):
|
||||
version = metadata.get('nodejs/version', 18)
|
||||
return {
|
||||
'apt': {
|
||||
'repos': {
|
||||
'node': {
|
||||
'items': {
|
||||
f'deb https://deb.nodesource.com/node_{version}.x {{os_release}} main',
|
||||
f'deb-src https://deb.nodesource.com/node_{version}.x {{os_release}} main',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue