The following is a guest post from Rosmi Chandy, Software Developer at CloudMunch, a continuous deployment and application delivery platform.
CloudMunch recently announced the availability of our integration with Cloud Foundry. CloudMunch is a cloud-based solution for continuous integration, testing and release management. It manages the typical DevOps activities for a project, enabling developers to deploy applications to Cloud Foundry powered clouds, such as Pivotal’s http://run.pivotal.io PaaS. CloudMunch (1) tracks user repos (e.g., Github) for any updates or changes which would (2) trigger the predefined CloudMunch pipeline. (3) The pipeline validates the code, compiles/builds the app, and if all tests conditions are met (4) automatically deploys app updates to Cloud Foundry.
Before Getting Started
Before configuring a CloudMunch account for continuous deployment:
- Setup a Github account and keep your credentials handy
- Ensure a copy of your app is available on Github. Start with a simple Java/Spring app to try things out.
- Setup an account on a Cloud Foundry powered PaaS Cloud. Start with http://run.pivotal.io/register and register for a new account. Use the code “cloudmunch” for a limited availability 30 day free trial.
Step 1: Configure Build Deploy Pipeline
Log into CloudMunch using your Github account credentials. You should see a list of projects in your Github account. Select and import the correct project into CloudMunch. In this example, we import dummy app called “Sample” which is a simple Java app for demo only. Successful import will show “This is a CloudMunch App” message in the browser. This example has a manually created “build.xml” script to package the code as a
CloudMunch automatically identifies that this is a Java app and adds basic validation steps into the pipeline as below.
Add an “ANT builder app” at the end of the pipeline build using the build.xml. Once configured the build pipeline is set up to continuously perform builds on updates. The updated build pipeline looks like this:
Step 2: Register a Cloud Foundry Account
CloudMunch requires secure access to your Cloud Foundry account. This is implemented using Cloud Foundry’s OAuth 2.0 protocol-based solution as basic username/password mechanism are not as secure. The registration process will direct the browser to the Cloud Foundry login screen (e.g., http://console.run.pivotal.io) to request access tokens for CloudMunch.
After registering the Cloud Foundry account, either import the running applications in Cloud Foundry to CloudMunch or create new applications in Cloud Foundry. In this example, we will import an app into CloudMunch.
At this point, CloudMunch has the details required to deploy the “Sample” project to your Cloud Foundry application instance.
Step 3: Edit Build Step for Continuous Deployment During the Build
Edit the build pipeline again to add a deployment app as a last step in the pipeline to continuously deploy into your environment.
Add “Deploy to Cloud Foundry” app as a last step of the continuous build. Configure the app to use the provider you registered, as shown below.
The new pipeline looks like this:
You should now be all set for continuous deployment!
Step 4: Check-in a Code Change. Watch Build/Deploy Pipeline in Action
Try it out. Make a change in your code and check in the update to your Github account.
Once the updated code is checked-in, the build triggers automatically. All the validation build steps are executed and the project gets deployed to Cloud Foundry.
Done! Your project now runs in a cloud-based, continuous delivery system with code changes in Github directly hitting the Cloud Foundry platform.
CloudMunch lets developers choose the development and operations tools that are best suited to the application and business needs by providing plug-and-play cloud application lifecycle management platform:
- Automation of development and operations processes – Build, Test, Deployment, Monitoring.
- Collaboration – Seamless flow of real time data and updates to enable Dev, Test and Ops to be on the same page, every time, all the time.
- Orchestration and Release Management – Automated, customizable workflows and environments between Dev-Test-Staging-Production.
- Cloud Delivery – Auto deployment and auto scaling of applications.