bundles/nodejs: make nodejs version configurable

This commit is contained in:
Franzi 2022-11-16 18:54:11 +01:00
parent 29dd1ee561
commit 72cbe56b5f
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -5,16 +5,26 @@ defaults = {
'npm install -g npm@latest', 'npm install -g npm@latest',
'npm install -g yarn@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': { 'packages': {
'nodejs': {}, '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',
},
},
},
},
}