Posts

  • Continuous Integration with Bamboo on Linux

    Now that school’s finally out, I’ve got some time to learn something about [continuous integration][ci] (CI), an integral part of agile development techniques. CI is all about applying QC and testing during development, as opposed to the end of development cycle for the waterfall development model.

    So this means, whenever you commit anything into your code repository, your code should at the very least, compile. Following which, tests that were passing should continue to pass. Thirdly, any new tests that you’ve written should slowly turn from failure (red) to pass (green).

    This way, when bugs were to inadvertently occur, resolution will be easier and quicker as the code is still fresh in the developer’s mind—the older the bug gets, the longer it takes to identify and fix it.

    For the open source world, [Travis CI][travis] offers a hosted CI environment. It supports a wide-range of languages and it’s a breeze to use, as long as your code is hosted on [GitHub][]. Apart from Travis, I’ve seen [Jenkins][jk] and [CruiseControl][cc] being used, but I have not used either myself. CruiseControl looks much more difficult to configure and install than compared to Jenkins.

    As [Atlassian][at] offers free classroom licenses for students, I’ve been using their [JIRA][] and [Confluence][cf] products in my projects and found their [Bamboo][] CI product a natural fit with good integration among other Atlassian products.

    For a cost-free option, I’ve heard recommendations for [TeamCity][tc][^1]. It looks the most promising and a good competitor to Atlassian Bamboo.

    Starting Bamboo on Boot

    Admittedly, documentation for Bamboo isn’t perfect and a critical piece of information is missing—start-up scripts and launching bamboo as a non-root user.

    Anyway, after some digging on Google and tweaking, here’s a copy of the init script that I’m using:

    #!/bin/sh
    # Startup script for bamboo
    #
    # chkconfig: 2345 99 01
    # description: Atlassian Bamboo
    # pidfile: /var/run/bamboo.pid
    . /etc/rc.d/init.d/functions
    BAMBOO_HOME=/var/atlassian/application-data/bamboo
    BAMBOO_INSTALL=/opt/atlassian/bamboo
    BAMBOO_USER=bamboo
    export BAMBOO_HOME
    NAME=bamboo
    BPID=${BAMBOO_INSTALL}/bamboo.pid
    PID=/var/run/${NAME}.pid
    cd ${BAMBOO_INSTALL}
    if [ _$1 = _condrestart ]; then </div></div>
    </span>su ${BAMBOO_USER} -c " </div></div>
    cd </span>${BAMBOO_INSTALL} && </div></div>
    </span>${BAMBOO_INSTALL}/wrapper/start-bamboo stop && </div></div>
    </span>${BAMBOO_INSTALL}/wrapper/start-bamboo start </div></div>
    "</span>
    else </div></div>
    </span>su ${BAMBOO_USER} -c " </div></div>
    cd </span>${BAMBOO_INSTALL} && </div></div>
    </span>${BAMBOO_INSTALL}/wrapper/start-bamboo $@ </div></div>
    "</span>
    fi
    RC=$?
    if [ -f $BPID ]; then </div></div>
    </span>cp -- $BPID $PID
    touch /var/lock/subsys/${NAME}
    else </div></div>
    </span>rm -- $PID /var/lock/subsys/${NAME} 2>/dev/null
    fi </div></div>
    </span>
    exit $RC
    </pre></div></figure> Remember to modify `BAMBOO_HOME`, `BAMBOO_INSTALL`, and `BAMBOO_USER` before using it. This script is modified to use the provided java service wrapper which provides auto-restarting functionality should the JVM hang. ## Bamboo with RVM and Ruby The stock Bamboo installation has no support for RVM and complicated Ruby installations. Fortunately, Mark Wolfe has written an awesome [rake-bamboo-plugin][2] ([source][3]), which makes running Ruby, Bundler, and Rake tasks, on RVM possible. *** [^1]: Free professional license with any downloaded TeamCity binary, and does not require any license key, limited to 20 build configurations, and 3 agents. Not open source. [3]: https://github.com/wolfeidau/rake-bamboo-plugin [2]: https://plugins.atlassian.com/plugins/au.id.wolfe.bamboo.rake-bamboo-plugin [bamboo]: http://www.atlassian.com/software/bamboo/overview [jira]: http://www.atlassian.com/software/jira/overview [cf]: http://www.atlassian.com/software/confluence/overview [at]: http://atlassian.com/ [tc]: http://www.jetbrains.com/teamcity/ [cc]: http://cruisecontrol.sourceforge.net/ [jk]: http://jenkins-ci.org/ [github]: http://github.com/ [travis]: http://travis-ci.org/ [ci]: http://en.wikipedia.org/wiki/Continuous_integration
    · · ·
  • Data Harvesting at Google Not a Rogue Act

    NYTimes:

    Google’s harvesting of e-mails, passwords and other sensitive personal information from unsuspecting households in the United States and around the world was neither a mistake nor the work of a rogue engineer, as the company long maintained, but a program that supervisors knew about, according to new details from the full text of a regulatory report.

    Another indication that one must never trust Google—they are economical with honesty and truth. If you’re planning on putting your files onto Google Drive, you might want to think again.

    · · ·
  • How to Cope with the Gmail Redesign

    Jason Crawford:

    Reports are coming in from around the Internet that the Gmail redesign, which we were previously able to stave off with “revert to the old look temporarily”, is now forcing itself upon us. I too have succumbed to the new design, and have been forced to find ways to cope. Here’s what I did to make it semi-bearable.

    I didn’t express how annoying the new “redesign” of all Google properties were. In one word—horrible. Everything was made harder to read, harder to use, and whitespace was made too plentiful.

    Follow Jason’s post for a step-by-step guide to make the Gmail interface more usable.

    Personally, I’ve switched to Mail.app and Sparrow for all my email needs.

    · · ·
  • The History of File-Sharing

    TorrentFreak:

    Last century filesharing was a fringe hobby, only for geeks who were lucky enough to own a computer that could dial into the World Wide Web. How different is that today, where filesharing has become daily routine for hundreds of millions of people worldwide. In just a few years swapping files has become mainstream. Time to take a step back and see how it all came about.

    A very interesting walk down memory lane on the evolution of file distribution networks. I still remember the days of 28.8 kbps modems; how painfully slow they were!

    · · ·