Deploy Java Application To Cloud Foundry In Less Than An Hour

Introduction:

This article talks about setting up PCF on your Local Workstation with PCF Dev and deploy a Java application.

Time : 45 mins

Prerequisites

• Virtual Box 5.0 or higher
• Java JDK 7 or higher
• 4GB Memory
• 10GB Space
• Create account on PCF

Install The CLI

Download and Install Cloud Foundry Command Line Interface (cf cli):

MAC OSX
https://packages.cloudfoundry.org/stable?release=macosx64-binary&source=github

Windows
https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github

Linux
https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github

Install The PCF Dev

Download the latest version of PCF Dev, navigate to https://network.pivotal.io/products/pcfdev

Here I have used v0.28.0 for PCF 1.11.0

Unzip the downloaded zip file

Install the PCF Dev Plugin

Start PCF Dev

This Process takes somewhere from 10-20 mins depending on the workstation.

Deploy Java Application

Now that you have PCF Dev Virtual Machine running on your workstation, next step is to deploy the sample Java application.

GIT Clone

$ git clone https://github.com/cloudfoundry-samples/spring-music

$ cd spring-music

Login to PCF Dev

Use Gradle to Assemble the app locally

$ ./gradle assemble

Push the App

$ cf push –hostname spring-music

While App gets deployed you would see the route which would be used to access the app from your local browser.

requested state: started
instances: 1/1
usage: 512M x 1 instances
routes: spring-music.local.pcfdev.io

To View Logs

$ cf logs spring-music –recent

To Check Running App Details

原文链接:Deploy Java Application To Cloud Foundry In Less Than An Hour

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容