diff options
author | Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> | 2020-01-24 18:07:32 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-27 16:38:54 +0000 |
commit | 1133f3ab485031df6e107f826b7398e5133f9c4d (patch) | |
tree | b7489817e2a0539006c2b2df5acb4a665519d634 /meta/classes/npm.bbclass | |
parent | fb2252ee0777c6d26dea94c7588c323a6b97e961 (diff) | |
download | openembedded-core-contrib-1133f3ab485031df6e107f826b7398e5133f9c4d.tar.gz |
classes/npm: restrict the build to be offline
After the do_fetch task, every other tasks must not access the network.
In order to ensure this point every npm command must use the offline
configuration. In addition setting an invalid proxy is used as a safety.
Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/npm.bbclass')
-rw-r--r-- | meta/classes/npm.bbclass | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 799b2a3829..cf2c12047e 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -44,6 +44,9 @@ NPM_BUILD = "${WORKDIR}/npm-build" def npm_global_configs(d): """Get the npm global configuration""" configs = [] + # Ensure no network access is done + configs.append(("offline", "true")) + configs.append(("proxy", "http://invalid")) # Configure the cache directory configs.append(("cache", d.getVar("NPM_CACHE"))) return configs |