The CI/CD and DevOps Blog

Learn about various tried-and-tested strategies that will help you ship code faster

Charlie Crawford

Recent Posts

Continuous Deployment to Engine Yard

Here at Shippable we love taking customers all the way to continuous deployment. We've detailed a variety of different ways to get there in the past, and today we are going to be bringing out yet another way. Today we'll be showing you how to trigger your Shippable builds, to push your rails apps to Engine Yard.

Before going any further, there are a few pre-reqs:

  • An active Engineyard account
  • A working rails app on github
  • An active Shippable account
  • The above rails app being enabled on Shippable
  • An application env already setup on Engine Yard

Shippable builds with Git submodules

Sometimes it doesn't make sense to put all your code into one repo. It's common for projects to be spread across multiple repos, and linked together via git submodules. Shippable supports this workflow and all that's required is a few extra lines in your shippable.yml! If all the repos involved are public, you simply have to include commands to init and update the submodules in your shippable.yml file. Here's an example snippet:

script:
- git submodule init
- git submodule update

Static analysis for Shippable with Code Climate

Previously we discussed how to give your code on commit static analysis setup with rubocop. However, we can also integrate with hosted solutions such as Code Climate! In their own words "Code Climate consolidates the results from a suite of static analysis tools into a single, real-time report, giving your team the information it needs to identify hotspots, evaluate new approaches, and improve code quality." Pretty useful stuff! Let's get it working with our rails shippable builds!

Given a rails app similar to the one we made before (which can be found here) we can easily morph it into using code climate. Before we begin, your repo must be enabled in Code Climate. After logging into Code Climate with your github account, click 'Add Open Source Repo' and search for your project. Alternatively, you can add your private repo. In either case, next you'll need to find your Code Climate Repo token. This token is necessary for your minion to be able to communicate with Code climate. 

Thankfully, the token isn't hard to find! Click on the the 'Set Up Test Coverage' button on your project's page on Code Climate:

Post CI Dockerbuild

 
Warning-Icon.png
 

DEPRECATED BLOG:

We have significantly updated the Shippable platform with several new features. Hence most of the content in this blog is deprecated. For the latest information, refer to our documentation and/or open a support issue, if you have questions.

container_build

We introduced our support for docker build a few weeks back - along with it's very own blog post - but we've had requests to support an additional workflow. Starting today, you can docker build an image post-ci. Before we go any further, EVERYTHING mentioned in blog mentioned above is a pre-req to do this. Make sure you do everything mentioned in that blog first, or your post-ci docker build won't work!

Some of you might be wondering why you'd ever want to do this. Well, post-ci building allows you to create a concise docker image that contains only what you need for deployment, and leave out anything that is only required for building/testing. After all, there really isn't a benefit to deploying your build tools to production! However, as there is no upfront way for us to know which files you’d like to put in your “prod” docker image, you must manually specify which files to include. Don't worry though, as it's a simple one-liner. We'll get that in a bit; you first need to tweak your project's settings a little bit further.

Shippable IRC Notifications

Warning-Icon.png

DEPRECATED BLOG:

We have significantly updated the Shippable platform with several new features. Hence most of the content in this blog is deprecated. For the latest information, refer to our documentation and/or open a support issue, if you have questions.


 

shippableIRC

We've talked about integrating with messaging services before, such as slack, but there are many more messaging services you can integrate Shippable with. Starting today, your minions can print out build status messages to IRC!

IRC support is implemented as a subtag of notifications. The IRC subtag itself has a number of subtags, but the two most useful one is the "channels" subtag. The channels tag is used to specify which IRC channels you would like your build to message.

The channels tag is quite easy to use, but let's show a quick example anyway! If you want your build to message the "shippable" channel on freenode, you would add the following snippet to your shippable.yml file:

notifications:
  irc:
    channels:
      - "chat.freenode.net#shippable"