npm installation

pull/573/head
Gladys Nalvarte 2019-02-07 15:36:00 +01:00
rodzic abe256d25a
commit 8c6329de61
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