|
@@ -7,18 +7,42 @@ module.exports = (grunt) ->
|
|
|
grunt.loadNpmTasks 'grunt-mocha-test'
|
|
grunt.loadNpmTasks 'grunt-mocha-test'
|
|
|
grunt.loadNpmTasks 'grunt-available-tasks'
|
|
grunt.loadNpmTasks 'grunt-available-tasks'
|
|
|
grunt.loadNpmTasks 'grunt-contrib-requirejs'
|
|
grunt.loadNpmTasks 'grunt-contrib-requirejs'
|
|
|
- grunt.loadNpmTasks 'grunt-execute'
|
|
|
|
|
grunt.loadNpmTasks 'grunt-bunyan'
|
|
grunt.loadNpmTasks 'grunt-bunyan'
|
|
|
grunt.loadNpmTasks 'grunt-sed'
|
|
grunt.loadNpmTasks 'grunt-sed'
|
|
|
grunt.loadNpmTasks 'grunt-git-rev-parse'
|
|
grunt.loadNpmTasks 'grunt-git-rev-parse'
|
|
|
grunt.loadNpmTasks 'grunt-file-append'
|
|
grunt.loadNpmTasks 'grunt-file-append'
|
|
|
grunt.loadNpmTasks 'grunt-file-append'
|
|
grunt.loadNpmTasks 'grunt-file-append'
|
|
|
grunt.loadNpmTasks 'grunt-env'
|
|
grunt.loadNpmTasks 'grunt-env'
|
|
|
|
|
+ grunt.loadNpmTasks 'grunt-newer'
|
|
|
|
|
+ grunt.loadNpmTasks 'grunt-contrib-watch'
|
|
|
|
|
+ grunt.loadNpmTasks 'grunt-parallel'
|
|
|
|
|
+ grunt.loadNpmTasks 'grunt-exec'
|
|
|
|
|
|
|
|
config =
|
|
config =
|
|
|
- execute:
|
|
|
|
|
- app:
|
|
|
|
|
- src: "app.js"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ exec:
|
|
|
|
|
+ run:
|
|
|
|
|
+ command:"node app.js | ./node_modules/logger-sharelatex/node_modules/bunyan/bin/bunyan --color"
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ watch:
|
|
|
|
|
+ coffee:
|
|
|
|
|
+ files: '**/*.coffee'
|
|
|
|
|
+ tasks: ['quickcompile:coffee']
|
|
|
|
|
+ options: {}
|
|
|
|
|
+
|
|
|
|
|
+ less:
|
|
|
|
|
+ files: '**/*.less'
|
|
|
|
|
+ tasks: ['compile:css']
|
|
|
|
|
+ options: {}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ parallel:
|
|
|
|
|
+ run:
|
|
|
|
|
+ tasks:['exec', 'watch']
|
|
|
|
|
+ options:
|
|
|
|
|
+ grunt:true
|
|
|
|
|
+ stream:true
|
|
|
|
|
|
|
|
coffee:
|
|
coffee:
|
|
|
app_dir:
|
|
app_dir:
|
|
@@ -89,6 +113,8 @@ module.exports = (grunt) ->
|
|
|
add:
|
|
add:
|
|
|
NODE_TLS_REJECT_UNAUTHORIZED:0
|
|
NODE_TLS_REJECT_UNAUTHORIZED:0
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
requirejs:
|
|
requirejs:
|
|
|
compile:
|
|
compile:
|
|
|
options:
|
|
options:
|
|
@@ -170,44 +196,46 @@ module.exports = (grunt) ->
|
|
|
pattern: "@@RELEASE@@"
|
|
pattern: "@@RELEASE@@"
|
|
|
replacement: process.env.BUILD_NUMBER || "(unknown build)"
|
|
replacement: process.env.BUILD_NUMBER || "(unknown build)"
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
availabletasks:
|
|
availabletasks:
|
|
|
tasks:
|
|
tasks:
|
|
|
options:
|
|
options:
|
|
|
- filter: 'exclude',
|
|
|
|
|
- tasks: [
|
|
|
|
|
- 'coffee'
|
|
|
|
|
- 'less'
|
|
|
|
|
- 'clean'
|
|
|
|
|
- 'mochaTest'
|
|
|
|
|
- 'availabletasks'
|
|
|
|
|
- 'wrap_sharejs'
|
|
|
|
|
- 'requirejs'
|
|
|
|
|
- 'execute'
|
|
|
|
|
- 'bunyan'
|
|
|
|
|
- ]
|
|
|
|
|
- groups:
|
|
|
|
|
- "Compile tasks": [
|
|
|
|
|
- "compile:server"
|
|
|
|
|
- "compile:client"
|
|
|
|
|
- "compile:tests"
|
|
|
|
|
- "compile"
|
|
|
|
|
- "compile:unit_tests"
|
|
|
|
|
- "compile:smoke_tests"
|
|
|
|
|
- "compile:css"
|
|
|
|
|
- "compile:minify"
|
|
|
|
|
- "install"
|
|
|
|
|
- ]
|
|
|
|
|
- "Test tasks": [
|
|
|
|
|
- "test:unit"
|
|
|
|
|
- "test:acceptance"
|
|
|
|
|
- ]
|
|
|
|
|
- "Run tasks": [
|
|
|
|
|
- "run"
|
|
|
|
|
- "default"
|
|
|
|
|
- ]
|
|
|
|
|
- "Misc": [
|
|
|
|
|
- "help"
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ filter: 'exclude',
|
|
|
|
|
+ tasks: [
|
|
|
|
|
+ 'coffee'
|
|
|
|
|
+ 'less'
|
|
|
|
|
+ 'clean'
|
|
|
|
|
+ 'mochaTest'
|
|
|
|
|
+ 'availabletasks'
|
|
|
|
|
+ 'wrap_sharejs'
|
|
|
|
|
+ 'requirejs'
|
|
|
|
|
+ 'execute'
|
|
|
|
|
+ 'bunyan'
|
|
|
|
|
+ ]
|
|
|
|
|
+ groups:
|
|
|
|
|
+ "Compile tasks": [
|
|
|
|
|
+ "compile:server"
|
|
|
|
|
+ "compile:client"
|
|
|
|
|
+ "compile:tests"
|
|
|
|
|
+ "compile"
|
|
|
|
|
+ "compile:unit_tests"
|
|
|
|
|
+ "compile:smoke_tests"
|
|
|
|
|
+ "compile:css"
|
|
|
|
|
+ "compile:minify"
|
|
|
|
|
+ "install"
|
|
|
|
|
+ ]
|
|
|
|
|
+ "Test tasks": [
|
|
|
|
|
+ "test:unit"
|
|
|
|
|
+ "test:acceptance"
|
|
|
|
|
+ ]
|
|
|
|
|
+ "Run tasks": [
|
|
|
|
|
+ "run"
|
|
|
|
|
+ "default"
|
|
|
|
|
+ ]
|
|
|
|
|
+ "Misc": [
|
|
|
|
|
+ "help"
|
|
|
|
|
+ ]
|
|
|
|
|
|
|
|
moduleCompileServerTasks = []
|
|
moduleCompileServerTasks = []
|
|
|
moduleCompileUnitTestTasks = []
|
|
moduleCompileUnitTestTasks = []
|
|
@@ -310,6 +338,8 @@ module.exports = (grunt) ->
|
|
|
grunt.registerTask 'compile:smoke_tests', 'Compile the smoke tests', ['coffee:smoke_tests']
|
|
grunt.registerTask 'compile:smoke_tests', 'Compile the smoke tests', ['coffee:smoke_tests']
|
|
|
grunt.registerTask 'compile:tests', 'Compile all the tests', ['compile:smoke_tests', 'compile:unit_tests']
|
|
grunt.registerTask 'compile:tests', 'Compile all the tests', ['compile:smoke_tests', 'compile:unit_tests']
|
|
|
grunt.registerTask 'compile', 'Compiles everything need to run web-sharelatex', ['compile:server', 'compile:client', 'compile:css']
|
|
grunt.registerTask 'compile', 'Compiles everything need to run web-sharelatex', ['compile:server', 'compile:client', 'compile:css']
|
|
|
|
|
+ grunt.registerTask 'quickcompile:coffee', 'Compiles only changed coffee files',['newer:coffee']
|
|
|
|
|
+
|
|
|
|
|
|
|
|
grunt.registerTask 'install', "Compile everything when installing as an npm module", ['compile']
|
|
grunt.registerTask 'install', "Compile everything when installing as an npm module", ['compile']
|
|
|
|
|
|
|
@@ -319,11 +349,13 @@ module.exports = (grunt) ->
|
|
|
|
|
|
|
|
grunt.registerTask 'test:modules:unit', 'Run the unit tests for the modules', ['compile:modules:server', 'compile:modules:unit_tests'].concat(moduleUnitTestTasks)
|
|
grunt.registerTask 'test:modules:unit', 'Run the unit tests for the modules', ['compile:modules:server', 'compile:modules:unit_tests'].concat(moduleUnitTestTasks)
|
|
|
|
|
|
|
|
- grunt.registerTask 'run', "Compile and run the web-sharelatex server", ['compile', 'bunyan', 'env:run', 'execute']
|
|
|
|
|
|
|
+ grunt.registerTask 'run', "Compile and run the web-sharelatex server", ['compile', 'env:run', 'parallel']
|
|
|
|
|
+
|
|
|
grunt.registerTask 'default', 'run'
|
|
grunt.registerTask 'default', 'run'
|
|
|
|
|
|
|
|
grunt.registerTask 'version', "Write the version number into sentry.jade", ['git-rev-parse', 'sed']
|
|
grunt.registerTask 'version', "Write the version number into sentry.jade", ['git-rev-parse', 'sed']
|
|
|
|
|
|
|
|
|
|
+
|
|
|
grunt.registerTask 'create-admin-user', "Create a user with the given email address and make them an admin. Update in place if the user already exists", () ->
|
|
grunt.registerTask 'create-admin-user', "Create a user with the given email address and make them an admin. Update in place if the user already exists", () ->
|
|
|
done = @async()
|
|
done = @async()
|
|
|
email = grunt.option("email")
|
|
email = grunt.option("email")
|