Open theplankmeister opened 6 years ago
We are seeing the same issue. Our S3 bucket is in the ap-southeast-2 region, which is not in the default region (us-east-1) and therefore the URLs are different.
Note that just above the line @theplankmeister quoted is this assignment:
downloadHost := s3p.getRegion().S3BucketEndpoint
if downloadHost == "" {
downloadHost = fmt.Sprintf("https://s3.amazonaws.com/%s", b.Name)
}
and it only uses the default URL if downloadHost
is empty. I'm wondering what s3p.getRegion().S3BucketEndpoint
returns for non-default regions?
This issue has been open for a while, is there any update? It's a very useful feature to be able to get the URL in the log output and be able to download the artifacts.
Thanks!
I can confirm this problem for https://travis-ci.org/UltraStar-Deluxe/Play/ where s3_region in the .travis-ci.yaml and ARTIFACTS_REGION are all set to "eu-west-1" but the download link url still points to https://s3.amazonaws.com/ultrastar.public.basisbit/...
I made a PR, but it's been ignored for the past year... https://github.com/travis-ci/artifacts/pull/89
It appears that the URL generated for each artifact is incorrect. The current format is
https://s3.amazonaws.com/%s
(as can be seen here where the supplied parameter is the bucket name) which, for example, generateshttps://s3.amazonaws.com/my-bucket/my-org/my-project/build/job/thisisthefile.png
However, when visiting a generated URL, I don't get the expected file, but rather this:
If I then manually modify the generated URL to:
https://my-bucket.s3.amazonaws.com/my-org/my-project/build/job/thisisthefile.png
then it works as expected.
So I'm guessing that the line of code linked to above, should actually be:
downloadHost = fmt.Sprintf("https://%s.s3.amazonaws.com/", b.Name)
...or is there something I'm missing?