Client usage

After installing the server, build the cmd/main.go file with the name you wish, and add it to your $PATH. Here we’ll call it tsuru. Then you must set the target with your server url, like:

Setting a target

$ tsuru target-add default
$ tsuru target-set default


After that, all you need is to create a user and authenticate to start creating apps and pushing code to them. Use create-user and login:

$ tsuru user-create
$ tsuru login


Associating your user to a team

You need to be member of a team to create an app. To create a new team, use create-team:

$ tsuru team-create teamname

Creating an app

To create an app, use app-create:

$ tsuru app-create myblog <platform>

This will return your app’s remote url, you should add it to your git repository:

$ git remote add tsuru

Listing your apps

When your app is ready, you can push to it. To check whether it is ready or not, you can use app-list:

$ tsuru app-list

This will return something like:

| Application | Units State Summary     | Ip                                        |
| myblog      | 1 of 1 units in-service | |

Showing app info

You can also use the app-info command to view information of an app. Including the status of the app:

$ tsuru app-info

This will return something like:

Application: myblog
Platform: gunicorn
Teams: team1, team2
| Unit     | State   |
| myblog/0 | started |
| myblog/1 | started |

Tsuru uses information from git configuration to guess the name of the app, for more details, see “Guessing app names” section of tsuru command documentation.

Public Keys

You can try to push now, but you’ll get a permission error, because you haven’t pushed your key yet.

$ tsuru key-add

This will search for a file in ~/.ssh/, if you don’t have a generated key yet, you should generate one before running this command.

If you have a public key in other format (for example, DSA), you can also give the public key file to key-add:

$ tsuru key-add $HOME/.ssh/

After your key is added, you can push your application to your cloud:

$ git push tsuru master

Running commands

After that, you can check your app’s url in the browser and see your app there. You’ll probably need to run migrations or other deploy related commands. To run a single command, you should use the command run:

$ tsuru run "python syncdb && python migrate"

Adding hooks

By default, the commands are run from inside the app root directory, which is /home/application. If you have more complicated deploy related commands, you should use the app.yaml pre-restart and post-restart scripts, these will run before and after the restart of your app, which is triggered everytime you push code or call restart. Below is an app.yaml sample:

    - deploy/
    - deploy/

You should put app.yaml file in the root directory of the app, and scripts are relative to it (you can use absolute path for scripts too, for instance /usr/bin/bash).

Further instructions

For a complete reference, check the documentation for tsuru command: