Merge pull request #229 from sharelatex/force-npm-rebuild

force an npm rebuild to work around issue #129, missing bcrypt bindings
This commit is contained in:
James Allen 2014-11-24 16:29:00 +00:00
commit a4e5a5b713

View file

@ -153,18 +153,22 @@ module.exports = (grunt) ->
return callback(error) if error? return callback(error) if error?
Helpers.installNpmModules service, (error) -> Helpers.installNpmModules service, (error) ->
return callback(error) if error? return callback(error) if error?
Helpers.runGruntInstall service, (error) -> Helpers.rebuildNpmModules service, (error) ->
return callback(error) if error? return callback(error) if error?
callback() Helpers.runGruntInstall service, (error) ->
return callback(error) if error?
callback()
updateService: (service, callback = (error) ->) -> updateService: (service, callback = (error) ->) ->
Helpers.updateGitRepo service, (error) -> Helpers.updateGitRepo service, (error) ->
return callback(error) if error? return callback(error) if error?
Helpers.installNpmModules service, (error) -> Helpers.installNpmModules service, (error) ->
return callback(error) if error? return callback(error) if error?
Helpers.runGruntInstall service, (error) -> Helpers.rebuildNpmModules service, (error) ->
return callback(error) if error? return callback(error) if error?
callback() Helpers.runGruntInstall service, (error) ->
return callback(error) if error?
callback()
cloneGitRepo: (service, callback = (error) ->) -> cloneGitRepo: (service, callback = (error) ->) ->
repo_src = service.repo repo_src = service.repo
@ -207,13 +211,21 @@ module.exports = (grunt) ->
proc = spawn "git", ["push", "--tags"], cwd: dir, stdio: "inherit" proc = spawn "git", ["push", "--tags"], cwd: dir, stdio: "inherit"
proc.on "close", () -> proc.on "close", () ->
callback() callback()
installNpmModules: (service, callback = (error) ->) -> installNpmModules: (service, callback = (error) ->) ->
dir = service.name dir = service.name
proc = spawn "npm", ["install"], stdio: "inherit", cwd: dir proc = spawn "npm", ["install"], stdio: "inherit", cwd: dir
proc.on "close", () -> proc.on "close", () ->
callback() callback()
# work around for https://github.com/npm/npm/issues/5400
# where binary modules are not built due to bug in npm
rebuildNpmModules: (service, callback = (error) ->) ->
dir = service.name
proc = spawn "npm", ["rebuild"], stdio: "inherit", cwd: dir
proc.on "close", () ->
callback()
createDataDirs: (callback = (error) ->) -> createDataDirs: (callback = (error) ->) ->
DIRS = [ DIRS = [
"tmp/dumpFolder" "tmp/dumpFolder"