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

Add fake s3 server and initial config

Simon Detheridge пре 6 година
родитељ
комит
96457597ac

+ 1 - 0
services/filestore/config/settings.defaults.coffee

@@ -16,6 +16,7 @@ settings =
 			s3:
 			s3:
 				key: process.env['AWS_KEY']
 				key: process.env['AWS_KEY']
 				secret: process.env['AWS_SECRET']
 				secret: process.env['AWS_SECRET']
+				endpoint: process.env['AWS_S3_ENDPOINT']
 			stores:
 			stores:
 				user_files: process.env['AWS_S3_USER_FILES_BUCKET_NAME']
 				user_files: process.env['AWS_S3_USER_FILES_BUCKET_NAME']
 				template_files: process.env['AWS_S3_TEMPLATE_FILES_BUCKET_NAME']
 				template_files: process.env['AWS_S3_TEMPLATE_FILES_BUCKET_NAME']

+ 11 - 0
services/filestore/docker-compose.ci.yml

@@ -25,9 +25,16 @@ services:
       ENABLE_CONVERSIONS: "true"
       ENABLE_CONVERSIONS: "true"
       MOCHA_GREP: ${MOCHA_GREP}
       MOCHA_GREP: ${MOCHA_GREP}
       NODE_ENV: test
       NODE_ENV: test
+      AWS_KEY: fake
+      AWS_SECRET: fake
+      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://fakes3:9090
     depends_on:
     depends_on:
       - mongo
       - mongo
       - redis
       - redis
+      - fakes3
     user: node
     user: node
     command: npm run test:acceptance:_run
     command: npm run test:acceptance:_run
 
 
@@ -46,3 +53,7 @@ services:
 
 
   mongo:
   mongo:
     image: mongo:3.4
     image: mongo:3.4
+
+  fakes3:
+    image: adobe/s3mock
+    command: --initialBuckets=fake_user_files,fake_template_files,fake_public_files

+ 12 - 0
services/filestore/docker-compose.yml

@@ -31,10 +31,17 @@ services:
       ENABLE_CONVERSIONS: "true"
       ENABLE_CONVERSIONS: "true"
       LOG_LEVEL: ERROR
       LOG_LEVEL: ERROR
       NODE_ENV: test
       NODE_ENV: test
+      AWS_KEY: fake
+      AWS_SECRET: fake
+      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://fakes3:9090
     user: node
     user: node
     depends_on:
     depends_on:
       - mongo
       - mongo
       - redis
       - redis
+      - fakes3
     command: npm run test:acceptance
     command: npm run test:acceptance
 
 
 
 
@@ -53,4 +60,9 @@ services:
   mongo:
   mongo:
     image: mongo:3.4
     image: mongo:3.4
 
 
+  fakes3:
+    image: adobe/s3mock
+    environment:
+      - initialBuckets=fake_user_files,fake_template_files,fake_public_files
+