mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #53 from sharelatex/csh-ho-docker-issue-1338-bulk-upgrade
Services bulk upgrade - track-changes
This commit is contained in:
commit
d9c95f40d3
12 changed files with 2749 additions and 145 deletions
1
services/track-changes/.gitignore
vendored
1
services/track-changes/.gitignore
vendored
|
@ -2,6 +2,7 @@
|
|||
node_modules/
|
||||
app/js
|
||||
app.js
|
||||
**/*.map
|
||||
test/unit/js
|
||||
test/acceptance/js
|
||||
forever/
|
||||
|
|
|
@ -19,4 +19,4 @@ COPY --from=app /app /app
|
|||
WORKDIR /app
|
||||
USER node
|
||||
|
||||
CMD ["node","app.js"]
|
||||
CMD ["node", "--expose-gc", "app.js"]
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
module.exports = (grunt) ->
|
||||
grunt.loadNpmTasks 'grunt-contrib-coffee'
|
||||
grunt.loadNpmTasks 'grunt-contrib-clean'
|
||||
grunt.loadNpmTasks 'grunt-mocha-test'
|
||||
grunt.loadNpmTasks 'grunt-available-tasks'
|
||||
grunt.loadNpmTasks 'grunt-execute'
|
||||
grunt.loadNpmTasks 'grunt-bunyan'
|
||||
grunt.loadNpmTasks 'grunt-forever'
|
||||
|
||||
grunt.initConfig
|
||||
forever:
|
||||
app:
|
||||
options:
|
||||
index: "app.js"
|
||||
|
||||
execute:
|
||||
app:
|
||||
src: "app.js"
|
||||
|
||||
bunyan:
|
||||
strict: false
|
||||
|
||||
coffee:
|
||||
app_dir:
|
||||
expand: true,
|
||||
flatten: false,
|
||||
cwd: 'app/coffee',
|
||||
src: ['**/*.coffee'],
|
||||
dest: 'app/js/',
|
||||
ext: '.js'
|
||||
|
||||
app:
|
||||
src: 'app.coffee'
|
||||
dest: 'app.js'
|
||||
|
||||
acceptance_tests:
|
||||
expand: true,
|
||||
flatten: false,
|
||||
cwd: 'test/acceptance/coffee',
|
||||
src: ['**/*.coffee'],
|
||||
dest: 'test/acceptance/js/',
|
||||
ext: '.js'
|
||||
|
||||
unit_tests:
|
||||
expand: true,
|
||||
flatten: false,
|
||||
cwd: 'test/unit/coffee',
|
||||
src: ['**/*.coffee'],
|
||||
dest: 'test/unit/js/',
|
||||
ext: '.js'
|
||||
|
||||
clean:
|
||||
app: ["app/js"]
|
||||
acceptance_tests: ["test/acceptance/js"]
|
||||
|
||||
mochaTest:
|
||||
unit:
|
||||
src: ["test/unit/js/#{grunt.option("feature") or "**"}/*.js"]
|
||||
options:
|
||||
reporter: grunt.option('reporter') or 'spec'
|
||||
grep: grunt.option("grep")
|
||||
acceptance:
|
||||
src: ["test/acceptance/js/**/*.js"]
|
||||
options:
|
||||
reporter: grunt.option('reporter') or 'spec'
|
||||
grep: grunt.option("grep")
|
||||
timeout: 10000
|
||||
|
||||
availabletasks:
|
||||
tasks:
|
||||
options:
|
||||
filter: 'exclude',
|
||||
tasks: [
|
||||
'coffee'
|
||||
'clean'
|
||||
'mochaTest'
|
||||
'availabletasks'
|
||||
'execute'
|
||||
'bunyan'
|
||||
]
|
||||
groups:
|
||||
"Compile tasks": [
|
||||
"compile:server"
|
||||
"compile:tests"
|
||||
"compile"
|
||||
"compile:unit_tests"
|
||||
"compile:acceptance_tests"
|
||||
"install"
|
||||
]
|
||||
"Test tasks": [
|
||||
"test:unit"
|
||||
"test:acceptance"
|
||||
]
|
||||
"Run tasks": [
|
||||
"run"
|
||||
"default"
|
||||
]
|
||||
"Misc": [
|
||||
"help"
|
||||
]
|
||||
|
||||
grunt.registerTask 'help', 'Display this help list', 'availabletasks'
|
||||
|
||||
grunt.registerTask 'compile:server', 'Compile the server side coffee script', ['clean:app', 'coffee:app', 'coffee:app_dir']
|
||||
grunt.registerTask 'compile:unit_tests', 'Compile the unit tests', ['coffee:unit_tests']
|
||||
grunt.registerTask 'compile:acceptance_tests', 'Compile the acceptance tests', ['clean:acceptance_tests', 'coffee:acceptance_tests']
|
||||
grunt.registerTask 'compile:tests', 'Compile all the tests', ['compile:acceptance_tests', 'compile:unit_tests']
|
||||
grunt.registerTask 'compile', 'Compiles everything need to run track-changes-sharelatex', ['compile:server']
|
||||
|
||||
grunt.registerTask 'install', "Compile everything when installing as an npm module", ['compile']
|
||||
|
||||
grunt.registerTask 'test:unit', 'Run the unit tests (use --grep=<regex> for individual tests)', ['compile:server', 'compile:unit_tests', 'mochaTest:unit']
|
||||
grunt.registerTask 'test:acceptance', 'Run the acceptance tests (use --grep=<regex> for individual tests)', ['compile:acceptance_tests', 'mochaTest:acceptance']
|
||||
|
||||
grunt.registerTask 'run', "Compile and run the track-changes-sharelatex server", ['compile', 'bunyan', 'execute']
|
||||
grunt.registerTask 'default', 'run'
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# This file was auto-generated, do not edit it directly.
|
||||
# Instead run bin/update_build_scripts from
|
||||
# https://github.com/sharelatex/sharelatex-dev-environment
|
||||
# Version: 1.1.9
|
||||
# Version: 1.1.11
|
||||
|
||||
BUILD_NUMBER ?= local
|
||||
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||
|
|
|
@ -5,6 +5,15 @@ An API for converting raw editor updates into a compressed and browseable histor
|
|||
|
||||
[![Build Status](https://travis-ci.org/sharelatex/track-changes-sharelatex.png?branch=master)](https://travis-ci.org/sharelatex/track-changes-sharelatex)
|
||||
|
||||
Acceptance tests can be run with the command
|
||||
```
|
||||
AWS_BUCKET=<bucket-name> AWS_ACCESS_KEY_ID=<aws-access-key> AWS_SECRET_ACCESS_KEY=<aws-secret-access-key> make test
|
||||
```
|
||||
where `bucket-name`, `aws-access-key` and `aws-secret-access-key` are the credentials for an AWS S3 bucket.
|
||||
|
||||
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
Metrics = require "metrics-sharelatex"
|
||||
Metrics.initialize("track-changes")
|
||||
Settings = require "settings-sharelatex"
|
||||
logger = require "logger-sharelatex"
|
||||
TrackChangesLogger = logger.initialize("track-changes").logger
|
||||
|
@ -23,8 +25,7 @@ TrackChangesLogger.addSerializers {
|
|||
}
|
||||
|
||||
Path = require "path"
|
||||
Metrics = require "metrics-sharelatex"
|
||||
Metrics.initialize("track-changes")
|
||||
|
||||
Metrics.memory.monitor(logger)
|
||||
|
||||
child_process = require "child_process"
|
||||
|
@ -35,6 +36,8 @@ app = express()
|
|||
|
||||
app.use Metrics.http.monitor(logger)
|
||||
|
||||
Metrics.injectMetricsRoute(app)
|
||||
|
||||
app.post "/project/:project_id/doc/:doc_id/flush", HttpController.flushDoc
|
||||
|
||||
app.get "/project/:project_id/doc/:doc_id/diff", HttpController.getDiff
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
async = require "async"
|
||||
_ = require "underscore"
|
||||
{db, ObjectId, BSON} = require "./mongojs"
|
||||
logger = require "logger-sharelatex"
|
||||
Heap = require "heap"
|
||||
|
||||
module.exports = ProjectIterator =
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--script-version=1.1.9
|
||||
--script-version=1.1.11
|
||||
track-changes
|
||||
--node-version=6.11.2
|
||||
--acceptance-creds=aws
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This file was auto-generated, do not edit it directly.
|
||||
# Instead run bin/update_build_scripts from
|
||||
# https://github.com/sharelatex/sharelatex-dev-environment
|
||||
# Version: 1.1.9
|
||||
# Version: 1.1.11
|
||||
|
||||
version: "2"
|
||||
|
||||
|
@ -11,6 +11,7 @@ services:
|
|||
user: node
|
||||
command: npm run test:unit:_run
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This file was auto-generated, do not edit it directly.
|
||||
# Instead run bin/update_build_scripts from
|
||||
# https://github.com/sharelatex/sharelatex-dev-environment
|
||||
# Version: 1.1.9
|
||||
# Version: 1.1.11
|
||||
|
||||
version: "2"
|
||||
|
||||
|
|
2719
services/track-changes/npm-shrinkwrap.json
generated
Normal file
2719
services/track-changes/npm-shrinkwrap.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,7 @@
|
|||
"url": "https://github.com/sharelatex/track-changes-sharelatex.git"
|
||||
},
|
||||
"scripts": {
|
||||
"compile:app": "([ -e app/coffee ] && coffee $COFFEE_OPTIONS -o app/js -c app/coffee || echo 'No CoffeeScript folder to compile') && ( [ -e app.coffee ] && coffee $COFFEE_OPTIONS -c app.coffee || echo 'No CoffeeScript app to compile')",
|
||||
"compile:app": "([ -e app/coffee ] && coffee -m $COFFEE_OPTIONS -o app/js -c app/coffee || echo 'No CoffeeScript folder to compile') && ( [ -e app.coffee ] && coffee -m $COFFEE_OPTIONS -c app.coffee || echo 'No CoffeeScript app to compile')",
|
||||
"start": "npm run compile:app && node $NODE_APP_OPTIONS app.js",
|
||||
"test:acceptance:_run": "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY AWS_BUCKET=$AWS_BUCKET AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID mocha --recursive --reporter spec --timeout 30000 --exit $@ test/acceptance/js",
|
||||
"test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
|
||||
|
@ -29,8 +29,8 @@
|
|||
"express": "3.3.5",
|
||||
"heap": "^0.2.6",
|
||||
"line-reader": "^0.2.4",
|
||||
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.6",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.8",
|
||||
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.9",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.12",
|
||||
"mongo-uri": "^0.1.2",
|
||||
"mongojs": "2.4.0",
|
||||
"redis": "~0.10.1",
|
||||
|
@ -38,25 +38,17 @@
|
|||
"request": "~2.33.0",
|
||||
"requestretry": "^1.12.0",
|
||||
"s3-streams": "^0.3.0",
|
||||
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
|
||||
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.1.0",
|
||||
"underscore": "~1.7.0",
|
||||
"v8-profiler": "^5.6.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "~4.1.1",
|
||||
"sinon": "~3.2.1",
|
||||
"sandboxed-module": "~0.3.0",
|
||||
"grunt-execute": "~0.1.5",
|
||||
"grunt-contrib-clean": "~0.5.0",
|
||||
"grunt-mocha-test": "~0.9.3",
|
||||
"grunt": "~0.4.2",
|
||||
"grunt-available-tasks": "~0.4.2",
|
||||
"grunt-contrib-coffee": "~0.10.1",
|
||||
"bunyan": "~2.0.2",
|
||||
"chai": "~4.1.1",
|
||||
"memorystream": "0.3.1",
|
||||
"mocha": "^4.0.1",
|
||||
"grunt-bunyan": "~0.5.0",
|
||||
"grunt-forever": "~0.4.2",
|
||||
"timekeeper": "0.0.4",
|
||||
"memorystream": "0.3.1"
|
||||
"sandboxed-module": "~0.3.0",
|
||||
"sinon": "~3.2.1",
|
||||
"timekeeper": "0.0.4"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue