tmspzz / Rome

Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
MIT License
820 stars 57 forks source link

[Feature Request] Skip s3Bucket cache source if aws credentials unavailable rather than stop whole program #201

Open el-hoshino opened 5 years ago

el-hoshino commented 5 years ago

Enhancement Suggestion

Currently if I write 2 cache sources in Romefile, one as s3Bucket and another as local, and if my PC simply doesn't have AWS access credentials, when I try to download the cache via Rome it simply ends with an error:

No env variable AWS_REGION found. ~/.aws/config: openFile: does not exist (No such file or directory)

Why not just skip this source and try to use the other source, which I specified in Romefile as local :)

Steps which explain the enhancement or reproduce the bug

  1. Save AWS credentials
  2. Specify 2 cache sources in Romefile, 1 is s3Bucket and 2 is local
  3. Carthage bootstrap
  4. Upload cache via Rome
  5. Switch to another PC which doesn't have any AWS credentials, or simply remove them from current PC
  6. Try to download the cache via Rome

Current behavior

Download error occurs without trying to download local cache

Suggested behavior

Leave a warning that shows AWS credentials are required, and then try to download cache from local

Why would the enhancement be useful to most users

Sometimes it just happens that we don't have the access to a PC with the AWS credentials set. Say when you left your company's PC at office and have to do something with your own PC, or when your previous PC just died and it takes some time to get another AWS credential from your company's IT solution department, etc.

In those situations above, since we still have access to our local cache, why not make it able to upload and download it, just like when there's no network access?

Rome version:

0.23.1.61

OS and version:

macOS 10.14.6 Mojave
tmspzz commented 4 years ago

Sounds good!