DevOps

Share your code with the new Deploy to Bluemix button

Share this post:

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 such as from Git Repos and Issue Tracking, GitHub or elsewhere (tip: you can also choose a specific Git repository branch). 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:

Deploy to Bluemix

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:

[code]<a href="https://bluemix.net/deploy?repository=https://git.ng.bluemix.net/idsorg/sample-java-cloudant"
target="_blank"><img src="http://bluemix.net/deploy/button.png" alt="Bluemix button"/></a>
[/code]

or the markdown version:

[code][![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://git.ng.bluemix.net/idsorg/sample-java-cloudant)[/code]

Let’s try it out! When you press the button, a page loads showing the sample application name to be deployed. Just sign up if necessary and log in with Bluemix to proceed.

Once you’ve logged in, you can select a region, organization, space, and edit the app name in the Delivery Pipeline section. The suggested app name is constructed from the name of your original Git repo and the time.

Clicking Deploy will automatically generate your own running instance of the application and backing service, as well as create a toolchain. The toolchain includes a new private clone of your Git repo, a pipeline for building and deploying code changes, the Eclipse Orion Web IDE for editing code on the Cloud, and an issue tracker.

Click the Delivery Pipeline card to see the status of the deployment of your app.

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 Continuous Delivery 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.
  • manifest.yml file at the root, which we augmented to trigger the backing service creation:

    [code]declared-services:
    sample-java-cloudant-cloudantNoSQLDB:
    label: cloudantNoSQLDB
    plan: Lite[/code]

You can find all eligible Bluemix services, labels and plans by running a cf marketplace command (using CF Command Line Interface) or browsing the Bluemix catalog.

For more information, please check out the Deploy to Bluemix button documentation.

More DevOps stories
October 19, 2018

Part 1: Build Messaging Solutions with Apache Kafka or Event Streams for IBM Cloud

As part of the iterative approach described in the main introduction blog of this series, the first step is to building messaging solutions is to identify the use case requirements and quantify these requirements as much as possible in terms of Apache Kafka and Event Streams.

Continue reading

October 18, 2018

Mount iSCSI Block Storage on VMware ESXi 6.5U2

It seems like pretty much everyone is using VMware ESXi virtualization nowadays. In this article, I'll cover how to mount IBM Cloud Block Storages onto this popular hypervisor using the iSCSI protocol.

Continue reading

October 18, 2018

Journey to Cloud – Moving On-Premise Mobile Foundation Apps to IBM Cloud

IBM MobileFirst Platform Foundation powers many on-premise customers in more than 50 countries, delivering the best-of-the-best apps and serving a large number of users. IBM Cloud Mobile Foundation Service offers all the same capabilities available in on-premise MobileFirst Foundation, with the additional benefits of fully managed service with instant deployment and scale-out option.

Continue reading