Over a million developers have joined DZone.

Play2 Deploy and Config on Cloudbees

· Cloud Zone

Download the Essential Cloud Buyer’s Guide to learn important factors to consider before selecting a provider as well as buying criteria to help you make the best decision for your infrastructure needs, brought to you in partnership with Internap.

I did some work recently to update a few web apps from play 1.2.3 to play 2. Some of them are running on heroku and others are on cloudbees.
One of the things I like about heroku is the Procfile that allows you to overwrite the play application.conf properties. But hold on, you can do the same on cloudbees!

Install the bees sdk and try running the following command:

bees config:list /[appname]

you should see a list of all the configuration options for your application. Now, lets tweak them a little.
Let's set the runtime db info :

bees config:set -a myaccount/myapp db.default.driver=com.mysql.jdbc.Driver \
db.default.user=mydbuser \
db.default.password=mydbuserpass \

Now you can leave your local machine settings in the application.conf file and still pick up the right db at runtime when deployed on cloudbees, isn't that great?

Another thing you might want to change is the smtp settings for your production environment... not problem
bees config:set -a myaccount/myapp smtp.mock=false

This will tell your play2 app to use the other smtp configuration (host, user/pass)
Also if you want to change some of the runtime options (like the java version) use the -R prefix

bees config:set -a myaccount/myapp -Rjava_version=1.7

Now combine that with the [a href="http://wiki.cloudbees.com/bin/view/RUN/Playframework#HDeployingaPlay2application"]play2 sbt plugin for deploying your app and you have a complete suite of tools to get you going!

The Cloud Zone is brought to you in partnership with Internap. Read Bare-Metal Cloud 101 to learn about bare-metal cloud and how it has emerged as a way to complement virtualized services.


Published at DZone with permission of Andrew Salvadore. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}