dwyl / learn-travis

:sunglasses: A quick Travis CI (Continuous Integration) Tutorial for Node.js developers
MIT License
1.25k stars 351 forks source link

Secure Environment Variables #11

Closed nelsonic closed 8 years ago

nelsonic commented 9 years ago

http://docs.travis-ci.com/user/environment-variables/

gem install travis
cd my_project
travis encrypt MY_SECRET_ENV=super_secret --add env.matrix

If you see a permissions error while attempting to install the _travis_ ruby gem, we recommend using rvm to install the latest ruby (on your user's path) first then try again:

\curl -L https://get.rvm.io | bash -s stable --ruby
rvm install current && rvm use current
gem install travis

See: http://stackoverflow.com/a/14182172/1148249

iteles commented 9 years ago

:+1: A note on what environment variables are and why they are needed will also be useful to beginners as part of this update

nelsonic commented 9 years ago

@iteles agreed. I've added it to my personal backlog https://github.com/nelsonic/node-js-by-example/issues/16 and will get to it shortly (in "The Book") :wink:

For now, we just needed to hide the keys on Travis. :+1:

rjmk commented 9 years ago

Though the docs suggest adding to the env.matrix, I think this will cause a different build to be run for each secure environment variable, with only one variable exported each time. --add env.global may be a better bet.

nelsonic commented 9 years ago

Spot on @rjmk :+1: see: https://github.com/dwyl/tudo/blob/a98286e759f9b097e84058f071cc7df5e0645fc8/.travis.yml#L4-L6 (we just forgot to update this issue body ... thanks for reminding us! How are you doing BTW?) :smiley:

rjmk commented 9 years ago

Awesome :+1:

(And also awesome! Looking forward to some serious #dwyling next week!)

nelsonic commented 9 years ago

We are going to get up to some fun things next week! #dwyl #GetExcited! :stuck_out_tongue_winking_eye:

iteles commented 8 years ago

https://github.com/dwyl/learn-environment-variables :ok_hand: :ok_hand: