Launch Slave Build Environments with Jenkins and Cloud Application Manager

Einführung

Ease the pain of setting up build environments for every cloud and every project by automating builds using Jenkins slaves powered by Cloud Application Manager. This demo walks you through the process with a typical ticketing SaaS App based on JBoss.

Define a JBoss Build Slave in Cloud Application Manager

Start with a JBoss Box in Cloud Application Manager that installs a ticketing app with runtime dependencies like Java, Maven and the JBoss app server, as well as installing a slave agent on the machine.

Cloud Application Manager Jenkins Automating Builds

To deploy the JBoss environment on any cloud, you can attach the deployment profiles for a variety of cloud providers, including CenturyLink, AWS, Google Cloud, Azure, vSphere, OpenStack, etc. This lets you migrate your workload to any cloud without rebuilding your environment. For this exercise, select Google Cloud.

Cloud Application Manager JBoss Deployment Profile

Setup the Slave in Jenkins

Now go to Jenkins and log into Cloud Application Manager with an Authentication Token.

Cloud Application Manager Jenkins Login

Select the JBoss slave box from the workspace. For Deployment Profile, select Google Cloud.

Cloud Application Manager JBoss Slave Box

Now you need to tell JBoss how to use the slave. Select the maximum and minimum number of instances, and give the slave a Label to use in build jobs.

Cloud Application Manager JBoss Slave Label

Then tell Jenkins how long to keep an idle slave alive, by setting a Retention Time of 30 days.

Cloud Application Manager JBoss Slave Retention

Finally, to create a test build job, select the slave by its Label.

Cloud Application Manager JBoss Slave Selection

Since Jenkins is going to build and test the ticketing app by pulling the latest code from a repository, you'll also need to specify the repo URL.

Cloud Application Manager Repo URL

Next, add build commands. In our example, we're asking Maven to package and build a JBoss app and then run functional tests.

Cloud Application Manager Build Commands

Save the job and watch it build.

Cloud Application Manager Watch Build

Review the Build Logs from the Jenkins Console Output

Once we trigger the job, the build logs show the slave environments deployed through Cloud Application Manager.

Cloud Application Manager Build Logs

At this point, the JBoss build environment is ready.

Cloud Application Manager JBoss Build Environment ready

The logs also show that Maven installed the ticketing app and ran tests on the slave machine successfully.

Cloud Application Manager Tests Successful

Confirm the Build in Cloud Application Manager

Now from Cloud Application Manager, navigate to the Instance of the JBoss application and browse to its IP address.

Cloud Application Manager Instances: JBoss Build Environment

Cloud Application Manager Instances: JBoss App URL

That’s all there is to it.