The goal of this WOD is to learn how to deploy a MySQL-backed Play application to CloudBees.
Before starting this WOD, you should have finished the prior WOD and have a Digits application that uses MySQL as its back-end. This version should be committed to the master branch.
You should also have a local copy of play-example-mysql in Eclipse for reference, and have successfully deployed that application to your CloudBees account. This WOD simply repeats those steps for your Digits application.
Instructions
Here are the steps to follow for this WOD. For more detailed information, see the instructions for CloudBees deployment for the play-example-mysql project.
Start your timer.
Create branch cloudbees-1. Create a branch off your master called “cloudbees-1″ to hold all of the work associated with this WOD. If this is not the first time you’re doing the WOD, increment the number as necessary.
Create an application stack on CloudBees. Use the ClickStart facility to set up an application called digits on CloudBees. ClickStart sets up the database as well as application container automatically. (Note: if the ClickStart process fails, don’t just restart it immediately. Instead, check the Apps, DBs, Builds, Repositories links and delete any “digits” found before retrying.)
Manually create the digits database tables. Using the 1.sql file as a guide, manually create the tables required for your application.
Disable database evolutions. Copy over the application.cloudbees.conf file from play-example-mysql, then use the bees config:set command to tell CloudBees to use that file rather than application.conf. This file disables database evolutions.
Define your administrator credentials. Your Digits application requires two admin environment variables. Use the bees config:set command to provide CloudBees with the admin credentials. If you’ve forgotten how to do this, see the DigitsCloudAuthentication practice WOD.
Deploy your application. Now create a distribution of your digits application, and deploy it to CloudBees.
Check to see that it is successfully deployed. Go to your CloudBees URL and make sure you can login and that the application works correctly.
Commit your changes. When you have it working, commit your changes. Use “Finished WOD.” as the commit message.
When finished, stop your timer, and record how many minutes it took you to complete the WOD.
Rx: < 28 minAv: 28-38 minSd: 38-50 minDNF: 50+ min
Demonstration
Once you’ve finished doing the WOD a single time, watch me do it:
Standard WOD Caveats
You’ll learn significantly less from watching me solve the
WOD if you haven’t attempted the WOD yourself first.
While it’s an achievement to finish the WOD no matter how long it takes, you
might experience “diminishing returns” if you work longer than the DNF
time. Thus, it might be strategic to stop working at the DNF time and watch
my solution.
After watching my solution, I recommend that you repeat the WOD if you
have not achieved at least Av performance. If so, be sure to:
Delete your old project so you cannot refer to it;
Don’t look at my screencast while you WOD; and
Reset your timer.
Feel free to keep trying until you make Rx if that’s of interest to you.