README.textile
April 10, 2012 ยท View on GitHub
h1. Usage
This module helps you deploy your Play! application to "dotcloud":http://dotcloud.com.
h2. Installation
First, install the module from the Play! module repository like so:
bc. play install dotcloud
h2. Prepare your Play! application
Tell Play! that you want your application to use the dotcloud module by adding it to your @conf/dependencies.yml@ file. It might look like this:
bc. require: - play - play -> dotcloud 0.3
Now run @play dependencies@ to install the module into your application. Then, create a @dotcloud.yml@ file in your application's @conf@ directory. The file might look like this:
bc. www: type: java db: type: mysql
For more information, consult the dotcloud documentation.
h2. Push to dotcloud
To push to dotcloud, a deployment name is required. Either give it at the command line (@--deployment myapp@) or add it to your application.conf (@dotcloud.deployment=myapp@). From the Play! application's root directory, you may then issue
@play dotcloud:deploy@
to push the current version of your application to dotcloud.
By default, application will be pushed using @prod@ id. If you want to deploy using a different id, please specify it in your conf/application.conf (@dotcloud.id=your_id@).
h2. Specify a MySQL database
If you want to use a MySQL database also running on dotcloud, this is the format you need to use for specifying the database connection in your @application.conf@ file:
bc. %prod.db=mysql %prod.db.url=jdbc:mysql://(subdomainOfDatabaseService).dotcloud.com:(port)/(databaseName) %prod.db.driver=com.mysql.jdbc.Driver %prod.db.user=(username) %prod.db.pass=(password)
h1. Requirements
You need to have the dotcloud command line client installed. I only tested this module on Mac OS X -- it should work on all platforms supported by Play!, however.
This module only works for applications that contain a single Java service. If your application uses multiple Java services, you need to use the dotcloud CLI. For example, you might have a "frontend" Play! application and a "backend" Play! application on the same dotcloud application, each deployed as its own Java service -- these setups are not supported by this module. A single Java service paired with something else like a database service works fine, however.
For more information, consult the documentation in "this module's GitHub repository":https://github.com/lsinger/play-dotcloud.
h1. History
0.1: Initial release during dotcloud beta phase.
0.2: Support for new CLI (0.4.x) after dotcloud beta phase.
0.3: Now properly uses the id specified in application.conf, thanks to Burn0ut07!