Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Our Favorite Continuous Delivery Tools

DZone's Guide to

Our Favorite Continuous Delivery Tools

· DevOps Zone
Free Resource

The DevOps Zone is brought to you in partnership with Sonatype Nexus. The Nexus Suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

We’re working hard in the Logentries towers to integrate our continuous delivery tools, so we can identify and track issues as easily as possible. This saves us time that we can spend on important things like adding new features (or playing pool!).

our favorite continuous delivery tools

We use a lot of tools to manage our development cycle, and we’ve made them interact too.

We use JIRA (by Atlassian) to plan our work, Gitlab to manage our code, and Jenkins for our continuous integration.Jenkins

Does Mr Jenkins Approve?

Merge requests (a.k.a. a pull request in github) aren’t accepted in Logentries until Mr Jenkins is happy with it.

Mr Jenkins is listening, and whenever a new merge request is submitted, he’ll go through it with a fine-tooth comb. If he’s not happy, he’ll reject it.

People don’t like Mr Jenkins, he’s pedantic.

Not only does he perform all of our tests (which the developer will have run before submitting a merge request, but you never know…), he also performs style checks and static analysis depending on the language:

Once he’s done with his tests, Mr. Jenkins will vote on the merge request:

continuous delivery tools Jenkins message

Another failed build sir. Shall I prepare afternoon tea?

Implementation

This integration is actually very simple to implement thanks to a great Jenkins plugin: theGitlab Merge Request Builder Plugin. Once you create Mr. Jenkins’ account on your gitlab site and install the plugin, you can have automatic builds running in 5 minutes.

Why You Should Bother

If you run Jenkins builds against code before it gets merged into a central branch, it can be fixed before it gets accepted!

You have to work on Stories

JiraGitlab




         <—>





We don’t think we’re unique in planning our work.

We hope we’re not unique in planning our work…

We use JIRA to write stories which our developers work on, along with the occasional bug, and we’ve integrated our JIRA stories into Gitlab.

Gitlab can be customised to perform pre-receive checks on any commits pushed to the server.

We’ve written a Ruby script that checks every commit pushed to our gitlab server, and confirms the commit message mentions a JIRA issue that’s in progress or blocked.

If no issue is mentioned, the push is rejected. Ouch.

If an issue is mentioned, the script goes ahead and comments on the mentioned JIRA issue to say that a commit has been made.

cd message in Gitlab

Mr Jenkins always cleans up after himself, as any good butler should.

  • Now we can track all the work that’s been done on a story in JIRA.
  • Now we can see the JIRA issue that each commit relates to in Gitlab.

Awesome.

Implementation

Jira has a well documented API which is pleasant to use.

You need to update your pre-receive hook file in:

${Git installation directory}/gitlab-shell/hooks/

Then, check if the commit message mentions a jira issue

$oldrev = ARGV[1]$newrev = ARGV[2]
revision_list = IO.popen(%W(git rev-list ^#{$oldrev} #{$newrev})).read
revision_list.split(“\n”).each do |rev|commit_msg = IO.popen(%W(git log –format=%B -n 1 #{rev})).readissues = commit_msg.scan(/(jira[- ]?\d+)/i)if issues.empty?puts “No issue mentioned”exit 1endend

Once you’ve found issue IDs, check if the issues are open using the JIRA api, and then post a comment. These steps are long, but not complicated.

An Easy Shortcut for Lazy Developer

It can be a bit of a pain remembering the exact code of your issue (and typing it in every time), so our developers just put the JIRA issue ID in the branch name and use a  handy script we found here to automatically put the branch name in each commit message.

BRANCH_NAME=$(git symbolic-ref –short HEAD)if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; thensed -i.bak -e “1s/$/ [$BRANCH_NAME]/” $1fi

Why You Should Bother

Having your git push rejected seems like a huge irritation, but most people are used to a little rejection(#risqué joke), and after a couple of failures, you’ll remember to mention the right ID.

This results in a huge amount of time saved for planners, because they now know exactly what’s being done on that. We also have a great, interlocked, history between our revision control system and our planning system.

All Over the Shop

All of this data is a pain to manage and compare when it’s spread across so many products.

Happily enough, we have just the ticket to fix that… There’ll be another blog post soon on how we’ve integrated our CD tooling into Logentries and how we’re using it.

The DevOps Zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today

Topics:

Published at DZone with permission of Trevor Parsons, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}