Add code to create minio bucket
CI / frontend (push) Canceled after 0s
CI / backend (push) Canceled after 5s

This commit is contained in:
2026-08-12 01:36:39 +08:00
parent 89da4d094f
commit 572cef7b1f
5 changed files with 56 additions and 10 deletions
+6
View File
@@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.IdentityModel.Tokens;
using Minio;
using Minio.DataModel.Args;
using Prometheus;
using Serilog;
using StackExchange.Redis;
@@ -233,6 +234,11 @@ try
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await db.Database.MigrateAsync();
await DataSeeder.SeedAsync(db);
var minio = scope.ServiceProvider.GetRequiredService<IMinioClient>();
var minioOpts = scope.ServiceProvider.GetRequiredService<IOptions<MinioOptions>>().Value;
if (!await minio.BucketExistsAsync(new BucketExistsArgs().WithBucket(minioOpts.BucketName)))
await minio.MakeBucketAsync(new MakeBucketArgs().WithBucket(minioOpts.BucketName));
}
app.Run();