Skip to main content
How to Use the SSH Tool
Toshi Dávila avatar
Written by Toshi Dávila
Updated over a month ago

The SSH tool is a universal tool that can run virtually any command on a remote server over SSH. Add tasks to run with the click of a button or trigger tasks on time-based events like hourly, daily, or when events happen such as commits or created merge requests within your repositories.

The SSH tool can provide comfort to operations teams by standardizing common jobs that run on mission critical servers. With the SSH tool, you do not have to rely on team members to set up SSH, be able to run things via command line, or risk human error. Once configured, any team members with permission can use it and you’ll know actions will be performed with 100% certainty.

Not only is configuring the SSH tool more convenient than running the command in a terminal window, but it provides accountability and logging so you can see who performed the action and when, see a log of what happened, and see the result of the action (pass or fail).

Using the SSH tool

Deploying with the SSH tool

While Assembla’s FTP deploy tool is great, it has its limits. With a little extra work, the SSH tool functions as a flawless deploy tool no matter how complicated your setup might be.

If you already use a tool like Capistrano or have automated your application's deploy process on the command line, you are most of the way there. Just add your server to the SSH tool, configure authentication, and add the command.

If your deploy process is more complicated than sending files to a server, and you don’t have a script that deploys your application, we highly recommend you look into creating one. Once you have a working script, hooking it up to the SSH tool will be easy.

Helping with other maintenance tasks

Use the SSH tool for:

  • Deploying to multiple environments (eg staging, QA, production).

  • Restarting services (memcached, leaky webapps, etc.).

  • Rolling a deploy back to a previous version.

  • Synchronizing a path on remote server(s) with version control.

Configuring the SSH tool

To configure the SSH tool

  1. Go to Space Settings > Tools.

  2. Scroll down to SSH, and then click Add. The system creates the SSH tool for you.

  3. If you are not automatically redirected to the SSH page, on the left navigation pane, scroll down to Other Tools, and then click SSH.

  4. Click Configure Your SSH Tool.

  5. Create a new server by adding a name and description for your server, its hostname or IP address, and the port on which SSH runs. Normally, port 22.

  6. Click Submit.

  7. Click Download to save the RSA key from Assembla, and choose or create a user on the server used to perform the tasks. Be sure to place the key into your user's authorized_keys file. Usually at /home/<USER>/.ssh/authorized_keys, but you may need to create the .ssh/ directory.

  8. Once a server is configured, you can click on the Scripts submenu option and configure the script. You can use the variables #SPACENAME# and #USERNAME# here, and they are replaced by the name of the space and the user running the command respectively.

Note: Assembla’s API can control the SSH tool with the same capabilities as the web interface so you can incorporate the SSH tool with 3rd party applications using the API.

Understanding how Assembla streamlined the deployment process with the SSH tool

At Assembla, all of our production deploys now happen through the SSH tool, which has streamlined the process dramatically. We use Capistrano and have for a long time, but we use to need a member of the operations team to run Capistrano manually whenever a developer needed to deploy.

The old process was a burden on the developers and the operations team, especially when we started deploying 10+ times a day. The old process usually went like this:

  • A developer would ask in the main chat room "Any ops around for a deploy?"

  • Ops would respond and might have a quick chat with the dev before the code to deploy would be merged.

  • Ops would then announce in the chat, "Deploying," and kick off the deploy manually.

  • Ops would monitor the output from the deploy script and paste a URL into the chat showing the changeset of what was just deployed.

  • Then finally announce "Deploy done!"

Once we had the SSH tool in place, devs took on most of these tasks. They would still ask if operations staff were present just in case something went wrong. This was a huge time saver and removed much of the burden. It was now up to the dev doing the deploy to announce and paste the changeset URL. It still wasn't as good as it could be, so we improved it again.

We got rid of "Any ops around?" by building a step into the deploy script that looks for the status of operations staff on chat networks, and if all were in an "away" status, the deploy would fail.

Then, we made the SSH tool actions and merge request features accessible from the API and wrote a Hubot script for our bot named “jenks.” 

So one quick request in chat will kick off a deploy, keep the team updated, and let us know when it is done with a full report. Now that is service with a [virtual] smile.


If you have any questions or need our assistance, don't hesitate to contact us at support@assembla.com. 

Did this answer your question?