Shell (SSH) deployments

Setting up the Server

Shell deployments allow you to trigger shell commands on your remote server when you commit or push to DeployBot, or directly from your DeployBot account manually. To use shell deployments you’ll need to specify a server name, server address (URL or IP), port, credentials and the shell commands you want DeployBot to execute during deploy.

In the commands section, you’ll specify all of the shell commands that you would like to run on your remote server, each command on a separate line.

There are some variables that you can use in your commands:

  • %AUTO?% returns 1 or 0 to indicate if the deployment was triggered automatically
  • %BRANCH% branch that is being deployed
  • %COMMENT% deployment comment (or last commit message for automatic deployments)
  • %COMMIT% or %REVISION% commit that is being deployed
  • %ENV_NAME% name of the current environment
  • %FROM_SCRATCH?% returns 1 or 0 to indicate if the deployment is from scratch
  • %RELEASE_ID% unique ID for the deployment (this stays the same during retries)
  • %REMOTE_PATH% remote path from the settings of the deployment server
  • %REPO_NAME% name of the repository being deployed
  • %REPO_URL% URL of the repository being deployed
  • %ROLLBACK?% returns 1 or 0 to indicate if the deployment is a rollback
  • %TIMESTAMP_UTC% time when the deployment was triggered (formatted in UNIX time)
  • %USER_NAME% name of the user who triggered the deployment
  • %WORKING_DIR% working directory from the settings of the deployment server

Please be careful when using shell commands, shell deployments are powerful but also dangerous. Please double check the commands before finishing setup.

Public key authentication

If you prefer, you can use public key authentication instead of a password to connect to your remote server.

Use public key for authentication

If you decided to use public key authentication, make sure to download DeployBot’s public key (which we provide on the server setup page) and install it on your remote server. All servers that are added to the same repository have the same key. You are ready to go after that.

Still need help? Contact Us Contact Us