Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add aws s3 provider #227

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .mdeprc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ module.exports = {
post_exec: 'yarn coverage:report'
};

if (process.env.PROVIDER === 'aws') {
module.exports.tests = './test/suites/providers/aws/*.js';
}

if (process.env.PROVIDER !== 'aws') {
module.exports.tests = './test/suites/**/!(providers)/*.js';
}

switch (process.env.DB) {
case 'sentinel':
module.exports.services.push('redisSentinel');
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"compile": "rimraf ./lib && babel -d ./lib --copy-files ./src",
"pretest": "yarn compile",
"test": "rimraf ./coverage && yarn lint && yarn test:e2e",
"test:e2e": "yarn test:e2e:cluster && yarn test:e2e:sentinel",
"test:e2e:cluster": "DB=cluster mdep test run",
"test:e2e:sentinel": "DB=sentinel mdep test run --docker_compose ./test/docker-compose.sentinel.yml",
"test:e2e": "yarn test:e2e:cluster && yarn test:e2e:sentinel && test:e2e:aws-provider",
"test:e2e:cluster": "PROVIDER=gce DB=cluster mdep test run",
"test:e2e:sentinel": "PROVIDER=gce DB=sentinel mdep test run --docker_compose ./test/docker-compose.sentinel.yml",
"test:e2e:aws-provider": "PROVIDER=aws DB=sentinel mdep test run --docker_compose ./test/docker-compose.sentinel.yml",
"start": "mfleet",
"lint": "eslint ./src ./test",
"prepublishOnly": "yarn compile",
Expand Down Expand Up @@ -41,6 +42,7 @@
"@microfleet/validation": "9",
"@sentry/node": "^6.0.2",
"ali-oss": "^6.13.2",
"aws-sdk": "^2.914.0",
"bl": "^4.0.3",
"bluebird": "^3.7.2",
"cluster-key-slot": "^1.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/actions/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const {
* @return {Promise}
*/
async function initFileUpload({ params }) {
console.log('init file upload');
const {
files,
meta,
Expand Down
1 change: 1 addition & 0 deletions src/configs/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ exports.transport = [{
* @returns {Provider}
*/
exports.selectTransport = function selectTransport() {
// console.log('my provider 1', this.providers[0]);
return this.providers[0];
};

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ class Files extends Microfleet {
await super.connect();
await this.initWebhook();
await Promise.mapSeries(this.providers, (provider) => {
// @todo
if (provider.config.name !== 'gce') return null;
if (!['aws', 'gce'].includes(provider.config.name)) return null;

if (!provider.config.bucket.channel.pubsub) return null;
return provider.subscribe(this.handleUploadNotification.bind(this));
});
Expand Down
Loading