From 1341af04f594b36b452c6b9c2df53d397fce0e85 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 10 Feb 2020 17:10:42 +0100 Subject: [PATCH] [misc] update the build scripts to 1.3.5 --- services/filestore/.dockerignore | 1 - services/filestore/.eslintrc | 15 +++------------ services/filestore/.prettierrc | 2 +- services/filestore/Dockerfile | 15 +++++++++------ services/filestore/Makefile | 7 ++++++- services/filestore/buildscript.txt | 15 ++++++++------- services/filestore/docker-compose.ci.yml | 13 +++++++------ services/filestore/docker-compose.yml | 21 +++++++++++++-------- services/filestore/install_deps.sh | 5 ----- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/services/filestore/.dockerignore b/services/filestore/.dockerignore index 96b359ff8a..cb8e2f9135 100644 --- a/services/filestore/.dockerignore +++ b/services/filestore/.dockerignore @@ -5,7 +5,6 @@ gitrev .npm .nvmrc nodemon.json - uploads/ user_files/ template_files/ diff --git a/services/filestore/.eslintrc b/services/filestore/.eslintrc index 6bd234a2dc..42a4b5cace 100644 --- a/services/filestore/.eslintrc +++ b/services/filestore/.eslintrc @@ -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.3 +// Version: 1.3.5 { "extends": [ "standard", @@ -28,7 +28,7 @@ "overrides": [ { // Test specific rules - "files": ["**/test/*/src/**/*.js"], + "files": ["test/**/*.js"], "globals": { "expect": true }, @@ -53,18 +53,9 @@ "mocha/prefer-arrow-callback": "error" } }, - { - // Frontend test specific rules - "files": ["**/test/frontend/**/*.js"], - "globals": { - "expect": true, - "define": true, - "$": true - } - }, { // Backend specific rules - "files": ["**/app/src/**/*.js"], + "files": ["app/**/*.js", "app.js", "index.js"], "rules": { // don't allow console.log in backend code "no-console": "error" diff --git a/services/filestore/.prettierrc b/services/filestore/.prettierrc index ddf06f31b6..5845b82113 100644 --- a/services/filestore/.prettierrc +++ b/services/filestore/.prettierrc @@ -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.3 +# Version: 1.3.5 { "semi": false, "singleQuote": true diff --git a/services/filestore/Dockerfile b/services/filestore/Dockerfile index fe07a75be2..c4a7b37f9a 100644 --- a/services/filestore/Dockerfile +++ b/services/filestore/Dockerfile @@ -1,11 +1,15 @@ # 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.3 +# Version: 1.3.5 -FROM node:10.19.0 as app +FROM node:10.19.0 as base WORKDIR /app +COPY install_deps.sh /app +RUN chmod 0755 ./install_deps.sh && ./install_deps.sh + +FROM base as app #wildcard as some files may not be in all repos COPY package*.json npm-shrink*.json /app/ @@ -16,12 +20,11 @@ COPY . /app -FROM node:10.19.0 +FROM base COPY --from=app /app /app - -WORKDIR /app -RUN chmod 0755 ./install_deps.sh && ./install_deps.sh +RUN mkdir -p uploads user_files template_files \ +&& chown node:node uploads user_files template_files USER node CMD ["node", "--expose-gc", "app.js"] diff --git a/services/filestore/Makefile b/services/filestore/Makefile index 67bec94e5a..86514a2121 100644 --- a/services/filestore/Makefile +++ b/services/filestore/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.3 +# Version: 1.3.5 BUILD_NUMBER ?= local BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) @@ -33,9 +33,14 @@ test_unit: test_acceptance: test_clean test_acceptance_pre_run test_acceptance_run +test_acceptance_debug: test_clean test_acceptance_pre_run test_acceptance_run_debug + test_acceptance_run: @[ ! -d test/acceptance ] && echo "filestore has no acceptance tests" || $(DOCKER_COMPOSE) run --rm test_acceptance +test_acceptance_run_debug: + @[ ! -d test/acceptance ] && echo "filestore has no acceptance tests" || $(DOCKER_COMPOSE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk + test_clean: $(DOCKER_COMPOSE) down -v -t 0 diff --git a/services/filestore/buildscript.txt b/services/filestore/buildscript.txt index 6205f63f56..75478ce00e 100644 --- a/services/filestore/buildscript.txt +++ b/services/filestore/buildscript.txt @@ -1,10 +1,11 @@ filestore ---env-add=ENABLE_CONVERSIONS="true",USE_PROM_METRICS="true",AWS_S3_USER_FILES_BUCKET_NAME=fake_user_files,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake_template_files,AWS_S3_PUBLIC_FILES_BUCKET_NAME=fake_public_files,AWS_S3_ENDPOINT=http://s3:9090,AWS_ACCESS_KEY_ID=fake,AWS_SECRET_ACCESS_KEY=fake ---dependencies=s3 ---acceptance-creds= ---script-version=1.3 ---node-version=10.19.0 ---language=es ---docker-repos=gcr.io/overleaf-ops --public-repo=True +--language=es +--env-add=ENABLE_CONVERSIONS="true",USE_PROM_METRICS="true",AWS_S3_USER_FILES_BUCKET_NAME=fake_user_files,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake_template_files,AWS_S3_PUBLIC_FILES_BUCKET_NAME=fake_public_files +--node-version=10.19.0 +--acceptance-creds= +--dependencies=s3 +--docker-repos=gcr.io/overleaf-ops --env-pass-through= +--data-dirs=uploads,user_files,template_files +--script-version=1.3.5 diff --git a/services/filestore/docker-compose.ci.yml b/services/filestore/docker-compose.ci.yml index ae9b43ee25..38ee4d81f4 100644 --- a/services/filestore/docker-compose.ci.yml +++ b/services/filestore/docker-compose.ci.yml @@ -1,9 +1,9 @@ # 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.3 +# Version: 1.3.5 -version: "2.1" +version: "2.3" services: test_unit: @@ -22,6 +22,10 @@ services: REDIS_HOST: redis MONGO_HOST: mongo POSTGRES_HOST: postgres + AWS_S3_ENDPOINT: http://s3:9090 + AWS_S3_PATH_STYLE: 'true' + AWS_ACCESS_KEY_ID: fake + AWS_SECRET_ACCESS_KEY: fake MOCHA_GREP: ${MOCHA_GREP} NODE_ENV: test ENABLE_CONVERSIONS: "true" @@ -29,9 +33,6 @@ services: AWS_S3_USER_FILES_BUCKET_NAME: fake_user_files AWS_S3_TEMPLATE_FILES_BUCKET_NAME: fake_template_files AWS_S3_PUBLIC_FILES_BUCKET_NAME: fake_public_files - AWS_S3_ENDPOINT: http://s3:9090 - AWS_ACCESS_KEY_ID: fake - AWS_SECRET_ACCESS_KEY: fake depends_on: s3: condition: service_healthy @@ -49,6 +50,6 @@ services: s3: image: adobe/s3mock environment: - - initialBuckets=fake_user_files,fake_template_files,fake_public_files + - initialBuckets=fake_user_files,fake_template_files,fake_public_files,bucket healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9090"] diff --git a/services/filestore/docker-compose.yml b/services/filestore/docker-compose.yml index 792d70800b..40984ea078 100644 --- a/services/filestore/docker-compose.yml +++ b/services/filestore/docker-compose.yml @@ -1,13 +1,15 @@ # 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.3 +# Version: 1.3.5 -version: "2.1" +version: "2.3" services: test_unit: - build: . + build: + context: . + target: base volumes: - .:/app working_dir: /app @@ -18,7 +20,9 @@ services: user: node test_acceptance: - build: . + build: + context: . + target: base volumes: - .:/app working_dir: /app @@ -27,6 +31,10 @@ services: REDIS_HOST: redis MONGO_HOST: mongo POSTGRES_HOST: postgres + AWS_S3_ENDPOINT: http://s3:9090 + AWS_S3_PATH_STYLE: 'true' + AWS_ACCESS_KEY_ID: fake + AWS_SECRET_ACCESS_KEY: fake MOCHA_GREP: ${MOCHA_GREP} LOG_LEVEL: ERROR NODE_ENV: test @@ -35,9 +43,6 @@ services: AWS_S3_USER_FILES_BUCKET_NAME: fake_user_files AWS_S3_TEMPLATE_FILES_BUCKET_NAME: fake_template_files AWS_S3_PUBLIC_FILES_BUCKET_NAME: fake_public_files - AWS_S3_ENDPOINT: http://s3:9090 - AWS_ACCESS_KEY_ID: fake - AWS_SECRET_ACCESS_KEY: fake user: node depends_on: s3: @@ -47,6 +52,6 @@ services: s3: image: adobe/s3mock environment: - - initialBuckets=fake_user_files,fake_template_files,fake_public_files + - initialBuckets=fake_user_files,fake_template_files,fake_public_files,bucket healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9090"] diff --git a/services/filestore/install_deps.sh b/services/filestore/install_deps.sh index 75f6ff4f86..105e3a0bff 100755 --- a/services/filestore/install_deps.sh +++ b/services/filestore/install_deps.sh @@ -7,8 +7,3 @@ apt-get update apt-get install ghostscript imagemagick optipng --yes rm -rf /var/lib/apt/lists/* - -mkdir /app/user_files/ /app/uploads/ /app/template_files/ -chown -R node:node /app/user_files -chown -R node:node /app/uploads -chown -R node:node /app/template_files