Skip to content

Commit

Permalink
build: new build pushed
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Jain <jsarthak448@gmail.com>
  • Loading branch information
sarthakjdev committed May 7, 2023
1 parent 6e5e6be commit 7bb5894
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8479,6 +8479,15 @@ exports.default = (bucketName, uploadDirectory, environmentPrefix) => __awaiter(
]
}
}).promise();
yield s3Client_1.default.putPublicAccessBlock({
Bucket: bucketName,
PublicAccessBlockConfiguration: {
BlockPublicAcls: false,
BlockPublicPolicy: false,
IgnorePublicAcls: false,
RestrictPublicBuckets: false
}
}).promise();
console.log('Configuring bucket website...');
yield s3Client_1.default.putBucketWebsite({
Bucket: bucketName,
Expand Down Expand Up @@ -10121,6 +10130,7 @@ exports.default = (bucketName) => __awaiter(void 0, void 0, void 0, function* ()
return true;
}
catch (e) {
console.log(e);
return false;
}
});
Expand Down Expand Up @@ -10199,6 +10209,15 @@ exports.default = (bucketName, uploadDirectory, environmentPrefix) => __awaiter(
]
}
}).promise();
yield s3Client_1.default.putPublicAccessBlock({
Bucket: bucketName,
PublicAccessBlockConfiguration: {
BlockPublicAcls: false,
BlockPublicPolicy: false,
IgnorePublicAcls: false,
RestrictPublicBuckets: false
}
}).promise();
console.log('Configuring bucket website...');
yield s3Client_1.default.putBucketWebsite({
Bucket: bucketName,
Expand Down Expand Up @@ -26359,16 +26378,18 @@ exports.default = (bucketName, directory) => __awaiter(void 0, void 0, void 0, f
try {
const fileBuffer = yield fs_1.promises.readFile(filePath);
const mimeType = mime_types_1.default.lookup(filePath) || 'application/octet-stream';
yield s3Client_1.default.putObject({
const response = yield s3Client_1.default.putObject({
Bucket: bucketName,
Key: s3Key,
Body: fileBuffer,
ACL: 'public-read',
ServerSideEncryption: 'AES256',
ContentType: mimeType
}).promise();
console.log({ response });
}
catch (e) {
console.log(e);
const message = `Failed to upload ${s3Key}: ${e.code} - ${e.message}`;
console.log(message);
throw message;
Expand Down

0 comments on commit 7bb5894

Please sign in to comment.