Преглед изворни кода

updated build sripts with 1.0.3

Henry Oswald пре 8 година
родитељ
комит
ece0540318

+ 1 - 1
services/clsi/.nvmrc

@@ -1 +1 @@
-6.9.5
+6.13.0

+ 1 - 1
services/clsi/Dockerfile

@@ -4,13 +4,13 @@ COPY ./ /app
 
 
 WORKDIR /app
 WORKDIR /app
 
 
-
 RUN npm install
 RUN npm install
 
 
 RUN [ -e ./install_deps.sh ] && ./install_deps.sh
 RUN [ -e ./install_deps.sh ] && ./install_deps.sh
 
 
 RUN npm run compile
 RUN npm run compile
 
 
+ENV SHARELATEX_CONFIG /app/config/settings.production.coffee
 ENV NODE_ENV production
 ENV NODE_ENV production
 
 
 CMD ["node","/app/app.js"]
 CMD ["node","/app/app.js"]

+ 6 - 3
services/clsi/Makefile

@@ -1,13 +1,16 @@
 # 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.0.1
+# Version: 1.0.3
 
 
 BUILD_NUMBER ?= local
 BUILD_NUMBER ?= local
 BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
 BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
 PROJECT_NAME = clsi
 PROJECT_NAME = clsi
 DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
 DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
-DOCKER_COMPOSE := docker-compose ${DOCKER_COMPOSE_FLAGS}
+DOCKER_COMPOSE := BUILD_NUMBER=$(BUILD_NUMBER) \
+	BRANCH_NAME=$(BRANCH_NAME) \
+	PROJECT_NAME=$(PROJECT_NAME) \
+	docker-compose ${DOCKER_COMPOSE_FLAGS}
 
 
 clean:
 clean:
 	rm -f app.js
 	rm -f app.js
@@ -24,7 +27,7 @@ test_acceptance: test_clean # clear the database before each acceptance test run
 	@[ -d test/acceptance ] && $(DOCKER_COMPOSE) run --rm test_acceptance -- ${MOCHA_ARGS} || echo "clsi has no acceptance tests"
 	@[ -d test/acceptance ] && $(DOCKER_COMPOSE) run --rm test_acceptance -- ${MOCHA_ARGS} || echo "clsi has no acceptance tests"
 
 
 test_clean:
 test_clean:
-	$(DOCKER_COMPOSE) down
+	$(DOCKER_COMPOSE) down -t 0
 build:
 build:
 	docker build --pull --tag quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) .
 	docker build --pull --tag quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) .
 
 

+ 14 - 0
services/clsi/base.yml

@@ -0,0 +1,14 @@
+version: "2"
+
+services:
+  base:
+    environment:
+      TEXLIVE_IMAGE: quay.io/sharelatex/texlive-full:2017.1
+      TEXLIVE_IMAGE_USER: root
+      SHARELATEX_CONFIG: /app/config/settings.defaults.coffee
+      COMMAND_RUNNER: docker-runner-sharelatex
+      COMPILES_HOST_DIR: $PWD/compiles
+    volumes:
+      - /var/run/docker.sock:/var/run/docker.sock
+      - ./docker-runner:/app/node_modules/docker-runner-sharelatex
+      - ./compiles:/app/compiles

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

@@ -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.0.1
+# Version: 1.0.3
 
 
 version: "2"
 version: "2"
 
 

+ 10 - 11
services/clsi/docker-compose.yml

@@ -1,13 +1,13 @@
 # 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.0.1
+# Version: 1.0.3
 
 
 version: "2"
 version: "2"
 
 
 services:
 services:
   test_unit:
   test_unit:
-    image: node:6.9.5
+    image: node:6.13.0
     volumes:
     volumes:
       - .:/app
       - .:/app
     working_dir: /app
     working_dir: /app
@@ -15,16 +15,15 @@ services:
 
 
   test_acceptance:
   test_acceptance:
     build: .
     build: .
+    extends:
+      file: base.yml
+      service: base
     environment:
     environment:
