mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add fake GCS server, and fix health checks
This commit is contained in:
parent
0610b74cc9
commit
7292d93dab
5 changed files with 60 additions and 16 deletions
|
@ -22,10 +22,6 @@ 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"
|
||||
|
@ -33,9 +29,21 @@ 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
|
||||
AWS_S3_PATH_STYLE: 'true'
|
||||
GCS_API_ENDPOINT: gcs:9090
|
||||
GCS_USER_FILES_BUCKET_NAME: fake_userfiles
|
||||
GCS_TEMPLATE_FILES_BUCKET_NAME: fake_templatefiles
|
||||
GCS_PUBLIC_FILES_BUCKET_NAME: fake_publicfiles
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
STORAGE_EMULATOR_HOST: https://gcs:9090/storage/v1
|
||||
depends_on:
|
||||
s3:
|
||||
condition: service_healthy
|
||||
gcs:
|
||||
condition: service_healthy
|
||||
user: node
|
||||
command: npm run test:acceptance:_run
|
||||
|
||||
|
@ -48,8 +56,13 @@ services:
|
|||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
s3:
|
||||
image: adobe/s3mock
|
||||
build:
|
||||
context: test/acceptance/deps
|
||||
dockerfile: Dockerfile.s3mock
|
||||
environment:
|
||||
- initialBuckets=fake_user_files,fake_template_files,fake_public_files,bucket
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9090"]
|
||||
- initialBuckets=fake_user_files,fake_template_files,fake_public_files
|
||||
|
||||
gcs:
|
||||
build:
|
||||
context: test/acceptance/deps
|
||||
dockerfile: Dockerfile.fake-gcs
|
||||
|
|
|
@ -31,10 +31,6 @@ 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
|
||||
|
@ -43,15 +39,32 @@ 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_S3_PATH_STYLE: 'true'
|
||||
AWS_ACCESS_KEY_ID: fake
|
||||
AWS_SECRET_ACCESS_KEY: fake
|
||||
GCS_API_ENDPOINT: gcs:9090
|
||||
GCS_USER_FILES_BUCKET_NAME: fake_userfiles
|
||||
GCS_TEMPLATE_FILES_BUCKET_NAME: fake_templatefiles
|
||||
GCS_PUBLIC_FILES_BUCKET_NAME: fake_publicfiles
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
STORAGE_EMULATOR_HOST: https://gcs:9090/storage/v1
|
||||
user: node
|
||||
depends_on:
|
||||
s3:
|
||||
condition: service_healthy
|
||||
gcs:
|
||||
condition: service_healthy
|
||||
command: npm run test:acceptance
|
||||
|
||||
s3:
|
||||
image: adobe/s3mock
|
||||
build:
|
||||
context: test/acceptance/deps
|
||||
dockerfile: Dockerfile.s3mock
|
||||
environment:
|
||||
- initialBuckets=fake_user_files,fake_template_files,fake_public_files,bucket
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9090"]
|
||||
- initialBuckets=fake_user_files,fake_template_files,fake_public_files
|
||||
|
||||
gcs:
|
||||
build:
|
||||
context: test/acceptance/deps
|
||||
dockerfile: Dockerfile.fake-gcs
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
FROM gh2k/fake-gcs-server
|
||||
RUN apk add --update --no-cache curl
|
||||
COPY healthcheck.sh /healthcheck.sh
|
||||
HEALTHCHECK --interval=1s --timeout=1s --retries=30 CMD /healthcheck.sh http://localhost:9090
|
||||
CMD ["--port=9090"]
|
|
@ -0,0 +1,4 @@
|
|||
FROM adobe/s3mock
|
||||
RUN apk add --update --no-cache curl
|
||||
COPY healthcheck.sh /healthcheck.sh
|
||||
HEALTHCHECK --interval=1s --timeout=1s --retries=30 CMD /healthcheck.sh http://localhost:9090
|
9
services/filestore/test/acceptance/deps/healthcheck.sh
Executable file
9
services/filestore/test/acceptance/deps/healthcheck.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# health check to allow 404 status code as valid
|
||||
STATUSCODE=$(curl --silent --output /dev/null --write-out "%{http_code}" $1)
|
||||
# will be 000 on non-http error (e.g. connection failure)
|
||||
if test $STATUSCODE -ge 500 || test $STATUSCODE -lt 200; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
Loading…
Reference in a new issue