Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
node plugin: run build in pull phase to download dependencies. #762
Conversation
snappy-m-o
commented
Aug 26, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Aug 26, 2016
|
Can one of the admins verify this patch? |
|
I dont know if this is exactly what sergio was looking for when he suggested this, but I have verfified that after a successful npm install, the second doees not need network access. Tested that in a container like this:
|
elopio
reviewed
Aug 26, 2016
| @@ -96,6 +96,8 @@ def pull(self): | ||
| super().pull() | ||
| os.makedirs(self._npm_dir, exist_ok=True) | ||
| self._nodejs_tar.download() | ||
| + # we build in 'pull' phase to download all dependencies | ||
| + self.build() |
elopio
Aug 26, 2016
Member
This for sure solves the problem, but I'm concerned because I doubt that build was designed to be called from pull. There could be many unintended consequences, and the clean_pull is now a little worse for sure. We now can remove the build completely, and do just pull. That sounds weird. I'm not sure, this is a huge thing for a friday evening :)
sergiusens
Aug 26, 2016
Collaborator
El viernes, 26 de agosto de 2016 16h'32:09 ART, Leo Arias
notifications@github.com escribió:
@@ -96,6 +96,8 @@ def pull(self):
super().pull()
os.makedirs(self._npm_dir, exist_ok=True)
self._nodejs_tar.download()
# we build in 'pull' phase to download all dependenciesself.build()This for sure solves the problem, but I'm concerned because I
doubt that build was designed to be called from pull. There
could be many unintended consequences, and the clean_pull is now
a little worse for sure. We now can remove the build completely,
and do just pull. That sounds weird. I'm not sure, this is a
huge thing for a friday evening :)
This is exactly what the python plugins do.
I would call an internal function though.
Enviado con Dekko desde mi dispositivo Ubuntu
|
I updated to to address sergiusens' comment. |
|
ok to test |
smoser commentedAug 26, 2016
This runs the build in the pull phase to download all needed dependencies.
There is no way to 'npm install --download-only'.
Additionally, we add the --cache-min=Infinity which is required.
Without it, the run in the build phase will try to reach the npm registry.
Lastly, instead of '-g', use the more self-documenting long form '--global'.