Commit 39aa46fb authored by Henry Oswald's avatar Henry Oswald
Browse files

get rid of config commands

parent b2a58949
...@@ -51,7 +51,6 @@ SERVICES = [{ ...@@ -51,7 +51,6 @@ SERVICES = [{
repo: "https://github.com/sharelatex/spelling-sharelatex.git" repo: "https://github.com/sharelatex/spelling-sharelatex.git"
version: "master" version: "master"
}] }]
module.exports = (grunt) -> module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-bunyan' grunt.loadNpmTasks 'grunt-bunyan'
grunt.loadNpmTasks 'grunt-execute' grunt.loadNpmTasks 'grunt-execute'
...@@ -76,7 +75,7 @@ module.exports = (grunt) -> ...@@ -76,7 +75,7 @@ module.exports = (grunt) ->
limit: SERVICES.length limit: SERVICES.length
logConcurrentOutput: true logConcurrentOutput: true
coffee: coffee:
migrate: migrate:
expand: true, expand: true,
flatten: false, flatten: false,
cwd: './', cwd: './',
...@@ -109,9 +108,8 @@ module.exports = (grunt) -> ...@@ -109,9 +108,8 @@ module.exports = (grunt) ->
"Misc": [ "Misc": [
"help" "help"
] ]
"Install tasks": ("install:#{service.name}" for service in SERVICES).concat(["install:all", "install", "install:dirs", "install:config"]) "Install tasks": ("install:#{service.name}" for service in SERVICES).concat(["install:all", "install", "install:dirs"])
"Update tasks": ("update:#{service.name}" for service in SERVICES).concat(["update:all", "update"]) "Update tasks": ("update:#{service.name}" for service in SERVICES).concat(["update:all", "update"])
"Config tasks": ["install:config"]
"Checks": ["check", "check:redis", "check:latexmk", "check:s3", "check:make"] "Checks": ["check", "check:redis", "check:latexmk", "check:s3", "check:make"]
for service in SERVICES for service in SERVICES
...@@ -127,14 +125,13 @@ module.exports = (grunt) -> ...@@ -127,14 +125,13 @@ module.exports = (grunt) ->
done = @async() done = @async()
Helpers.createNewRelease(service, grunt.option("release"), done) Helpers.createNewRelease(service, grunt.option("release"), done)
grunt.registerTask 'install:config', "Copy the example config into the real config", () ->
Helpers.installConfig @async()
grunt.registerTask 'install:dirs', "Copy the example config into the real config", () -> grunt.registerTask 'install:dirs', "Copy the example config into the real config", () ->
Helpers.createDataDirs @async() Helpers.createDataDirs @async()
grunt.registerTask 'install:all', "Download and set up all ShareLaTeX services", grunt.registerTask 'install:all', "Download and set up all ShareLaTeX services",
["check:make"].concat( ["check:make"].concat(
("install:#{service.name}" for service in SERVICES) ("install:#{service.name}" for service in SERVICES)
).concat(["install:config", "install:dirs"]) ).concat([ "install:dirs"])
grunt.registerTask 'install', 'install:all' grunt.registerTask 'install', 'install:all'
grunt.registerTask 'update:all', "Checkout and update all ShareLaTeX services", grunt.registerTask 'update:all', "Checkout and update all ShareLaTeX services",
["check:make"].concat( ["check:make"].concat(
...@@ -214,7 +211,7 @@ module.exports = (grunt) -> ...@@ -214,7 +211,7 @@ module.exports = (grunt) ->
proc = spawn "git", ["pull"], cwd: dir, stdio: "inherit" proc = spawn "git", ["pull"], cwd: dir, stdio: "inherit"
proc.on "close", () -> proc.on "close", () ->
callback() callback()
createNewRelease: (service, version, callback = (error) ->) -> createNewRelease: (service, version, callback = (error) ->) ->
dir = service.name dir = service.name
proc = spawn "sed", [ proc = spawn "sed", [
...@@ -307,9 +304,9 @@ module.exports = (grunt) -> ...@@ -307,9 +304,9 @@ module.exports = (grunt) ->
latexmk comes with TexLive 2013, and must be a version from 2013 or later. latexmk comes with TexLive 2013, and must be a version from 2013 or later.
If you have already have TeXLive installed, then make sure it is If you have already have TeXLive installed, then make sure it is
included in your PATH (example for 64-bit linux): included in your PATH (example for 64-bit linux):
export PATH=$PATH:/usr/local/texlive/2014/bin/x86_64-linux/ export PATH=$PATH:/usr/local/texlive/2014/bin/x86_64-linux/
This is a not a fatal error, but compiling will not work without latexmk. This is a not a fatal error, but compiling will not work without latexmk.
""" """
return callback(error) return callback(error)
...@@ -334,7 +331,7 @@ module.exports = (grunt) -> ...@@ -334,7 +331,7 @@ module.exports = (grunt) ->
""" """
error = new Error("latexmk is too old") error = new Error("latexmk is too old")
callback(error) callback(error)
checkAspell: (callback = (error) ->) -> checkAspell: (callback = (error) ->) ->
grunt.log.write "Checking aspell is installed... " grunt.log.write "Checking aspell is installed... "
exec "aspell dump dicts", (error, stdout, stderr) -> exec "aspell dump dicts", (error, stdout, stderr) ->
...@@ -342,15 +339,15 @@ module.exports = (grunt) -> ...@@ -342,15 +339,15 @@ module.exports = (grunt) ->
grunt.log.error "FAIL." grunt.log.error "FAIL."
grunt.log.errorlns """ grunt.log.errorlns """
Either aspell is not installed or is not in your PATH. Either aspell is not installed or is not in your PATH.
On Ubuntu you can install aspell with: On Ubuntu you can install aspell with:
sudo apt-get install aspell sudo apt-get install aspell
Or on a mac: Or on a mac:
brew install aspell brew install aspell
This is not a fatal error, but the spell-checker will not work without aspell This is not a fatal error, but the spell-checker will not work without aspell
""" """
return callback(error) return callback(error)
...@@ -382,11 +379,11 @@ module.exports = (grunt) -> ...@@ -382,11 +379,11 @@ module.exports = (grunt) ->
Please configure your Amazon S3 credentials in config/settings.development.coffee Please configure your Amazon S3 credentials in config/settings.development.coffee
Amazon S3 (Simple Storage Service) is a cloud storage service provided by Amazon S3 (Simple Storage Service) is a cloud storage service provided by
Amazon. ShareLaTeX uses S3 for storing binary files like images. You can Amazon. ShareLaTeX uses S3 for storing binary files like images. You can
sign up for an account and find out more at: sign up for an account and find out more at:
http://aws.amazon.com/s3/ http://aws.amazon.com/s3/
""" """
return callback() return callback()
client.getFile "does-not-exist", (error, response) -> client.getFile "does-not-exist", (error, response) ->
...@@ -413,7 +410,7 @@ module.exports = (grunt) -> ...@@ -413,7 +410,7 @@ module.exports = (grunt) ->
else else
grunt.log.error "FAIL." grunt.log.error "FAIL."
grunt.log.errorlns """ grunt.log.errorlns """
Could not find directory "#{Settings.filestore.stores.user_files}". Could not find directory "#{Settings.filestore.stores.user_files}".
Please check your configuration. Please check your configuration.
""" """
callback() callback()
...@@ -428,11 +425,11 @@ module.exports = (grunt) -> ...@@ -428,11 +425,11 @@ module.exports = (grunt) ->
grunt.log.error "FAIL." grunt.log.error "FAIL."
grunt.log.errorlns """ grunt.log.errorlns """
Either make is not installed or is not in your path. Either make is not installed or is not in your path.
On Ubuntu you can install make with: On Ubuntu you can install make with:
sudo apt-get install build-essential sudo apt-get install build-essential
""" """
return callback(error) return callback(error)
else if error? else if error?
...@@ -445,4 +442,3 @@ module.exports = (grunt) -> ...@@ -445,4 +442,3 @@ module.exports = (grunt) ->
template = fs.readFileSync("package/upstart/sharelatex-template.conf").toString() template = fs.readFileSync("package/upstart/sharelatex-template.conf").toString()
for service in SERVICES for service in SERVICES
fs.writeFileSync "package/upstart/sharelatex-#{service.name}.conf", template.replace(/__SERVICE__/g, service.name) fs.writeFileSync "package/upstart/sharelatex-#{service.name}.conf", template.replace(/__SERVICE__/g, service.name)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment