bundles: install yarn globally instead of in each individual bundle

This commit is contained in:
Franzi 2022-04-03 08:16:35 +02:00
parent 193c038bab
commit ddd29bef3b
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 16 additions and 9 deletions

View file

@ -29,9 +29,8 @@ actions = {
'element-web_yarn': { 'element-web_yarn': {
'command': ' && '.join([ 'command': ' && '.join([
'cd /opt/element-web', 'cd /opt/element-web',
'npm install yarn', 'yarn install --pure-lockfile --ignore-scripts',
'node_modules/yarn/bin/yarn install --pure-lockfile --ignore-scripts', 'yarn build',
'node_modules/yarn/bin/yarn build',
]), ]),
'needs': { 'needs': {
'pkg_apt:nodejs', 'pkg_apt:nodejs',

View file

@ -55,10 +55,9 @@ actions = {
'hedgedoc_yarn': { 'hedgedoc_yarn': {
'command': ' && '.join([ 'command': ' && '.join([
'cd /opt/hedgedoc', 'cd /opt/hedgedoc',
'npm install yarn', 'yarn install --production=true --pure-lockfile --ignore-scripts',
'node_modules/yarn/bin/yarn install --production=true --pure-lockfile --ignore-scripts', 'yarn install --ignore-scripts',
'node_modules/yarn/bin/yarn install --ignore-scripts', 'yarn build',
'node_modules/yarn/bin/yarn build',
]), ]),
'needs': { 'needs': {
'file:/opt/hedgedoc/config.json', 'file:/opt/hedgedoc/config.json',

9
bundles/nodejs/items.py Normal file
View file

@ -0,0 +1,9 @@
actions = {
'nodejs_install_yarn': {
'command': 'npm install -g yarn@latest',
'unless': 'test -e /usr/lib/node_modules/yarn',
'needs': {
'pkg_apt:nodejs',
},
},
}

View file

@ -3,6 +3,7 @@ defaults = {
'additional_update_commands': { 'additional_update_commands': {
# update npm to latest version # update npm to latest version
'npm install -g npm@latest', 'npm install -g npm@latest',
'npm install -g yarn@latest',
}, },
'repos': { 'repos': {
'node': { 'node': {

View file

@ -59,8 +59,7 @@ actions = {
'triggered': True, 'triggered': True,
'command': ' && '.join([ 'command': ' && '.join([
'cd /opt/powerdnsadmin/src', 'cd /opt/powerdnsadmin/src',
'npm install yarn', 'yarn install --pure-lockfile --ignore-scripts',
'node_modules/yarn/bin/yarn install --pure-lockfile --ignore-scripts',
'FLASK_APP=/opt/powerdnsadmin/src/powerdnsadmin/__init__.py /opt/powerdnsadmin/venv/bin/flask assets build', 'FLASK_APP=/opt/powerdnsadmin/src/powerdnsadmin/__init__.py /opt/powerdnsadmin/venv/bin/flask assets build',
'chown -R powerdnsadmin:powerdnsadmin /opt/powerdnsadmin/src/powerdnsadmin/static/', 'chown -R powerdnsadmin:powerdnsadmin /opt/powerdnsadmin/src/powerdnsadmin/static/',
]), ]),