Go Continuous Delivery: Gradle task

If you haven’t hear yet about GO CD server, then you might want to take a quick look into it’s documentation: http://www.go.cd/documentation/user/current/ first.

The very first thing that distinguish it from any other Continuous Integration servers like: TeamCity, Bamboo, Jenkins is the fact that it gives you fully featured environment for automate not only your builds, but also your deployments.

It has pretty much more abstract concept of server agents – that can be used for both compiling and packaging your application as well as deploying it and running in your dev or production environments.

It takes some time to fully setup your build pipeline, but afterwards it is entirely worth it.

pipeline_build

The one thing that was lacking in my opinion in Go in general, is tasks that are targeted for specific languages/platforms build systems – like for example Gradle. It is still possible to run the Gradle as “Custom task” no matter whether you are using gradle command or gradlew wrapper script. Despite that I wanted to have more native GO CD support, this is way I had create my own GO CD Gradle plugin:

https://github.com/jmnarloch/gocd-gradle-plugin

The version 0.1 is already available for download, though I am actively working on preparing version that will be adjusted to latest Go JSON API.

You can install it by placing the distribution JAR in $GO_SERVER_HOME/plugins/external directory and restart the server.

After that you will be able to add Gradle tasks to your build pipelines. It gives you UI with similar look and feel as any other standard task:

 

go-cd-gradle-task

Depending on your settings you can either run your build using the wrapper script or configured gradle command. You may specify GRADLE_HOME environment variable if you want to specify that globally for your entire environment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s