Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

The Spring Boot Dashboard is a function of the Spring Tool Suite which allows us to manage all applications that use Spring Boot in our workspace. Using the Spring Boot Dashboard, in addition to starting and stopping one or more Spring Boot applications, it also allows us to deploy Spring Boot applications to a particular Cloud Foundry Provider. In this tutorial, I will show you how to deploy the Spring Boot application to Cloud Foundry using the Spring Boot Dashboard in Spring Tool Suite (STS)!

The Cloud Foundry Provider which I will use, it is Pivotal Cloud Foundry.

First, let’s open the Spring Boot Dashboard in the STS.

To do this, you can click the Boot Dashboard button on the STS toolbar.

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

Or go to Window → Show View → Other → Spring → Boot Dashboard.

Then, the Boot Dashboard interface will appear as follows:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

As you can see, we have an item called “local” in the Spring Boot Dashboard. This item is a group of all applications that use Spring Boot in the current workspace of the STS. In my current workspace, I have a project that uses Spring Boot:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

Therefore, if you expand this “local” item, you will see the following:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

OK, now we’re going to go into the main topic.



Now, click on the Cloud Foundry configuration button in the Spring Boot Dashboard. A window that allows us to add a new Cloud Foundry Target will appear.

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

In this window, we will enter information about the Cloud Foundry Provider, here I am using Pivotal Cloud Foundry, including:

  • Email
  • Password
  • Cloud Foundry Space.

In this example, I would fill as follows:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

Click the Finish button to finish.

At this point, you will see the Spring Boot Dashboard as follows:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

Now, we will try to deploy spring-boot-example in my STS workspace to Pivotal Cloud Foundry.

To do this, drag the spring-boot-example in the “local” item and drop it into the Cloud Foundry item, here’s “Huong Dan Java: development”.

The following window will appear:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

This is the window containing the configuration that will be used to deploy an application to Cloud Foundry. Here, we have configured the application name, memory and URL to run after being deployed. Remember that the URL must be unique on the Cloud Foundry Provider’s system.

I will revise the URL configuration a bit like this:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

Click OK to finish.

At this point, our application will automatically be deployed into Cloud Foundry. You will see the console log as follows:

At this point, you will see the Spring Boot Dashboard window as follows:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

You can examine the results by right-clicking on the item “spring-boot-example [spring-boot-example]” and selecting your Open Web Browser:

Deploy Spring Boot application to Cloud Foundry using Spring Boot Dashboard in Spring Tool Suite

 

Add Comment