stojanovic / scottyjs

Deploy static websites and single page apps to AWS S3 and CloudFront with a single command
http://medium.com/@slobodan/single-command-deployment-for-single-page-apps-29941d62ef97
MIT License
707 stars 37 forks source link

`--profile xyz` flag not working with `aws configure --profile xyz` #33

Open natorojr opened 6 years ago

natorojr commented 6 years ago

I configured a few profiles using the aws configure --profile xyz command as suggested in your documentation, but when I try to use the scotty --profile xyz it does not recognize any of the profiles. It only recognizes the "default" profile.

tomekand1 commented 4 years ago

I configured a few profiles using the aws configure --profile xyz command as suggested in your documentation, but when I try to use the scotty --profile xyz it does not recognize any of the profiles. It only recognizes the "default" profile.

here is a solution for windows, Few quick steps, to get scotty working on your machine,

  1. install NCU "npm i npm-check-updates -g" it has to be global install
  2. Go to C: drive, then select "View" => Options => new window will open, select "View" again and select "Show hidden files, folders and drivers.
  3. Open that path in your terminal "C:\User\username\AppData\Roaming\npm\node_modules\scottyjs"
  4. Run command ncu in your terminal that will check for newest dependencies for scotty.
  5. Run ncu -u <= to update packages, then run "npm install"
  6. Open scotty in VS code, go to "lib/upload-file.js"
  7. On line 23 change ContentType: mime.lookup(fileName),to ContentType: mime.getType (fileName), also in //create-bucket.js, delete-bucket.js, delete-object.js, empty-bucket.js, set-aswebsite.js, set-expiration-dats.js, upload-file.js, upload.js// move this line of code "const s3 = new AWS.S3()" inside function, then inside set-cd.js move "const cloudFront = new AWS.CloudFront()" inside "function setCdn()"
  8. Next step is just for aesthetic reasons, but I thing is worth, as it is nice to have a clean code in spec/support/jasmine-runner.js change first line to / global jasmine /  this will avoid EsLint errors.
  9. Now u can add " -- profile dev/test/prod " to your build command in projects package.jason Enjoy fixed Scotty.js