jmccann / drone-terraform

Drone plugin for triggering Terraform deployments
http://plugins.drone.io/jmccann/terraform/
Apache License 2.0
86 stars 93 forks source link

Loading credentials from env_file parameter #107

Closed ndajr closed 4 years ago

ndajr commented 5 years ago

Use Cases

Solutions

Actually I needed to change 2 things:

  1. add the env_file as a plugin param
  2. skip the assumeRole if the aws tokens are already set (by the load env)

I also introduced a breaking change by changing CLI param env-file to env_file

I did it mainly for 3 reasons:

@jmccann does that make sense to you? I'm happy to discuss and also revert that breaking change if you have a concern.

Core Changes

ndajr commented 5 years ago

Just in case you need a real example, this is a small project using my fork: https://github.com/neemiasjnr/golang-microservice-example

ndajr commented 5 years ago

@jmccann I did the changes you suggested, thank you for your comments, it was really helpful to me. Now the PR is more clean and focused in the core changes I mentioned. Please let me know if you see something else I can improve on this PR

caioquirino commented 4 years ago

Hello @jmccann, I hope you are starting well this year and had good resolutions for 2019 :) Is there anything else we could do to help you with the code review for this PR and make it to work for a public/cloud drone pipeline? Please let us know :) Thank you.

ndajr commented 4 years ago

@jmccann Thank you for the comments, I really don't why I did what I did to test the credsSet function 😅. I simplified the plugin_test.go as you suggested and now I'm not using the Unmarshal function from godotenv anymore, although I still find it interesting to migrate to version 1.0+ (more stable), what do you think? I'm looking forward to ship it 🥳

jmccann commented 4 years ago

This has been "merged". I rebased from master locally and added some testing fixes and pushed to master. Thanks!