@@ 637,6 637,7 @@ func (ctx *JobContext) UploadArtifacts() error {
secretKey string
bucket string
prefix string
+ location string
)
err := errors.New("Build artifacts were requested, but S3 " +
"is not configured for this build runner.")
@@ 655,13 656,16 @@ func (ctx *JobContext) UploadArtifacts() error {
if prefix, ok = config.Get("builds.sr.ht::worker", "s3-prefix"); !ok {
return err
}
+ if location, ok = config.Get("builds.sr.ht::worker", "s3-location"); !ok {
+ // default to old location
+ location = "us-east-1";
+ }
mc, err := minio.New(upstream, accessKey, secretKey, true)
if err != nil {
return err
}
- // TODO: Let users configure the bucket location
- if err := mc.MakeBucket(bucket, "us-east-1"); err != nil {
+ if err := mc.MakeBucket(bucket, location); err != nil {
if exists, err2 := mc.BucketExists(bucket); err2 != nil && exists {
return err
}