Deploying HTML5 Applications To Openshift

This guide will show you how to deploy HTML5 Applications to Openshift.

 

Prerequisites

 

Creating the Sample Project

 

Fullscreen-2.jpg
Fullscreen-3.jpg
Choose the jboss-html5-mobile-archetype under aerogear Group Id
Fullscreen-4.jpg

Now, fill in the info for your project. We'll use myapp on this tutorial.

Fullscreen-5.jpg
You should see your project structure here.
Fullscreen-6.jpg

Openshit Setup

JBoss - JBoss Central - JBoss Developer Studio - _Users_qmx_workspace-jbdev3.jpg

 

 

 

Echofon Lite.jpg

 

 

 

JBoss - https___openshift.redhat.com_app_user_new_express - JBoss Developer Studio - _Users_qmx_workspace-jbdev3-2.jpg

 

An Email containing a validation link should arrive at your mailbox.

 

Inbox (423 messages, 12 unread)-1.jpg

 

You should accept the Openshift Terms and Conditions.

 

 

JBoss - https___openshift.redhat.com_app_user_new_express - JBoss Developer Studio - _Users_qmx_workspace-jbdev3-1-1.jpg

 

Voilà - your account should be ready.

 

 

We'll create a namespace for our apps (deploydemo on this tutorial) - When asked for a passphrase, just hit enter.

 

qmx@gondor ~ » rhc-create-domain -n deploydemo -l <your openshift account email> -a
WARNING: Unable to find '/Users/qmx/.ssh/libra_id_rsa.pub'
Your SSH keys are created either by running ssh-keygen (password optional)
or by having the rhc-create-domain command do it for you.  If you created
them on your own (or want to use an existing keypair), be sure to paste
your public key into the express console at http://www.openshift.com.
The client tools use the value of 'ssh_key_file' in express.conf to find
your key followed by the defaults of libra_id_rsa[.pub] and then
id_rsa[.pub].
Password: 
Generating OpenShift Express ssh key to /Users/qmx/.ssh/libra_id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/qmx/.ssh/libra_id_rsa.
Your public key has been saved in /Users/qmx/.ssh/libra_id_rsa.pub.
The key fingerprint is:
29:3e:82:37:b7:e3:c8:a7:eb:77:3f:13:e3:f2:81:71 qmx@gondor.local
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|         .       |
|      . S E      |
|   . . . +o      |
|  . + + ...o     |
|   o =+oo +.     |
|   .**oo +oo     |
+-----------------+
Checking ~/.ssh/config
Found rhcloud.com in ~/.ssh/config... No need to adjust
Alteration successful.

 

 

Now let's create the application at Openshift.

 

Fullscreen-7.jpg

 

Fullscreen-8.jpg

 

You need to uncheck the "Create New Project" checkbox...

 

Fullscreen-10.jpg

... and select our "myapp" project.

Fullscreen-11.jpg

 

Click "Finish"

 

Openshift comes with some configurations, which need to be merged on our project.

 

Fullscreen-12.jpg

 

After this you can visit http://myapp-deploydemo.rhcloud.com (or http://<yourapp>-<domain>.rhcloud.com, if you used different settings)

 

As shown on the screenshot below, the default openshift application landing page is deployed.

 

Fullscreen-23.jpg

 

We need to publish our application to Openshift to trigger a new deployment. OpenShift is convenientely represented by a WTP Server entry.

 

Fullscreen.jpg

 

Fullscreen-9.jpg

 

Fullscreen-14.jpg

 

There we go! Our shiny new mobile webapp is successfully deployed!

 

Fullscreen-25.jpg