This blog references DevOps Services at hub.jazz.net, which has been deprecated. To get the latest tools for agile projects, use IBM Bluemix Continuous Delivery.
Do you have sample applications built for IBM Bluemix that you want to share with others? It’s now a whole lot easier, with the introduction of the new Deploy to Bluemix button. This button can be embedded in any readme, blog, article, webpage, etc., and link to a publicly visible Git repository (e.g. from Bluemix DevOps Services, GitHub or elsewhere). It makes your readers immediately productive by providing a single action that deploys a copy of your application in their own Bluemix account. Whereas in the past, you had to explain step-by-step to users how to clone a Git repo, set up build tools, and provide the Cloud Foundry script to push it to Bluemix, the Deploy to Bluemix button now makes that a seamless, automated experience.
|Here is a sample button you can try out, which demonstrates an application that requires compilation from Java source, and a Bluemix service (Cloudant) to be created.|
All you need to do to create the button is to insert a snippet of HTML or markdown to your web page, readme, blog, or article. Here is the raw HTML snippet for the button above:
<a href="https://bluemix.net/deploy?repository=https://hub.jazz.net/git/idsorg/sample-java-cloudant" target="_blank"><img src="http://bluemix.net/deploy/button.png" alt="Bluemix button" /></a>
or the markdown version:
[![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://hub.jazz.net/git/idsorg/sample-java-cloudant)
Let’s try it out! When you press the button, a page loads showing the sample application to be deployed and the source repository. Just sign up if necessary and log in with Bluemix to proceed.
Once you’ve logged in, selecting Deploy will automatically generate your own running instance of the application and backing service, as well as set you up with a dedicated Git repo in a private project at Bluemix DevOps Services.
After the application is deployed, you can view your running application or edit it further using our Web IDE or any combination of editors and Git command tools. Each time you deliver changes to this Git repo, the delivery pipeline will automatically kick off and update your deployed app with the latest changes. You can learn more about all the features provided by IBM Bluemix DevOps Services here.
This sample works because the code repository contains two interesting files:
- An Ant build.xml file, at the root, which causes compilation and packaging of the Java code. Compilation, packaging and actual deploying are powered by the delivery pipeline of your dedicated project, which supports many builder types, including Ant, Grunt, Gradle, Maven, npm, Shell Script, etc. If your application doesn’t need a compilation step, you don’t need a build file for your button to work. For example, many Node.js apps don’t require a compilation step and, therefore, don’t need a build file.
- A manifest.yml file at the root, which we augmented to trigger the backing service creation:
declared-services: sample-java-cloudant-cloudantNoSQLDB: label: cloudantNoSQLDB plan: Shared
For more information, please check out the Deploy to Bluemix button documentation.
Philippe Mulet and Ritchie Schacher
Architects – IBM Bluemix DevOps Services