-      TEXLIVE_IMAGE: quay.io/sharelatex/texlive-full:2017.1
-      TEXLIVE_IMAGE_USER: root # Not ideal, but makes running in dev very simple
-      SHARELATEX_CONFIG: /app/config/settings.defaults.coffee
-      COMMAND_RUNNER: docker-runner-sharelatex
-      COMPILES_HOST_DIR: $PWD/compiles
-    volumes:
-      - /var/run/docker.sock:/var/run/docker.sock
-      - ./docker-runner:/app/node_modules/docker-runner-sharelatex
-      - ./compiles:/app/compiles
+      REDIS_HOST: redis
+      MONGO_HOST: mongo
+    depends_on:
+      - redis
+      - mongo
     entrypoint: npm run test:acceptance
     entrypoint: npm run test:acceptance
 
 
   redis:
   redis:

+ 41 - 0
services/clsi/kube.yaml

@@ -0,0 +1,41 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: clsi
+  namespace: default
+spec:
+  type: LoadBalancer
+  ports:
+  - port: 3009
+    protocol: TCP
+    targetPort: 3009
+  selector:
+    run: clsi
+---
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: clsi
+  namespace: default
+spec:
+  replicas: 2
+  template:
+    metadata:
+      labels:
+        run: clsi
+    spec:
+      containers:
+      - name: clsi
+        image: gcr.io/henry-terraform-admin/clsi:6e0c79688030117a9c27d0fc01d1271e6ac3dd3e
+        imagePullPolicy: Always
+        readinessProbe:
+          httpGet:
+            path: status
+            port: 3009
+          periodSeconds: 5
+          initialDelaySeconds: 0
+          failureThreshold: 3
+          successThreshold: 1
+
+
+

+ 1 - 0
services/clsi/nodemon.json

@@ -4,6 +4,7 @@
     "node_modules/"
     "node_modules/"
   ],
   ],
   "verbose": true,
   "verbose": true,
+  "legacyWatch": true,
   "execMap": {
   "execMap": {
     "js": "npm run start"
     "js": "npm run start"
   },
   },

+ 56 - 56
services/clsi/package.json

