<div dir="ltr">Call me crazy, but how secure is it when it comes to sensitive information like those S3 keys? I noticed that kind of stuff has to be committed directly into the repository.</div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Thu, Jul 3, 2014 at 3:51 PM, Jon Buckley <span dir="ltr"><<a href="mailto:jon@mozillafoundation.org" target="_blank">jon@mozillafoundation.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi everyone! Aki and JP had questions about how the Travis CI S3 deployment of the webmaker snippet landing page works, and I though it’d take this opportunity to explain how Travis CI deployment works in general.<div>
<br></div><div><b>What sites use Travis CI S3 deployment?</b></div><div>Makerstrap - <a href="https://github.com/mozilla/makerstrap/blob/master/.travis.yml" target="_blank">https://github.com/mozilla/makerstrap/blob/master/.travis.yml</a></div>
<div>Landing Pages - <a href="https://github.com/mozilla/webmaker-snippet-landing-page/blob/master/.travis.yml" target="_blank">https://github.com/mozilla/webmaker-snippet-landing-page/blob/master/.travis.yml</a></div><div>
Webmaker Training - <a href="https://github.com/p2pu/school-of-webmaking/blob/gh-pages/.travis.yml" target="_blank">https://github.com/p2pu/school-of-webmaking/blob/gh-pages/.travis.yml</a></div><div>Webmaker Kits - <a href="https://github.com/mozilla/webmaker-kits/blob/gh-pages/.travis.yml" target="_blank">https://github.com/mozilla/webmaker-kits/blob/gh-pages/.travis.yml</a></div>
<div>Webmaker RID - <a href="https://github.com/mozilla/webmaker-rid/blob/master/.travis.yml" target="_blank">https://github.com/mozilla/webmaker-rid/blob/master/.travis.yml</a></div><div><br></div><div>ops-note - To get a list of sites using S3 deployments, it’s easiest to search for IAM users with “deploy” in the user name</div>
<div><br></div><div><b>How does this wizardry work?</b></div><div>Travis CI hooks into most, if not all of our Github repositories. After a push to a branch or a pull request, Travis CI will fetch the appropriate commit, run steps specified in .travis.yml, and let us know if a build passed or failed. Deployment happens after a successful build on Travis CI if it’s configured in the .travis.yml file. Lets take a look at the landing page config:</div>
<div><div><pre><div><span style="font-size:14px"><font face="Courier New"><span style="white-space:normal">language</span><span style="white-space:normal">:</span><span style="white-space:normal"> </span><span style="white-space:normal">node_js</span></font></span></div>
<div><font face="Courier New"><span style="font-size:14px"><span>node_js</span><span>:</span></span></font></div><div><font face="Courier New"><span style="font-size:14px"><span>-</span> <span>'0.10'</span></span></font></div>
<div><font face="Courier New"><span style="font-size:14px"><span>deploy</span><span>:</span></span></font></div><div><font face="Courier New"><span style="font-size:14px"> <span>provider</span><span>:</span> <span>s3</span></span></font></div>
<div><font face="Courier New"><span style="font-size:14px"> <span>access_key_id</span><span>:</span> <span>AKIAI3MGOBZWQXTII3QQ</span></span></font></div><div><font face="Courier New"><span style="font-size:14px"> <span>secret_access_key</span><span>:</span></span></font></div>
<div><font face="Courier New"><span style="font-size:14px"> <span>secure</span><span>:</span> <span>AcC649sB4oEKQeSTYv4rqbmMG60T5P74GydLKTLpLg4kFAkj9/lYvw43lsgMDCdrKCA12Z97CIwrmku1jnA9e/n/a09k6cbi8gq4E337Sz7e9v5xTP0aPqv4vE5gsQ7FvCbUROSE6tgYQIzqliisBBeM6iAc8+aPv3DSGTg+zWI=</span></span></font></div>
<div><font face="Courier New"><span style="font-size:14px"> <span>bucket</span><span>:</span> <span><a href="http://welcome.webmaker.org" target="_blank">welcome.webmaker.org</a></span></span></font></div><div><font face="Courier New"><span style="font-size:14px"> <span>skip_cleanup</span><span>:</span> <span>true</span></span></font></div>
<div><font face="Courier New"><span style="font-size:14px"> <span>on</span><span>:</span></span></font></div><div><font face="Courier New"><span style="font-size:14px"> <span>repo</span><span>:</span> <span>mozilla/webmaker-snippet-landing-page</span></span></font></div>
</pre></div><div>The first three lines just tell Travis that we’re building a node app, nothing special there.</div><div>The provider line specifies S3 deployment. There’s many other kinds of deployment, but S3 is what we do now.</div>
<div>The access_key_id, secret_access_key, and bucket are AWS configuration.</div></div><div>The skip_cleanup variable will leave any build artifacts in the build folder; this is important for apps that do any sort of build process (grunt, jekyll, etc)</div>
<div>The on repo means that the deployment will only run on the main repository, not any forks. Deployment wouldn’t work on a fork, because the encrypted secret_access_key can only be decrypted by mozilla/webmaker-snippet-landing-page.</div>
<div><br></div><div><b>How do I configure a new app with S3 deployment?</b></div><div><b><br></b></div><div>File a bug on cade, jp, or myself inside the DevOps component. Let us know things like what the domain name should be, what kind of app it is, what kind of traffic is expected. Once you’ve got the access_key_id, secret_access_key, and bucket from us, then you can run through the travis-ci s3 deployment wizard by running it from the CLI interface: <a href="https://github.com/travis-ci/travis.rb#setup" target="_blank">https://github.com/travis-ci/travis.rb#setup</a></div>
<div><br></div><div><b>What about staging/production environments?</b></div><div><b><br></b></div><div>None of our current S3-deployed apps have separate environments. All production, all the time!</div><div><br></div><div>
This is something that we’re going to add to the Landing Pages website this week, so keep an eye on the Travis config file if you want to learn how!</div><div><br></div><div><b>Anything else?</b></div><div><br></div><div>
The most up-to-date docs are available at <a href="http://docs.travis-ci.com/user/deployment/" target="_blank">http://docs.travis-ci.com/user/deployment/</a> . If this email didn’t answer your question, I’d check there next!<span class="HOEnZb"><font color="#888888"><div>
<br></div><div>Jon</div></font></span></div></div><br>_______________________________________________<br>
Webmaker-dev mailing list<br>
<a href="mailto:Webmaker-dev@mozilla.org">Webmaker-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/webmaker-dev" target="_blank">https://mail.mozilla.org/listinfo/webmaker-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>-- </div><div><font face="'courier new', monospace"><b>________________________<br>Matthew Schranz<br></b></font>Seneca College <a href="https://scs.senecac.on.ca/cpa" target="_blank">CPA</a> Graduate<div>
Twitter/IRC/Github: mjschranz</div><div>Mobile: 647-896-3799</div><div><div>(╯°□°)╯︵ ┻━┻<br></div></div></div></div>
</div>