dwyl/learn-travis

Secure Environment Variables

nelsonic opened this issue ยท 7 comments

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

๐Ÿ‘ A note on what environment variables are and why they are needed will also be useful to beginners as part of this update

@iteles agreed. I've added it to my personal backlog dwyl/learn-node-js-by-example#16 and will get to it shortly (in "The Book") ๐Ÿ˜‰

For now, we just needed to hide the keys on Travis. ๐Ÿ‘

rjmk commented

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.

Spot on @rjmk ๐Ÿ‘
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?) ๐Ÿ˜ƒ

rjmk commented

Awesome ๐Ÿ‘

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

We are going to get up to some fun things next week! #dwyl #GetExcited! ๐Ÿ˜œ