View Source

h1. Table of Contents

{toc:printable=false}
----
h1. Introduction

This tutorial covers deploying an ICEfaces application to Micro Cloud Foundry and Cloud Foundry. Cloud Foundry is described by VMware, Inc. as:
{panel}_"Cloud Foundry is an open platform as a service, providing a choice of clouds, developer frameworks and application services. Initiated by VMware, with broad industry support, Cloud Foundry makes it faster and easier to build, test, deploy and scale applications. It is an open source project and is available through a variety of private cloud distributions and public cloud instances, including CloudFoundry.com."_{panel}Optionally, the developer can utilize Micro Cloud Foundry as well, which is described by VMware, Inc. as:
{panel}
_"Micro Cloud Foundry provides the VMware open platform as a service in a standalone environment running in a virtual machine. It is a self-contained local development environment as similar as possible to the Cloud Foundry cloud, making application development for the cloud and the transition from development to production much more seamless."_{panel}
----
h1. Legend

|| Terms || Description ||
| {{\[micro-cloud-foundry-home\]}} | This is the user defined home directory in which the Micro Cloud Foundry VM is (to be) unpacked. |
| {{\[icefaces-application-home\]}} | This is the user defined home directory in which the ICEfaces application is (to be) unpacked. |

----
h1. Requirements

This tutorial assumes the following requirements are met before continuing:

