Put your app online with anynines

Created by Floor Drees, @floordrees

COACH: Talk about the benefits of deploying to anynines vs utilising US data centers.

Get yourself some anynines

  1. Create an anynines account.

  2. Download and install the Command Line Interface to interact with anynines.

  3. Now select the anynines api endpoint as target and authenticate using your user credentials:

cf api https://api.de.a9s.eu  
cf login -u [your@email] -p [yourpassword]

Or if that doesn’t work for you, use:

cf login

… which will prompt you for your email address and password.

Wonder what that cf stands for? It’s short for Cloud Foundry, a system anynines is using behind the scenes.

Push your app online

Let’s push this source code from your local machine to anynines:

$> cf push [application-name-of-your-choosing]

This will fail miserably since the example application needs a MySQL database to start. So, lets create one! The command below will create a MySQl service with a free service plan. After the plan name you have to specify a name for the service instance. This name will be used for further commands to refer to this service instance:

$> cf create-service mysql Pluto-free [service-name-you-can-choose]

(Really, you can use any name. Make it count!)

Next, binding the MySQL service instance to the application, to grant the application access to the MySQL instance, type:

$> cf bind-service [app-name-you-have-chosen-above] [service-name-you-have-chosen-above]

Finally we have to restart the application to make sure the service binding takes effect:

$> cf restart [app-name-you-have-chosen-above]

You will see this:

Creating service postgresql-d2197... OK  
Binding postgresql-d2197 to railsgirls... OK

Ending with… Push successful! App 'railsgirls' available at railsgirls.de.a9sapp.eu. Score!

Version Control

We need to add our new code to version control. You can do this by running the following in the terminal:

git status
git add .
git commit -m "add anynines deployment"

COACH: This would be a great time to talk about version control systems and git, if you haven’t already.

Help

You can check all available cf sub-commands by typing cf help. In case your terminal does not have all the answers, the anynines team probably does. Just shoot them a mail at support@anynines.com.

Happy deploying!