Mobrovac has uploaded a new change for review. https://gerrit.wikimedia.org/r/222259
Change subject: Add script which installs the devDependencies for Node.js services ...................................................................... Add script which installs the devDependencies for Node.js services Normally, in our deploy repositories we don't have the dependencies used during development (such as test modules). This script allows their installation, by consulting the package.json file in the current directory, extracting the information about the devDeps and installs each of them using their given versions. Change-Id: Ie18cf994c6a1dc8b62ba2460cedb5b3dde0abb1c --- A bin/npm-install-dev.py 1 file changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins refs/changes/59/222259/1 diff --git a/bin/npm-install-dev.py b/bin/npm-install-dev.py new file mode 100755 index 0000000..8f65965 --- /dev/null +++ b/bin/npm-install-dev.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + + +# npm-install-dev.py +# ------------------ +# +# Installs the development dependencies for Node.JS services. To use it, +# simply start it in the directory where your package.json file is +# located. Note that it assumes the production node module dependencies +# have already been installed, i.e. it does not check they are present. + + +import json +import subprocess + + +deps = dict() + +print '[*] NPM devDependencies Installation [*]' + +with open('./package.json') as fd: + pkg_info = json.load(fd) + if 'devDependencies' in pkg_info: + deps = pkg_info['devDependencies'] + +for pkg in iter(deps): + print 'Installing', pkg, '...' + subprocess.check_output(['npm', 'install', pkg + '@' + deps[pkg]]) + +print '[*] NPM devDependencies Done [*]' + -- To view, visit https://gerrit.wikimedia.org/r/222259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie18cf994c6a1dc8b62ba2460cedb5b3dde0abb1c Gerrit-PatchSet: 1 Gerrit-Project: integration/jenkins Gerrit-Branch: master Gerrit-Owner: Mobrovac <mobro...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits