<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dan Furze on Medium]]></title>
        <description><![CDATA[Stories by Dan Furze on Medium]]></description>
        <link>https://medium.com/@furzeface?source=rss-5ef043dd3608------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MKTRKQGaCMRmG3ybw82zkA.jpeg</url>
            <title>Stories by Dan Furze on Medium</title>
            <link>https://medium.com/@furzeface?source=rss-5ef043dd3608------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:12:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@furzeface/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Further Travis tips]]></title>
            <link>https://medium.com/@furzeface/further-travis-tips-9ef909665e11?source=rss-5ef043dd3608------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ef909665e11</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[travis]]></category>
            <dc:creator><![CDATA[Dan Furze]]></dc:creator>
            <pubDate>Mon, 01 Feb 2016 17:41:04 GMT</pubDate>
            <atom:updated>2016-02-02T16:52:16.248Z</atom:updated>
            <content:encoded><![CDATA[<p>Building on my <a href="http://furzeface.com/blog/travis-aint-scary">previous introductory pos</a>t on getting set up with <a href="http://travis-ci.org/">Travis CI</a>, here’s a few more quick tips that I’ve learnt to optimise your build.</p><p><em>These tips are based on my own experience building Node based projects.</em></p><h4>Specifying Node version</h4><blockquote>Specifying the latest version can be useful</blockquote><p>You can adjust the Node version that your project uses to build by specifying the version number in your <strong><em>.travis.yml</em></strong> configuration file.</p><p>The virtual machine that Travis spins up then uses <a href="https://github.com/creationix/nvm">NVM</a> to run your build on multiple versions. Using the keyword <strong><em>stable</em></strong> runs the latest safe version, which I find useful.</p><pre># .travis.yml</pre><pre>language: node_js<br>node_js:<br>- &#39;stable&#39;<br>- &#39;0.12&#39;</pre><p><em>Bear in mind that adding multiple versions will increase your time as the build process runs on all of them - but it’s nice to be able to specify which version in case you do need more than one environment.</em></p><h4>Caching directories</h4><blockquote>Cache your dependencies to speed up installation</blockquote><p>One of the first things that automatically happens on your build server with a Node project is <strong><em>npm install</em></strong> to get dependencies from <a href="http://npmjs.com/">NPM</a>.</p><p>We recently started caching the <strong><em>node_modules</em></strong> directory on the VM to speed up installation, and therefore the build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZLqS9mRFASWOyMJmnWgtQ.png" /><figcaption>An example of speeding up your build by caching directories</figcaption></figure><p>On some projects we have found that this cuts the build time by more than half!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJgRXrBFujaKHDFDtAWJog.png" /><figcaption>The Travis build sped up after caching the node_modules directory</figcaption></figure><pre># .travis.yml</pre><pre>cache:<br> directories:<br> — bower_components<br> — node_modules<br> — path/to/any/directory</pre><p>A useful tip is to cache this directory and <strong><em>bower_components</em></strong>, or any other 3rd-party installed dependencies you have in your project.</p><h4>Git checkout depth</h4><blockquote>No need for more than the latest commit</blockquote><p>Another optimisation is adjusting the <strong><em>git checkout depth</em></strong> in your config file.</p><p>This means that the build server will check out only the latest commit(s) from your git repository.</p><p>I can’t think of a situation I’ve had yet that requires more than the very latest commit to build, so it’s worth doing this even if it only speeds up a little bit!</p><pre># .travis.yml</pre><pre>git:<br> depth: 1</pre><h4>Branch white/blacklist</h4><blockquote>Travis allows you to white/blacklist branches, if you so desire</blockquote><p><em>Whitelisting</em> the branches you want to build, or <em>blacklisting</em> the ones you don’t can be quite a useful feature.</p><p>I sometimes use blacklisting — the <strong><em>except</em></strong><em> </em>parameter — to make sure that I’m not building every single test branch that I create. You can also use RegEx for this in your <strong><em>.travis.yml</em></strong> as shown below (eg: matching <strong><em>test-brand-update</em></strong>).</p><p>Using <strong><em>only </em></strong>allows you to do the inverse and <em>whitelist</em> branches, if you desire.</p><pre># .travis.yml</pre><pre>branches:<br> except:<br> — /^test-.*$/<br> only:<br> — master<br> — develop</pre><h4>Post deploy tasks</h4><blockquote>Use the post_deploy task to run checks after your projects has finished deploying</blockquote><p>I use the built-in hook <strong><em>post_deploy</em></strong> to run checks on my personal website after a deployment to AWS. This is very useful for me as one of the tasks performed checks for 404s using <a href="https://github.com/DavidAnson/grunt-check-pages">grunt-check-pages</a>.</p><p>Implementing this is as easy as adding your script/task name to <strong><em>.travis.yml</em></strong> as shown below:</p><pre># .travis.yml</pre><pre>after_deploy:<br> — grunt post_deploy</pre><p><em>To get started from scratch with a Travis continuous integration build, refer to my previous post entitled </em><a href="http://furzeface.com/blog/travis-aint-scary"><em>Travis ain’t scary</em></a><em> — part of a mini-series in overcoming learning curves of new front-end tech.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ef909665e11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>