* Cloud Foundry account
* VMware Player
* Ruby ([VMC|#VMC] only)
* RubyGems ([VMC|#VMC] only)
* Eclipse ([Cloud Foundry Extension|#Cloud_Foundry_Extension] only)

{note:title=Note}Other VMware products can be used instead, like VMware Workstation or others, but this tutorial focuses on VMware Player.{note}
----
h1. Cloud Foundry

h2. Creating a Domain

Using an Internet browser, in order create a domain follow these steps:

* Log into [https://my.cloudfoundry.com/micro] using your credentials.
* Enter the desired _Domain Name_ and click on the _Create_ button.
* Save the _configuration token_ for later use.
* Click on the _Download Micro Cloud Foundry VM_ button.
* Select the desired location for _"micro-1.x.x.zip"_ and download the VM.

h2. Configuring the Micro Cloud Foundry VM

In order to configure the Mirco Cloud Foundry VM follow these steps:

* Unpack the _"micro-1.x.x.zip"_ into the {{\[micro-cloud-foundry-home\]}} directory.
* Using VMware Player:
** Navigate to _File_ \-> _Open a Virtual Machine..._.
** Navigate to the {{\[micro-cloud-foundry-home\]}} directory, select the _"micro.vmx"_ file and click on the _Open_ button.
** Select the _Micro Cloud Foundry v1.x.x_ virtual machine and click on the _Play virtual machine_ link.
** Enter _"1"_ to configure and press \[Enter\] to continue.
** Enter the desired _Password_ and press \[Enter\] to continue.
** Enter the desired Password again as the _Confirmation_ and press \[Enter\] to continue.
** Enter the desired _network_ (e.g. _"1"_ for DHCP) and press \[Enter\] to continue.
** Enter the desired _HTTP proxy_ and press \[Enter\] to continue.
** Enter the \_confirmation token (as saved earlier) and press \[Enter\] to continue.
** Press \[Enter\] to continue.
** Confirm that the status of _Identity_ and _Services_ is _ok_ and that the status of _IP Address_ is _network up_.

h2. Deployment and Management

In order to deploy and manage ICEfaces applications VMware provides two Cloud Foundry tools:

* [VMC|#VMC] (Command-line interface)
* [Cloud Foundry Extension|#Cloud_Foundry_Extension] to SpringSource Tool Suite (STS) or Eclipse (Graphical IDE)

Installing one or both is a requirement in order to deploy and manage ICEfaces applications using Cloud Foundry.

h3. VMC (Command-Line Interface) {anchor:VMC}

At the time this tutorial was written the requirements for installing VMC are:

* Ruby (1.8.7 or 1.9.2)
* RubyGems

The installation of Ruby and RubyGems is beyond the scope of this tutorial.

h4. Installing VMC

Once the requirements are met the installation of VMC is simple. Using a command prompt or console, in order to install VMC use the following single-line command:

{code}
gem install vmc
{code}
h4. Deployment using VMC

This section covers the deployment of an ICEfaces application to the Micro Cloud Foundry and the Cloud Foundry. The Micro Cloud Foundry can be used as a staging process during development before deploying to the public Cloud Foundry.

h5. Micro Cloud Foundry

h6. Configuring VMC for Micro Cloud Foundry

* Target the Micro Cloud Foundry using the following single-line command where the {{\{mycloud\}}} placeholder needs to be replaced with the desired cloud name (e.g. _"icesoft"_):
{code}
vmc target api.\{mycloud\}.cloudfoundry.me{code}
* Create a new account using the following single-line command:
{code}
vmc register{code}
* Enter the desired _Email_ and press \[Enter\] to continue.
* Enter the desired _Password_ and press \[Enter\] to continue.
* Enter the desired Password again as the _Verify Password_ and press \[Enter\] to continue.

h6. Deploying an ICEfaces Application to Micro Cloud Foundry

In order to deploy an ICEfaces application using a command prompt or console follow these steps:

* Navigate to the {{\[icefaces-application-home\]}} directory.
* Deploy an ICEfaces application using the following single-line command:
{code}
vmc push{code}
* Enter _"Y"_ to the _"Would you like to deploy from the current directory? \[Yn\]"_ question and press \[Enter\] to continue.
* Enter the desired _Application Name_ (e.g. _"showcase"_) and press \[Enter\] to continue.
* Enter _"Y"_ to the _"Detected a Java Web Application, is this correct? \[Yn\]"_ question and press \[Enter\] to continue.
* Enter the desired _Application Deployed URL_ (e.g. _"showcase.icesoft.cloudfoundry.me"_) and press \[Enter\] to continue.
* Enter the desired _Memory reservation_ (e.g. _"512M"_) and press \[Enter\] to continue.
* Enter the desired number of _instances_ (e.g. _"1"_) and press \[Enter\] to continue.
* Enter _"N"_ to the _"Create services to bind to '\[application-name\]'? \[yN\]"_ question and press \[Enter\] to continue.
* Enter _"N"_ to the _"Would you like to save this configuration? \[yN\]"_ question and press \[Enter\] to continue.
* Confirm the ICEfaces application is running correctly by going to [http://\[application-name\].\[hostname\].cloudfoundry.me/] (e.g. [http://showcase.icesoft.cloudfoundry.me/|http://showcase.icesoft.cloudfoundry.me/]).

h5. Cloud Foundry

h6. Configuring VMC for Cloud Foundry

* Target the Cloud Foundry using the following single-line command:
{code}
vmc target api.cloudfoundry.com{code}
* Log into Cloud Foundry using the following single-line command:
{code}
vmc login{code}
* Enter your _Email_ and press \[Enter\] to continue.
* Enter your _Password_ and press \[Enter\] to continue.

h6. Deploying an ICEfaces Application to Cloud Foundry

In order to deploy an ICEfaces application using a command prompt or console follow these steps:

* Navigate to the {{\[icefaces-application-home\]}} directory.
* Deploy an ICEfaces application using the following single-line command:
{code}
vmc push{code}
* Enter _"Y"_ to the _"Would you like to deploy from the current directory? \[Yn\]"_ question and press \[Enter\] to continue.
* Enter the desired _Application Name_ (e.g. _"showcase"_) and press \[Enter\] to continue.
* Enter _"Y"_ to the _"Detected a Java Web Application, is this correct? \[Yn\]"_ question and press \[Enter\] to continue.
* Enter the desired _Application Deployed URL_ (e.g. _"showcase.cloudfoundry.com"_) and press \[Enter\] to continue.
* Enter the desired _Memory reservation_ (e.g. _"512M"_) and press \[Enter\] to continue.
* Enter the desired number of _instances_ (e.g. _"1"_) and press \[Enter\] to continue.
* Enter _"N"_ to the _"Create services to bind to '\[application-name\]'? \[yN\]"_ question and press \[Enter\] to continue.
* Enter _"N"_ to the _"Would you like to save this configuration? \[yN\]"_ question and press \[Enter\] to continue.
* Confirm the ICEfaces application is running correctly by going to [http://\[application-name\].cloudfoundry.com/] (e.g. [http://showcase.cloudfoundry.com/|http://showcase.icesoft.cloudfoundry.me/]).

h3. Cloud Foundry Extension to Eclipse (Graphical IDE) {anchor:Cloud_Foundry_Extension}

At the time this tutorial was written the requirements for installing Cloud Foundry Integration are:

* Eclipse

The installation of Eclipse is beyond the scope of this tutorial.

h4. Installing Cloud Foundry Integration

* Using the menu bar at the top, navigate to _Help_ \-> _Eclipse Marketplace..._.
* Using the _Eclipse Marketplace_ pop-up window:
** Enter _"Cloud Foundry"_ as the _Find_ and click on the _Go_ button.
** Click on the _Install_ button of the _Cloud Foundry Integration for Eclipse_.
** Confirm the selected features and click on the _Next_ button.
** Select the _I accept the terms of the license agreements_ radio button and click on the _Finish_ button.
* Using the _Software Updates_ pop-up window, click on the _Restart Now_ button.

h4. Deployment using Eclipse

This section covers the deployment of an ICEfaces application to the Micro Cloud Foundry and the Cloud Foundry. The Micro Cloud Foundry can be used as a staging process during development before deploying to the public Cloud Foundry.

h5. Micro Cloud Foundry

h6. Configuring Eclipse for Micro Cloud Foundry

In order to configure Eclipse for Micro Cloud Foundry follow these steps:

* Using the menu bar at the top, navigate to _Window_ \-> _Show View_ \-> Servers.
* Using the _Servers_ tab at the bottom, right click and navigate to _New_ \-> _Server_.
* Using the _New Server_ pop-up window:
** Select _VMware_ \-> _Cloud Foundry_ as the _server type_, leave the _Server's host name_ as _"localhost"_, enter the desired _Server name_ (e.g. _"ICEsoft Micro Cloud Foundry"_), and click on the _Next_ button.
** Enter your _Email_, enter your _Password_, select _Microcloud -_ _\[http://api.\]_{_}{mycloud\}.cloudfoundry.me_ as the _URL_,
*** Using the _Create Microcloud Target_ pop-up window, enter the desired _\{mycloud\}_ replacement (e.g. _"icesoft"_), enter the desired _name_ (e.g. _"Microcloud (icesoft)"_), and click on the _OK_ button.
** Click on the _Validate Account_ button, verify the message at the top displays _Account information is valid._, and click on the _Next_ button.
** Click on the _Finish_ button.

h6. Deploying an ICEfaces Application to Micro Cloud Foundry

In order to deploy an ICEfaces application to Micro Cloud Foundry follow these steps:

* Using the menu bar at the top, navigate to _Window_ \-> _Show View_ \-> Servers.
* Drag an ICEfaces application from the _Project Explorer_ panel on the left to the desired Micro Cloud Foundry (e.g. _"ICEsoft Micro Cloud Foundry"_) on the _Servers_ tab at the bottom.
* Using the _Application_ pop-up window:
** Enter the desired _Name_ (e.g. _"showcase"_), select _Java Web_ as the _Application Type_, and click on the _Next_ button.
** Enter the desired _Deployed URL_ (e.g. _"showcase.icesoft.cloudfoundry.me"_), select the desired _Memory Reservation_ (e.g. _512M (Default)_), and click on the _Next_ button.
** Click on the _Finish_ button.

h5. Cloud Foundry

h6. Configuring Eclipse for Cloud Foundry

In order to configure Eclipse for Cloud Foundry follow these steps:

* Using the menu bar at the top, navigate to _Window_ \-> _Show View_ \-> Servers.
* Using the _Servers_ tab at the bottom, right click and navigate to _New_ \-> _Server_.
* Using the _New Server_ pop-up window:
** Select _VMware_ \-> _Cloud Foundry_ as the _server type_, leave the _Server's host name_ as _"localhost"_, enter the desired _Server name_ (e.g. _"VMware Cloud Foundry"_), and click on the _Next_ button.
** Enter your _Email_, enter your _Password_, select _VMware Cloud Foundry -_ _[https://api.cloudfoundry.com\_|https://api.cloudfoundry.com_]_ _as the \_URL_, click on the _Validate Account_ button, verify the message at the top displays _Account information is valid._, and click on the _Next_ button.
** Click on the _Finish_ button.

h6. Deploying an ICEfaces Application to Cloud Foundry

In order to deploy an ICEfaces application to Cloud Foundry follow these steps:

* Using the menu bar at the top, navigate to _Window_ \-> _Show View_ \-> Servers.
* Drag an ICEfaces application from the _Project Explorer_ panel on the left to the desired Cloud Foundry (e.g. _"VMware Cloud Foundry"_) on the _Servers_ tab at the bottom.
* Using the _Application_ pop-up window:
** Enter the desired _Name_ (e.g. _"showcase"_), select _Java Web_ as the _Application Type_, and click on the _Next_ button.
** Enter the desired _Deployed URL_ (e.g. _"showcase.cloudfoundry.com"_), select the desired _Memory Reservation_ (e.g. _512M (Default)_), and click on the _Next_ button.
** Click on the _Finish_ button.

----
h1. External Links

* Cloud Foundry \[[link|http://cloudfoundry.com/|Cloud Foundry]\]
* Micro Cloud Foundry \[[link|https://my.cloudfoundry.com/micro|Micro Cloud Foundry]\]
* VMware Player \[[link|http://www.vmware.com/products/player|VMware Player]\]