ibm bluemix - building a project with maven

17
Building on Bluemix with Maven [email protected] This is not an official IBM position. The views expressed are solely my own.

Upload: craig-trim

Post on 25-Jul-2015

159 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: IBM Bluemix - Building a Project with Maven

Building on Bluemixwith Maven

[email protected]

This is not an official IBM position. The views expressed are solely my own.

Page 2: IBM Bluemix - Building a Project with Maven

How it worksMaven

• A build automation tool primarily for Java projects• http://trimc-devops.blogspot.com/p/masterpage.html#maven

Jenkins

• An open source continuous integration tool written in Java. • http://trimc-devops.blogspot.com/p/masterpage.html#jenkins

Docker

• A container technology for packaging and deploying distributed applications• http://trimc-devops.blogspot.com/p/masterpage.html#docker

Page 3: IBM Bluemix - Building a Project with Maven

How it works

• Maven uses POM (Project Object Model) files to specify the build and deployment procedures for Java projects.• Jenkins is able to plugin into a variety of SCM tools (including Git) and build

a Java project using a tool like Maven.• Each time a change in checked into Git, Jenkins can be configured to automatically

build the project(s) using Maven and show the result on a dashboard.• Integration is Continuous and any issues, including build errors, are immediately

brought to the forefront

• Docker is used to dynamically provision a transient Jenkins slave, run the build, and then tear down that slave• This is a common paradigm and described here:

https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin

Page 4: IBM Bluemix - Building a Project with Maven

How it works (Issues)

• The use of Docker to dynamically provision Jenkins, run a build,a nd then tear down the slave means the Maven repository is transient• It is not possible to share a Maven repository between builds• This is a design flaw and has a real impact on how code is structured and

deployed• The only way I can think of to overcome this is to have a Maven repository

outside of JazzHub to publish artifacts to.

Page 5: IBM Bluemix - Building a Project with Maven

Step 1: Locate your project

Page 6: IBM Bluemix - Building a Project with Maven

Step 2: Click “Build and Deploy”

Page 7: IBM Bluemix - Building a Project with Maven

Step 3: Enable “Make this a Bluemix Project”

Page 8: IBM Bluemix - Building a Project with Maven

Step 4: Specify the Bluemix space

Page 9: IBM Bluemix - Building a Project with Maven

Step 5: Click “+ ADD STAGE”

Page 10: IBM Bluemix - Building a Project with Maven

Step 6: Verify the Input tab

Page 11: IBM Bluemix - Building a Project with Maven

Step 7: Click “ADD JOB”

Page 12: IBM Bluemix - Building a Project with Maven

Step 8: Select a “Build” job

Page 13: IBM Bluemix - Building a Project with Maven

Step 9: Select Maven from the drop-down list

Page 14: IBM Bluemix - Building a Project with Maven

Step 10: Shell Scripting

In each repository I have a build/pom.xml file that controls the build for those projects. I navigate to the “build” sub-dir and run the maven install command (executes the entire maven lifecycle)

Page 15: IBM Bluemix - Building a Project with Maven

Step 11: Click the Run (arrow) button

Page 16: IBM Bluemix - Building a Project with Maven

Step 12: The Stage is running …

Page 17: IBM Bluemix - Building a Project with Maven

Step 13: View the output

This particular build took a while to get right …