Environment Variables in Travis CI

Dan Pelensky
2 min readAug 14, 2017

--

I’m at the start of a project where users of my Clojure Tic Tac Toe app will be able to choose to be a player, or a spectator. I am planning on building this functionality using Amazon’s Simple Queue Service and Simple Notification Service.

While setting up Bandalore to access the Simple Queue Service API I set my AWS ID and AWS Secret Key as Environment Variables using EnvPane (my preferred method of storing Environment Variables). (Note to self — reboot iTerm once an Environment Variable is set to be able to see then when calling $ env)

I set up my environment variables in my Clojure project using (get (System/getenv) “AWS_ID") and had no issues locally, but of course when I pushed to GitHub my Travis CI build failed.

After trying a few things, I found an easy way to set Environment Variables in Travis CI:

1) Select the repository in My Repositories

2) Click ‘More options’ then Settings

3) Set the name and value of your environment variables

4) Restart your build

🎉 Your build no longer fails!

--

--