@@ -1,67 +1,67 @@
 {
 {
-  "name": "node-clsi",
-  "description": "A Node.js implementation of the CLSI LaTeX web-API",
-  "version": "0.1.4",
+  "name": "node-clsi", 
+  "description": "A Node.js implementation of the CLSI LaTeX web-API", 
+  "version": "0.1.4", 
   "repository": {
   "repository": {
-    "type": "git",
+    "type": "git", 
     "url": "https://github.com/sharelatex/clsi-sharelatex.git"
     "url": "https://github.com/sharelatex/clsi-sharelatex.git"
-  },
+  }, 
   "scripts": {
   "scripts": {
-    "test:acceptance:wait_for_app": "echo 'Waiting for app to be accessible' && while (! curl -s -o /dev/null localhost:3013/status) do sleep 1; done",
-    "test:acceptance:run": "mocha --recursive --reporter spec --timeout 15000",
-    "test:acceptance:dir": "npm -q run test:acceptance:wait_for_app && npm -q run test:acceptance:run -- $@",
-    "test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- $@",
-    "compile:test:acceptance": "coffee -o test/acceptance/js -c test/acceptance/coffee",
-    "compile:test:smoke": "coffee -o test/smoke/js -c test/smoke/coffee",
-    "compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee",
-    "compile": "npm run compile:app && npm run compile:test:acceptance && npm run compile:test:smoke",
-    "start": "npm run compile:app && node app.js",
-    "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
-    "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
-    "test:unit": "npm run compile:app && npm run compile:unit_tests && npm run test:unit:_run -- $@",
-    "compile:unit_tests": "[ -e test/unit ] && coffee -o test/unit/js -c test/unit/coffee || echo 'No unit tests to compile'",
-    "compile:acceptance_tests": "[ -e test/acceptance ] && coffee -o test/acceptance/js -c test/acceptance/coffee || echo 'No acceptance tests to compile'",
-    "compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests",
+    "test:acceptance:wait_for_app": "echo 'Waiting for app to be accessible' && while (! curl -s -o /dev/null localhost:3013/status) do sleep 1; done", 
+    "test:acceptance:run": "mocha --recursive --reporter spec --timeout 15000", 
+    "test:acceptance:dir": "npm -q run test:acceptance:wait_for_app && npm -q run test:acceptance:run -- $@", 
+    "test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- $@", 
+    "compile:test:acceptance": "coffee -o test/acceptance/js -c test/acceptance/coffee", 
+    "compile:test:smoke": "coffee -o test/smoke/js -c test/smoke/coffee", 
+    "compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee", 
+    "compile": "npm run compile:app && npm run compile:test:acceptance && npm run compile:test:smoke", 
+    "start": "npm run compile:app && node app.js", 
+    "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", 
+    "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", 
+    "test:unit": "npm run compile:app && npm run compile:unit_tests && npm run test:unit:_run -- $@", 
+    "compile:unit_tests": "[ -e test/unit ] && coffee -o test/unit/js -c test/unit/coffee || echo 'No unit tests to compile'", 
+    "compile:acceptance_tests": "[ -e test/acceptance ] && coffee -o test/acceptance/js -c test/acceptance/coffee || echo 'No acceptance tests to compile'", 
+    "compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests", 
     "nodemon": "nodemon --config nodemon.json"
     "nodemon": "nodemon --config nodemon.json"
-  },
-  "author": "James Allen <james@sharelatex.com>",
+  }, 
+  "author": "James Allen <james@sharelatex.com>", 
   "dependencies": {
   "dependencies": {
-    "async": "0.2.9",
-    "body-parser": "^1.2.0",
-    "dockerode": "^2.5.3",
-    "express": "^4.2.0",
-    "fs-extra": "^0.16.3",
-    "grunt-mkdir": "^1.0.0",
-    "heapdump": "^0.3.5",
-    "lockfile": "^1.0.3",
-    "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.4",
-    "lynx": "0.0.11",
-    "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.5.0",
-    "mkdirp": "0.3.5",
-    "mysql": "2.6.2",
-    "request": "^2.21.0",
-    "sequelize": "^2.1.3",
-    "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
-    "smoke-test-sharelatex": "git+https://github.com/sharelatex/smoke-test-sharelatex.git#v0.2.0",
-    "sqlite3": "^3.1.13",
-    "underscore": "^1.8.2",
-    "v8-profiler": "^5.2.4",
+    "async": "0.2.9", 
+    "body-parser": "^1.2.0", 
+    "dockerode": "^2.5.3", 
+    "express": "^4.2.0", 
+    "fs-extra": "^0.16.3", 
+    "grunt-mkdir": "^1.0.0", 
+    "heapdump": "^0.3.5", 
+    "lockfile": "^1.0.3", 
+    "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.4", 
+    "lynx": "0.0.11", 
+    "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.5.0", 
+    "mkdirp": "0.3.5", 
+    "mysql": "2.6.2", 
+    "request": "^2.21.0", 
+    "sequelize": "^2.1.3", 
+    "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0", 
+    "smoke-test-sharelatex": "git+https://github.com/sharelatex/smoke-test-sharelatex.git#v0.2.0", 
+    "sqlite3": "^3.1.13", 
+    "underscore": "^1.8.2", 
+    "v8-profiler": "^5.2.4", 
     "wrench": "~1.5.4"
     "wrench": "~1.5.4"
-  },
+  }, 
   "devDependencies": {
   "devDependencies": {
-    "mocha": "^4.0.1",
-    "coffee-script": "1.6.0",
-    "chai": "~1.8.1",
-    "sinon": "~1.7.3",
-    "grunt": "~0.4.2",
-    "grunt-contrib-coffee": "~0.7.0",
-    "grunt-contrib-clean": "~0.5.0",
-    "grunt-shell": "~0.6.1",
-    "grunt-mocha-test": "~0.8.1",
-    "sandboxed-module": "~0.3.0",
-    "timekeeper": "0.0.4",
-    "grunt-execute": "^0.1.5",
-    "bunyan": "^0.22.1",
+    "mocha": "^4.0.1", 
+    "coffee-script": "1.6.0", 
+    "chai": "~1.8.1", 
+    "sinon": "~1.7.3", 
+    "grunt": "~0.4.2", 
+    "grunt-contrib-coffee": "~0.7.0", 
+    "grunt-contrib-clean": "~0.5.0", 
+    "grunt-shell": "~0.6.1", 
+    "grunt-mocha-test": "~0.8.1", 
+    "sandboxed-module": "~0.3.0", 
+    "timekeeper": "0.0.4", 
+    "grunt-execute": "^0.1.5", 
+    "bunyan": "^0.22.1", 
     "grunt-bunyan": "^0.5.0"
     "grunt-bunyan": "^0.5.0"
   }
   }
 }
 }