Merge pull request #7 from sharelatex/csh-ho-docker-issue-1338-bulk-upgrade

Services bulk upgrade - contacts
This commit is contained in:
Christopher Hoskin 2019-01-10 10:31:54 +00:00 committed by GitHub
commit 8b59e77d89
12 changed files with 1803 additions and 2671 deletions

View file

@ -3,4 +3,5 @@ app/js/
test/unit/js test/unit/js
test/acceptance/js test/acceptance/js
app.js app.js
**/*.map
forever forever

View file

@ -19,4 +19,4 @@ COPY --from=app /app /app
WORKDIR /app WORKDIR /app
USER node USER node
CMD ["node","app.js"] CMD ["node", "--expose-gc", "app.js"]

View file

@ -1,78 +0,0 @@
module.exports = (grunt) ->
grunt.initConfig
forever:
app:
options:
index: "app.js"
coffee:
app_src:
expand: true,
flatten: true,
cwd: "app"
src: ['coffee/*.coffee'],
dest: 'app/js/',
ext: '.js'
app:
src: "app.coffee"
dest: "app.js"
unit_tests:
expand: true
cwd: "test/unit/coffee"
src: ["**/*.coffee"]
dest: "test/unit/js/"
ext: ".js"
acceptance_tests:
expand: true
cwd: "test/acceptance/coffee"
src: ["**/*.coffee"]
dest: "test/acceptance/js/"
ext: ".js"
clean:
app: ["app/js/"]
unit_tests: ["test/unit/js"]
acceptance_tests: ["test/acceptance/js"]
execute:
app:
src: "app.js"
mochaTest:
unit:
options:
reporter: grunt.option('reporter') or 'spec'
grep: grunt.option("grep")
src: ["test/unit/js/**/*.js"]
acceptance:
options:
reporter: grunt.option('reporter') or 'spec'
timeout: 40000
grep: grunt.option("grep")
src: ["test/acceptance/js/**/*.js"]
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-mocha-test'
grunt.loadNpmTasks 'grunt-shell'
grunt.loadNpmTasks 'grunt-execute'
grunt.loadNpmTasks 'grunt-bunyan'
grunt.loadNpmTasks 'grunt-forever'
grunt.registerTask 'compile:app', ['clean:app', 'coffee:app', 'coffee:app_src']
grunt.registerTask 'run', ['compile:app', 'bunyan', 'execute']
grunt.registerTask 'compile:unit_tests', ['clean:unit_tests', 'coffee:unit_tests']
grunt.registerTask 'test:unit', ['compile:app', 'compile:unit_tests', 'mochaTest:unit']
grunt.registerTask 'compile:acceptance_tests', ['clean:acceptance_tests', 'coffee:acceptance_tests']
grunt.registerTask 'test:acceptance', ['compile:acceptance_tests', 'mochaTest:acceptance']
grunt.registerTask 'install', 'compile:app'
grunt.registerTask 'default', ['run']

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly. # This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.9 # Version: 1.1.10
BUILD_NUMBER ?= local BUILD_NUMBER ?= local
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)

View file

@ -1,13 +1,16 @@
Metrics = require "metrics-sharelatex"
Metrics.initialize("contacts")
Settings = require "settings-sharelatex" Settings = require "settings-sharelatex"
logger = require "logger-sharelatex" logger = require "logger-sharelatex"
express = require "express" express = require "express"
bodyParser = require "body-parser" bodyParser = require "body-parser"
Errors = require "./app/js/Errors" Errors = require "./app/js/Errors"
HttpController = require "./app/js/HttpController" HttpController = require "./app/js/HttpController"
Metrics = require "metrics-sharelatex"
Path = require "path" Path = require "path"
Metrics.initialize("contacts")
logger.initialize("contacts") logger.initialize("contacts")
Metrics.event_loop?.monitor(logger) Metrics.event_loop?.monitor(logger)
@ -15,6 +18,8 @@ app = express()
app.use Metrics.http.monitor(logger) app.use Metrics.http.monitor(logger)
Metrics.injectMetricsRoute(app)
app.get '/user/:user_id/contacts', HttpController.getContacts app.get '/user/:user_id/contacts', HttpController.getContacts
app.post '/user/:user_id/contacts', bodyParser.json(limit: "2mb"), HttpController.addContact app.post '/user/:user_id/contacts', bodyParser.json(limit: "2mb"), HttpController.addContact

View file

@ -1,4 +1,4 @@
--script-version=1.1.9 --script-version=1.1.10
contacts contacts
--node-version=6.14.1 --node-version=6.14.1
--acceptance-creds=None --acceptance-creds=None

View file

@ -8,4 +8,4 @@ module.exports =
host: process.env["LISTEN_ADDRESS"] or "localhost" host: process.env["LISTEN_ADDRESS"] or "localhost"
mongo: mongo:
url: "mongodb://#{process.env["MONGO_HOST"] or "localhost"}/sharelatex" url: process.env['MONGO_CONNECTION_STRING'] or "mongodb://#{process.env["MONGO_HOST"] or "localhost"}/sharelatex"

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly. # This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.9 # Version: 1.1.10
version: "2" version: "2"

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly. # This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.9 # Version: 1.1.10
version: "2" version: "2"

1785
services/contacts/npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
"url": "https://github.com/sharelatex/contacts-sharelatex.git" "url": "https://github.com/sharelatex/contacts-sharelatex.git"
}, },
"scripts": { "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", "start": "npm run compile:app && node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 30000 --exit $@ test/acceptance/js", "test:acceptance:_run": "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", "test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
@ -25,25 +25,17 @@
"body-parser": "~1.0.2", "body-parser": "~1.0.2",
"coffee-script": "^1.7.1", "coffee-script": "^1.7.1",
"express": "~4.1.1", "express": "~4.1.1",
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.1.0", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.9",
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1", "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.12",
"mongojs": "2.4.0", "mongojs": "2.4.0",
"request": "~2.34.0", "request": "~2.34.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.6.0" "underscore": "~1.6.0"
}, },
"devDependencies": { "devDependencies": {
"bunyan": "~0.22.3", "bunyan": "~0.22.3",
"chai": "~1.9.1", "chai": "~1.9.1",
"grunt": "~0.4.4",
"grunt-bunyan": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.10.1",
"grunt-execute": "~0.2.1",
"grunt-forever": "~0.4.4",
"grunt-mocha-test": "~0.10.2",
"mocha": "^4.0.1", "mocha": "^4.0.1",
"grunt-shell": "~0.7.0",
"sandboxed-module": "~0.3.0", "sandboxed-module": "~0.3.0",
"sinon": "~1.5.2", "sinon": "~1.5.2",
"timekeeper": "0.0.5" "timekeeper": "0.0.5"