How deploy Play! Framework Apps with different configurations to Cloudbees

Posted by Brian Porter on April 08, 2013

cloudbees-playHave you ever wanted to deploy the same Application with multiple configurations to Cloudbees, without changing your environment variables each time while using the command line?

I spent a ton of time trying to figure it out, and it ended up being a punctuation problem.

So basically, this is it:

However, if you want to script it, like I did, you want to be able to start the deployment process from the shell as well.

The documentation said:

cloudbees-deploy-config<br /> Deploy a configuration of your app to a Run@Cloud app id. Arguments are:<br /> (1) the base name of a conf file in your project's conf directory, defaulting to "application"/<br /> (2) Optional. The application id to which this configuration should deploy. You can omit this<br /> arg if you have either set cloudbees.applicationId in the config file from the first<br /> arg or have set the project ID in your PlayProject.<br /> Example usage: `> cloudbees-deploy-config live`, where live.conf exists in the project's conf/<br /> directory and contains a key cloudbees.applicationId.<br />

So I tried: play cloudbees-deploy-config xxxxx

That did not work – I got an error like this:

[success] Total time: 110 s, completed Mar 15, 2013 9:08:36 PM<br /> [error] Not a valid command: xxxxx (similar: run)<br /> [error] Expected '/'<br /> [error] Expected ':'<br /> [error] Not a valid key: xxxxx (similar: run)<br /> [error] xxxxx

Thanks to help on stackoverflow, I discovered that it was just missing quotes!

play "cloudbees-deploy-config xxxxx"

Here is the link to the Stackoverflow thread if you want more details:  http://stackoverflow.com/questions/15441628/how-can-i-specify-which-application-conf-to-user-when-deploying-on-cloudbees