Note that there are some explanatory texts on larger screens.

plurals
  1. POPreserve API key integrity with Travis-CI build-notification hooks in a public repository
    primarykey
    data
    text
    <h2>The Context:</h2> <p>I've <a href="https://github.com/excellenteasy/grunt-pathfinder">open-sourced a repository</a>, which is tested by Travis-CI. Travis offers <a href="http://about.travis-ci.org/docs/user/notifications/">build-notification</a> hooks for the test runs, so you can get notified inside IRC, Flowdock, Campfire and HipChat. To configure these hooks you have to add settings to your <code>.travis.yml</code> config file, which is public. For Hipchat it looks like this:</p> <pre><code>notifications: hipchat: [api token]@[room name] </code></pre> <p>If I'd just put my token there in plain text everyone could see my API Token and access/spam my chatrooms. Among other things that's why Travis added <a href="http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables">secure environemt variables</a>. Basically you can encrypt strings with your key and bind them specifically to the repository, so Travis can access the secret API keys.</p> <p>What you do locally:</p> <pre><code>gem install travis travis encrypt github-user/repo MY_SECRET_ENV=super_secret </code></pre> <p>What you put into <code>.travis.yml</code></p> <pre><code>secure: &lt;encrypted string here&gt; </code></pre> <h2>The Problem:</h2> <p>Unfortunately the documentation isn't overly verbose, google doesn't help, stackoverflow doesn't help <strong>yet</strong> and I can't get this to work.</p> <p><a href="https://github.com/excellenteasy/grunt-pathfinder/blob/28a75631ba89af2519b14bfc51dcf06377b38353/.travis.yml#L8">Here is my first try</a>:</p> <p><code>travis encrypt github-user/repo HIPCHAT=super_secret</code></p> <pre><code>secure: &lt;encrypted string here&gt; notifications: hipchat: &lt;%= ENV['HIPCHAT'] %&gt;@hipchat-room </code></pre> <p>As this doesn't work I went to travis irc on freenode and <a href="https://github.com/excellenteasy/grunt-pathfinder/blob/a553ec2da2081a37dbc043e9d6dd08fb6acdbe8a/.travis.yml#L8">that's what they suggested</a></p> <p><code>travis encrypt github-user/repo key@hipchat-room</code></p> <pre><code>notifications: hipchat: secure: &lt;encrypted string here&gt; </code></pre> <p>As you might have guessed (why am I writing this question again?) this doesn't work either. I hope you can help me fix this problem. Thank you very much</p> <p>Edit: I'm very suspicious of myself. I tripple-checked the API key, it is working. It's up to Travis.</p> <p>2Edit: As this appears to be a bug here is the corresponding <a href="https://github.com/travis-ci/travis-core/issues/157">GitHub issue</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload