From afe6c345f0f8bd500758e825158aac6c9c6611f7 Mon Sep 17 00:00:00 2001 From: Deimos Date: Mon, 3 Jun 2019 00:21:41 -0600 Subject: [PATCH] Salt: install the npm packages from package.json --- salt/salt/nodejs.sls | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/salt/salt/nodejs.sls b/salt/salt/nodejs.sls index e88a661..bc9930a 100644 --- a/salt/salt/nodejs.sls +++ b/salt/salt/nodejs.sls @@ -1,3 +1,5 @@ +{% from "common.jinja2" import app_dir, app_username %} + # Add the NodeSource repository and install Node.js 10.x nodejs-pkgrepo: pkgrepo.managed: @@ -10,3 +12,11 @@ nodejs-pkgrepo: pkg.installed: - name: nodejs - refresh: True + +# Install the npm packages defined in package.json +install-npm-packages: + npm.bootstrap: + - name: {{ app_dir }} + - user: {{ app_username }} + - require: + - pkg: nodejs