From ab6300739166376b74cf31658c843dd7db1b72e7 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 21 Jul 2020 10:02:43 +0100 Subject: [PATCH 1/3] Revert "Revert "Bump buildscript to 2.3.0"" This reverts commit 8f631e450cb17beac28fa6e62303bcb413562c46. --- services/docstore/.eslintrc | 2 +- services/docstore/buildscript.txt | 2 +- services/docstore/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/docstore/.eslintrc b/services/docstore/.eslintrc index 2e945d6ffb..76dad1561d 100644 --- a/services/docstore/.eslintrc +++ b/services/docstore/.eslintrc @@ -8,7 +8,7 @@ "prettier/standard" ], "parserOptions": { - "ecmaVersion": 2017 + "ecmaVersion": 2018 }, "plugins": [ "mocha", diff --git a/services/docstore/buildscript.txt b/services/docstore/buildscript.txt index 268fff6941..180a47502d 100644 --- a/services/docstore/buildscript.txt +++ b/services/docstore/buildscript.txt @@ -7,4 +7,4 @@ docstore --language=es --node-version=10.21.0 --public-repo=True ---script-version=2.2.0 +--script-version=2.3.0 diff --git a/services/docstore/package.json b/services/docstore/package.json index 1ae7da0d9e..455dc14ed7 100644 --- a/services/docstore/package.json +++ b/services/docstore/package.json @@ -48,7 +48,7 @@ "eslint-plugin-react": "^7.19.0", "eslint-plugin-standard": "^4.0.1", "mocha": "^7.1.1", - "prettier": "^2.0.1", + "prettier": "^2.0.0", "prettier-eslint-cli": "^5.0.0", "request": "~2.88.2", "sandboxed-module": "~2.0.3", From 19c871c5f896a95059d66e8902462742f05a375b Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 21 Jul 2020 10:03:14 +0100 Subject: [PATCH 2/3] Revert "Revert "Add note on running tests"" This reverts commit 81fdd6a5d1068cbb9f44adecc399e8871ce99dad. --- services/docstore/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/docstore/README.md b/services/docstore/README.md index 4fccec8d9c..dacfd2873b 100644 --- a/services/docstore/README.md +++ b/services/docstore/README.md @@ -3,7 +3,10 @@ overleaf/docstore A CRUD API for storing and updating text documents in projects - +## Tests +``` +AWS_BUCKET=**** AWS_ACCESS_KEY_ID=**** AWS_SECRET_ACCESS_KEY=**** make test +``` License ------- From 4cfeccf5931013a4adc63d61e48126de5906b16e Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 21 Jul 2020 10:03:34 +0100 Subject: [PATCH 3/3] Revert "Revert "Move acceptance test cred config to docker-compose-config.yml"" This reverts commit 703447d33883b45d119ddccee1df4b9ad098b0c2. --- services/docstore/Jenkinsfile | 4 +--- services/docstore/Makefile | 3 --- services/docstore/buildscript.txt | 2 +- services/docstore/docker-compose-config.yml | 14 ++++++++++++++ services/docstore/docker-compose.ci.yml | 6 +++--- services/docstore/docker-compose.yml | 6 +++--- 6 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 services/docstore/docker-compose-config.yml diff --git a/services/docstore/Jenkinsfile b/services/docstore/Jenkinsfile index 95132d21db..15471816e2 100644 --- a/services/docstore/Jenkinsfile +++ b/services/docstore/Jenkinsfile @@ -52,9 +52,7 @@ pipeline { stage('Acceptance Tests') { steps { - withCredentials([usernamePassword(credentialsId: 'S3_DOCSTORE_TEST_AWS_KEYS', passwordVariable: 'AWS_SECRET_ACCESS_KEY', usernameVariable: 'AWS_ACCESS_KEY_ID')]) { - sh 'AWS_BUCKET="sl-acceptance-tests" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" make test_acceptance' - } + sh 'DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" make test_acceptance' } } diff --git a/services/docstore/Makefile b/services/docstore/Makefile index f4eab58929..7bd0895b81 100644 --- a/services/docstore/Makefile +++ b/services/docstore/Makefile @@ -12,9 +12,6 @@ DOCKER_COMPOSE := BUILD_NUMBER=$(BUILD_NUMBER) \ BRANCH_NAME=$(BRANCH_NAME) \ PROJECT_NAME=$(PROJECT_NAME) \ MOCHA_GREP=${MOCHA_GREP} \ - AWS_BUCKET=${AWS_BUCKET} \ - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \ - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \ docker-compose ${DOCKER_COMPOSE_FLAGS} DOCKER_COMPOSE_TEST_ACCEPTANCE = \ diff --git a/services/docstore/buildscript.txt b/services/docstore/buildscript.txt index 180a47502d..48c7852d74 100644 --- a/services/docstore/buildscript.txt +++ b/services/docstore/buildscript.txt @@ -1,5 +1,5 @@ docstore ---acceptance-creds=aws +--acceptance-creds=None --dependencies=mongo --docker-repos=gcr.io/overleaf-ops --env-add= diff --git a/services/docstore/docker-compose-config.yml b/services/docstore/docker-compose-config.yml new file mode 100644 index 0000000000..b19d02d48e --- /dev/null +++ b/services/docstore/docker-compose-config.yml @@ -0,0 +1,14 @@ +version: "2.3" + +services: + dev: + environment: + - AWS_BUCKET + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + + ci: + environment: + - AWS_BUCKET + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY diff --git a/services/docstore/docker-compose.ci.yml b/services/docstore/docker-compose.ci.yml index bc11cc116a..53da6509c7 100644 --- a/services/docstore/docker-compose.ci.yml +++ b/services/docstore/docker-compose.ci.yml @@ -16,14 +16,14 @@ services: test_acceptance: build: . image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER + extends: + file: docker-compose-config.yml + service: ci environment: ELASTIC_SEARCH_DSN: es:9200 REDIS_HOST: redis MONGO_HOST: mongo POSTGRES_HOST: postgres - AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} - AWS_BUCKET: ${AWS_BUCKET} MOCHA_GREP: ${MOCHA_GREP} NODE_ENV: test depends_on: diff --git a/services/docstore/docker-compose.yml b/services/docstore/docker-compose.yml index 8dd824af5d..87ea601dd0 100644 --- a/services/docstore/docker-compose.yml +++ b/services/docstore/docker-compose.yml @@ -21,14 +21,14 @@ services: volumes: - .:/app working_dir: /app + extends: + file: docker-compose-config.yml + service: dev environment: ELASTIC_SEARCH_DSN: es:9200 REDIS_HOST: redis MONGO_HOST: mongo POSTGRES_HOST: postgres - AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} - AWS_BUCKET: ${AWS_BUCKET} MOCHA_GREP: ${MOCHA_GREP} LOG_LEVEL: ERROR NODE_ENV: test