Wednesday 4 January 2017

Grails on Bluemix: Set up fully automated CI/CD Environment

Java Developers love Grails Framework and Good News is that Bluemix WAS Liberty Buildpack also supports running Grails applications.
However, most of the sample applications showcase that you need to compile WAR file locally and then has to be pushed to Bluemix.
This is not the desired option where most of the developers expect a completely automated CI/CD environment.

I have setup a Bluemix environment for Grails 3 CI/CD setup using Bluemix DevOps capabilities. As a developer, you need to just commit and push your code to Git repository either on Bluemix or Github and then the Bluemix Delivery Pipeline will perform Grails Build process to create WAR file and then can be deployed to either CloudFoundry or Docker Containers runtime on Bluemix.
Use this as a starter project to setup a delivery pipeline to develop on local environment, commit and push the changes to Git repository and then automatically build and deploy the application on Bluemix Cloud Foundry.

Bluemix Devops project:
https://hub.jazz.net/project/vtiwari4/gradle-demo-vtiwari4/overview


Github Code Repository:
https://github.com/tiwarivikas/gradle-demo-vtiwari4

This one is developed with Gradle 3, but I have used the following command to create the War file in cloud: ./gradlew clean assemble. We can try the similar approach with your existing Grails build tool as well.

Delivery Pipeline Configuration

Build Command:
./gradlew clean assemble