Skip to content

Commit

Permalink
refs #4
Browse files Browse the repository at this point in the history
  • Loading branch information
opensas committed Jan 30, 2012
1 parent f5c279e commit 5a6a7d1
Showing 1 changed file with 67 additions and 34 deletions.
101 changes: 67 additions & 34 deletions documentation/manual/home.textile
Expand Up @@ -18,6 +18,8 @@ h2. <a name="getting_started">Prerequisites</a>

Before being able to deploy your play application to openshift, you have to:

* "install java jdk 1.5 or 1.6":[http://www.oracle.com/technetwork/java/javase/downloads/index.html] (at the moment openshift doesn't support play apps compiled against jdk 1.7.x

* <a href="http://www.playframework.org/documentation/latest/install">install play</a>

* <a href="https://openshift.redhat.com/app/user/new/express">sign up for openshift</a>
Expand All @@ -39,77 +41,108 @@ bc. play deps

p(note). Openshift hasn't been added to playframework's module repository so far. In the meantime, you can start using it right away with a dependencies.yml file like the following:

bc.# Application dependencies

bc. # Application dependencies
require:
- play
- openshift -> openshift

- com.playdoces -> openshift 1.0

#My custom repositories
repositories:
- My local modules:
type: local
artifact: ${application.path}/../[module]

- playdoces:
type: http
artifact: "http://playdoces.appspot.com/repo/[module]-[revision].zip"
contains:
- openshift
- com.playdoces -> *

After that, deploying you play application to openshift is as easy as:

After that, deploying your play application to openshift is as easy as:

bc. play rhc:deploy -l <your_openshift_email_acount> -p <your_openshift_password>

And the module will create your app at openshift if it it's not already there, compile and package your app as a war folder, commit it in yout local git reposityr and then push it to openshift. Moreover, you can add the '-o' parameter to have the module automatically open you newly deployed app in a web browser.
And the module will create your app at openshift if it's not already there, compile and package your app as a war folder, commit it in yout local git repository and then push it to openshift. Moreover, you can add the @-o@ parameter to have the module automatically open your newly deployed app in a web browser.

h2. Configuration

Openshift module allows you to define the following command line parameters directly on the application.conf file, so that you may avoid specifying them. You can always override them from the command line.

h3. Your Red Hat login account
h3. openshift.rhlogin: your Red Hat login account

Red Hat login (RHN or OpenShift login with OpenShift Express access) account is a mandatory parameter. It's the email address you used to register at openshift. You can specify it using the '-l' or '--rhlogin' command line parameter or adding an 'openshift.rhlogin' option in you application.conf file. If none of these are specified, openshift command line tools will use you git configured email account. For more info check [Set your user name, email and GitHub token]:"http://help.github.com/set-your-user-name-email-and-github-token/".
Red Hat login (RHN or OpenShift login with OpenShift Express access) account is a mandatory parameter. It's the email address you used to register at openshift. You can specify it using the @-l@ or @--rhlogin@ command line parameter or adding an @openshift.rhlogin@ option in you application.conf file. If none of these are specified, openshift command line tools will use you git configured email account. For more info check "Set your user name, email and GitHub token":[http://help.github.com/set-your-user-name-email-and-github-token/].

h3. Your Red Hat login password
h3. openshift.password: your Red Hat login password

Red Hat login password is a mandatory parameter. You can specify it using the '-p' or '--password' command line parameter or adding an 'openshift.rhlogin' option in you application.conf file.
Red Hat login password is a mandatory parameter. You can specify it using the @-p@ or @--password@ command line parameter or adding an @openshift.password@ option in you application.conf file.

h3. Application name
h3. openshift.application.name: application name

The application name is a mandatory parameter. You can specify it using the '-a' or '--app' command line parameter or adding an 'openshift.application.name' option in you application.conf file. If none of these are specified, openshift module will read the application's file from the 'application.name' entry in your application.conf file.
The application name is a mandatory parameter. You can specify it using the @-a@ or @--app@ command line parameter or adding an @openshift.application.name@ option in you application.conf file. If none of these are specified, openshift module will read the application's file from the @application.name@ entry in your application.conf file.

h3. Application subdomain
h3. openshift.application.subdomain: application subdomain

By default your play application will be deployed to openshift according to the following scheme:

```
http://<application name>-<domain-name>.rhcloud.com
```
bc. http://<application name>-<domain-name>.rhcloud.com

You can have it deployed on a subdomain specifing it with the @-s@ or @--subdomain@ command line parameter or adding an @openshift.application.subdomain@ option in you application.conf file. In that case you'll be able to reach you application at:

You can have it deployed on a subdomain specifing it with the '-s' or '--subdomain' command line parameter or adding an 'openshift.application.subdomain' option in you application.conf file. In that case you'll be able to reach you application at:
bc. http://<application name>-<domain-name>.rhcloud.com/<application subdomain>

```
http://<application name>-<domain-name>.rhcloud.com/<application subdomain>
```
h3. openshift.timeout

h3. Timeout
You can optionally specify a timeout, in seconds, for connection, using the @--timeout@ command line parameter or adding an @openshift.timeout@ option in you application.conf file.

You can optionally specify a timeout, in seconds, for connection, using the '--timeout' command line parameter or adding an 'openshift.timeout' option in you application.conf file.
h3. openshift.debug

h3. Debug
You can tell Openshift module to print extra debug info, to help you troubleshoot and analyze any problem you encounter, using the @-d@ or @--debug@ command line parameter or adding an @openshift.debug=enabled@ option in you application.conf file.

You can tell Openshift module to print extra debug info, to help you troubleshoot and analyze any problem you encounter.
h2. Usage

You can optionally specify a timeout, in seconds, for connection, using the '--timeout' command line parameter or adding an 'openshift.timeout' option in you application.conf file.
Using openshift module is quite straightforward. First you should create an @openshift.rhlogin@ and @openshift.password@ configuration in your application.conf file, to avoid having to enter them on every command.

It's a good moment to check that you have fullfilled all the prerequisites. So issue:

bc. play rhc:chk

Timeout, in seconds, for connection
The module will then check have every needed prerequisite (jdk 1.5 or 1.6, git, ruby, ruby gems, openshift command line tools). The module will also check that the application has been created on openshift, if it's not, it will ask you to create it right away.

To deploy your application on openshift you just have to run:

bc. play rhc:deploy

p(note). List any configuration options that the module uses, with an @h3.@ heading for each one.
With this command, the module will compile and package you app as an exploded war file at @.openshift/<application name>/deployment/ROOT.war@, add this to your local git repository index, commit it, and then push the changes to openshift. If you want the module to open a web browser with your application running on openshift after deploying, just issue @play rhc:deploy -o@.

h2. Usage
To have a look at your server logs, issue:

bc. play rhc:logs

p(note). Explain how to use the module, and describe any routes, controllers, models or views that the module provides.
Finally, if you think you want to remove your application from openshift, just run:

bc. play rhc:destroy

h2. Commands

p(note). List any commands the module provides, with an @h3.@ heading for each one. Include the commands’ options.
h3. rhc:chk

Check openshift prerequisites, application and git repo.

h3. rhc:info

Displays information about user and configured applications.

h3. rhc:open

Opens the application deployed on openshift in web browser.

h3. rhc:deploy

Deploys application on openshift.

h3. rhc:destroy

Destroys application on openshift.

h3. rhc:logs

Show the logs of the application on openshift.

0 comments on commit 5a6a7d1

Please sign in to comment.