Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
97de87b4
Commit
97de87b4
authored
Dec 12, 2017
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not print the npm install output to the console
parent
dd8e879e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
pavelib/prereqs.py
+14
-10
No files found.
pavelib/prereqs.py
View file @
97de87b4
...
...
@@ -132,26 +132,30 @@ def prereq_cache(cache_name, paths, install_func):
print
'{cache} unchanged, skipping...'
.
format
(
cache
=
cache_name
)
def
log_installed_node_prereqs
(
npm_install_output
):
""" Logs output of npm install for debugging. """
log_file_path
=
'{}/{}'
.
format
(
Env
.
GEN_LOG_DIR
,
'npm_install.log'
)
with
open
(
log_file_path
,
'w'
)
as
log_file
:
log_file
.
write
(
npm_install_output
)
def
node_prereqs_installation
():
"""
Configures npm and installs Node prerequisites
"""
cb_error_text
=
"Subprocess return code: 1"
sh
(
"test `npm config get registry` =
\"
{reg}
\"
|| "
"(echo setting registry; npm config set registry"
" {reg})"
.
format
(
reg
=
NPM_REGISTRY
))
# Error handling around a race condition that produces "cb() never called" error. This
# evinces itself as `cb_error_text` and it ought to disappear when we upgrade
# npm to 3 or higher. TODO: clean this up when we do that.
npm_install_output
=
None
try
:
sh
(
'npm install'
)
print
"Executing `npm install`"
npm_install_output
=
sh
(
"npm install"
,
capture
=
True
)
except
BuildFailure
,
error_text
:
if
cb_error_text
in
error_text
:
print
"npm install error detected. Retrying..."
sh
(
'npm install'
)
else
:
raise
BuildFailure
(
error_text
)
log_installed_node_prereqs
(
npm_install_output
)
raise
BuildFailure
(
error_text
)
log_installed_node_prereqs
(
npm_install_output
)
def
python_prereqs_installation
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment