Put Your App Online With Trucker.io

Created by Floor Drees, @floordrees for Rails Girls Leiden

Get Trucker

Follow steps 1 through 3 of the Getting Started guide to create an account, install the command line tool and login.

To install trucker-cli (the command line tool), type:

$ gem install trucker-cli

Log in Trucker

You can create and manage applications using the Trucker control panel. However you will need to also log in using the Trucker command line client:

$ truck target https://api.ie.trucker.io
Setting target to https://api.ie.trucker.io... OK

$ truck login
email>
password>

At this point, the Trucker client will require that you choose a space to work in. Spaces are environments whose purpose is to organize your applications based on their life-cycle stage. Your Trucker account comes equipped with the following spaces:

1: development
2: production
3: staging
Space>

COACH: Talk about the benefits of deploying to Trucker.io (and having datacenters in Europe, rather than the US).

Version Control

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

git init
git add .
git commit -m "initial commit"

COACH: This would be a great time to talk about version control systems and git.

Deploy your application to Trucker

Push the application to Trucker.io

First perform a push command and enter the name you want your application to sport (we used ‘railsgirls’).

$ truck push
Name> railsgirls
Instances> 1

1: 128M
2: 256M
3: 512M
4: 1G
Memory Limit> 256M

Creating railsgirls... OK

1: railsgirls
2: none
Subdomain> railsgirls

1: ie.trucker.io
2: none
Domain> ie.trucker.io

Creating route railsgirls.ie.trucker.io... OK
Binding railsgirls.trucker.io to railsgirls... OK

Next, add MySQL as your database:

Create services for application?> y

1: rds-mysql n/a, via aws
2: redis 2.6
3: user-provided, via
What kind?> 1

Name?> rds-mysql-aa0d6

1: 100mb: Shared service, 100MB storage, 10 connections
Which plan?> 1

Creating service rds-mysql-aa0d6... OK
Binding rds-mysql-aa0d6 to trucker-rails... OK

COACH: Talk about MySQL.

We don’t want to add other services, so you can answer the following questions with n:

Create another service?> n

Bind other services to application?> n

After saving your application

Save configuration?> y

Saving to manifest.yml... OK
Uploading trucker-rails

your app will be deployed. The output in your terminal should look something like this:

Uploading railsgirls... OK
Preparing to start railsgirls... OK
-----> Downloaded app package (40K)
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.2
(...)
Checking status of app 'railsgirls'...
  1 of 1 instances running (1 running)
Push successful! App 'railsgirls' available at http://railsgirls.ie.trucker.io

Your application is now available at http://railsgirls.ie.trucker.io!