s3deploy icon indicating copy to clipboard operation
s3deploy copied to clipboard

Allow configuration in yml file

Open Jos512 opened this issue 7 years ago • 4 comments

  • [x] I examined open issues in this repository.
  • [x] I read the README file.
  • [x] I Googled for examples of the .s3deploy.tml configuration file.
  • [x] I Googled for how other people use s3deploy.

I like the tool and the advanced route configuration that we can do in the .s3deploy.yml file. But I think the tool would be easier to use from the command line when we can just type s3deploy, and have all other settings loaded from the config file. That makes version control of the settings possible too.


Should this feature already be possible, I ask in this issue to give a quick example in the README file for reference.

My approach at least didn't work:

bucket: example.com
key: xcsds
region: us-east-2
secret: xdsfdsf
source: public

routes:
    - route: "^.+\\.(js|css|svg|ttf)$"
      headers:
         Cache-Control: "max-age=31536000, no-transform, public"
      gzip: true
    - route: "^.+\\.(png|jpg)$"
      headers:
         Cache-Control: "max-age=31536000, no-transform, public"
      gzip: true
    - route: "^.+\\.(html|xml|json|js)$"
      gzip: true
C:\site>s3deploy -try -config .s3deploy-us.yml
s3deploy 2.0.2, commit cc7116a41bbeed8cc9f250b48143c461a1fb4ef6, built at 2018-04-24T20:31:38Z
error: AWS bucket is required

Thanks for the time and effort put in making this tool. :slightly_smiling_face:

Jos512 avatar May 19 '18 11:05 Jos512

Yes, we should fix that. I suspect this is a case of me adding config file support "after the fact".

bep avatar May 19 '18 13:05 bep

Thinking about this.

bucket: example.com
key: xcsds
region: us-east-2
secret: xdsfdsf
source: public

I don't think key/secret should be in this file, as it this file should be committed to GitHub, secrets should .... stay secret.

bep avatar May 19 '18 17:05 bep

I don't think key/secret should be in this file, as it this file should be committed to GitHub, secrets should .... stay secret.

Sure for GitHub. But those that use private BitBucket repositories, like me, can safely commit the key and secret in the config file. Perhaps we can add a warning about this in the README file?

Jos512 avatar May 20 '18 05:05 Jos512

Perhaps we can add a warning about this in the README file?

Yes, OK, that would be good. I guess there are plenty of ways a user can shoot him/herself in the foot.

bep avatar May 20 '18 08:05 bep