Parcourir la source

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

Services bulk upgrade - notifications
Christopher Hoskin il y a 7 ans
Parent
commit
32c6bb9874

+ 1 - 0
services/notifications/.gitignore

@@ -39,6 +39,7 @@ data/*
 app.js
 example.js
 app/js/*
+**/*.map
 test/unit/js/*
 test/smoke/js/*
 cookies.txt

+ 1 - 1
services/notifications/Dockerfile

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

+ 0 - 54
services/notifications/Gruntfile.coffee

@@ -1,54 +0,0 @@
-module.exports = (grunt) ->
-	grunt.initConfig
-		coffee:
-			app_src:
-				expand: true,
-				cwd: "app/coffee"
-				src: ['**/*.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"
-
-		clean:
-			app: ["app/js/"]
-			unit_tests: ["test/unit/js"]
-
-		execute:
-			app:
-				src: "app.js"
-
-		mochaTest:
-			unit:
-				options:
-					reporter: grunt.option('reporter') or 'spec'
-					grep: grunt.option("grep")
-
-				src: ["test/unit/js/**/*.js"]
-
-	grunt.loadNpmTasks 'grunt-contrib-coffee'
-	grunt.loadNpmTasks 'grunt-contrib-clean'
-	grunt.loadNpmTasks 'grunt-mocha-test'
-	grunt.loadNpmTasks 'grunt-execute'
-	grunt.loadNpmTasks 'grunt-bunyan'
-
-	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 'install', 'compile:app'
-
-	grunt.registerTask 'default', ['run']
-
-

+ 1 - 1
services/notifications/Makefile

@@ -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.10
 
 BUILD_NUMBER ?= local
 BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)

+ 5 - 2
services/notifications/app.coffee

@@ -1,3 +1,5 @@
+metrics = require("metrics-sharelatex")
+metrics.initialize("notifications")
 Settings = require 'settings-sharelatex'
 logger = require 'logger-sharelatex'
 logger.initialize("notifications-sharelatex")
@@ -7,8 +9,7 @@ controller = require("./app/js/NotificationsController")
 mongojs = require('mongojs')
 db = mongojs(Settings.mongo.url, ['notifications'])
 Path = require("path")
-metrics = require("metrics-sharelatex")
-metrics.initialize("notifications")
+
 metrics.memory.monitor(logger)
 
 HealthCheckController = require("./app/js/HealthCheckController")
@@ -19,6 +20,8 @@ app.configure ()->
 	app.use metrics.http.monitor(logger)
 	app.use express.errorHandler()
 
+metrics.injectMetricsRoute(app)
+
 app.post '/user/:user_id', controller.addNotification
 app.get '/user/:user_id', controller.getUserNotifications
 app.del '/user/:user_id/notification/:notification_id', controller.removeNotificationId

+ 1 - 1
services/notifications/buildscript.txt

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

+ 1 - 1
services/notifications/docker-compose.ci.yml

@@ -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.10
 
 version: "2"
 

+ 1 - 1
services/notifications/docker-compose.yml

@@ -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.10
 
 version: "2"
 

Fichier diff supprimé car celui-ci est trop grand
+ 986 - 523
services/notifications/npm-shrinkwrap.json


+ 7 - 7
services/notifications/package.json

@@ -4,7 +4,7 @@
   "description": "An API to handle user notifications",
   "main": "app.js",
   "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": "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",
@@ -22,19 +22,19 @@
     "async": "^0.1.22",
     "coffee-script": "^1.7.1",
     "express": "3.1.0",
-    "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.1.0",
-    "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",
+    "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",
     "mongojs": "^2.4.0",
     "node-statsd": "0.0.3",
     "request": "^2.65.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.4.4"
   },
   "devDependencies": {
     "bunyan": "^1.0.0",
+    "chai": "^4.2.0",
     "mocha": "^4.1.0",
-    "chai": "",
-    "sandboxed-module": "",
-    "sinon": ""
+    "sandboxed-module": "^2.0.3",
+    "sinon": "^6.3.5"
   }
 }

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff