Merge pull request #573 from GladysNalvarte/nodejs_inst

npm installation
pull/581/head
Tim Head 2019-02-08 18:20:26 +01:00 zatwierdzone przez GitHub
commit e218a329f5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 30 dodań i 2 usunięć

Wyświetl plik

@ -356,6 +356,7 @@ class BuildPack:
You can use environment variable substitutions in both the
username and the execution script.
"""
return []
def get_assemble_scripts(self):
@ -520,9 +521,35 @@ class BaseImage(BuildPack):
def get_build_env(self):
"""Return env directives required for build"""
return [
("APP_BASE", "/srv")
("APP_BASE", "/srv"),
('NPM_DIR', '${APP_BASE}/npm'),
('NPM_CONFIG_GLOBALCONFIG','${NPM_DIR}/npmrc')
]
def get_path(self):
return super().get_path() + [
'${NPM_DIR}/bin'
]
def get_build_scripts(self):
scripts = [
(
"root",
r"""
mkdir -p ${NPM_DIR} && \
chown -R ${NB_USER}:${NB_USER} ${NPM_DIR}
"""
),
(
"${NB_USER}",
r"""
npm config --global set prefix ${NPM_DIR}
"""
),
]
return super().get_build_scripts() + scripts
def get_env(self):
"""Return env directives to be set after build"""
env = []
@ -541,7 +568,6 @@ class BaseImage(BuildPack):
])
return env
def detect(self):
return True

Wyświetl plik

@ -1,2 +1,3 @@
#!/bin/bash
jupyter nbextension enable --py --sys-prefix ipyleaflet
npm install --global configurable-http-proxy

Wyświetl plik

@ -1,3 +1,4 @@
#!/bin/bash
set -euo pipefail
jupyter nbextension list | grep 'jupyter-leaflet' | grep enabled
which configurable-http-proxy