feat: check if maxun-run-screenshots bucket is created
This commit is contained in:
@@ -35,7 +35,7 @@ async function createBucketWithPolicy(bucketName: string, policy?: 'public-read'
|
|||||||
Statement: [
|
Statement: [
|
||||||
{
|
{
|
||||||
Effect: "Allow",
|
Effect: "Allow",
|
||||||
Principal: "*",
|
Principal: "",
|
||||||
Action: ["s3:GetObject"],
|
Action: ["s3:GetObject"],
|
||||||
Resource: [`arn:aws:s3:::${bucketName}/*`]
|
Resource: [`arn:aws:s3:::${bucketName}/*`]
|
||||||
}
|
}
|
||||||
@@ -130,6 +130,7 @@ class BinaryOutputService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async uploadBinaryOutputToMinioBucket(run: Run, key: string, data: Buffer): Promise<void> {
|
async uploadBinaryOutputToMinioBucket(run: Run, key: string, data: Buffer): Promise<void> {
|
||||||
|
await createBucketWithPolicy('maxun-run-screenshots', 'public-read');
|
||||||
const bucketName = 'maxun-run-screenshots';
|
const bucketName = 'maxun-run-screenshots';
|
||||||
try {
|
try {
|
||||||
console.log(`Uploading to bucket ${bucketName} with key ${key}`);
|
console.log(`Uploading to bucket ${bucketName} with key ${key}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user