How do DeployBot and Slack work together?

It is possible to use Slack in tandem with your DeployBot account. If you would like to have DeployBot deployment notifications in Slack, or to trigger a deployment from Slack itself, read on.

Deployment notifications

For any repository in your DeployBot account, navigate to the Settings > Integrations page from the menu at the top of the page. Click Connect next to the Slack icon.
You will then need to grant DeployBot limited access to your Slack account. Click the Authorize button to grant this access.
For each environment that you want to be notified of in Slack, go to Environment Settings, and under the Triggers section, check the “Notify Slack” box. Then choose the channel name where the notifications should be directed. That’s it, now you’ll never miss a deployment again!

Triggering deployments from Slack

It is possible to use Slack’s slash commands for various functions and integrations. DeployBot is no different. You can think of slash commands as regular messages that start with a slash (/) character.
When sent, if the Slack server recognizes the command, it executes it according to default rules. Some connected 3rd party apps may add new slash commands to your Slack, and your own team can define custom slash commands too. And now, a little known fact: DeployBot’s deploy webhooks support Slack’s formatting and can be used as target URLs for slash commands.
Start with picking a name for your future slash command. You can use a descriptive token like /deploybot-production, or go wild with /letsroll, /dragonsahead, or whatever you like. Just remember to let your teammates know what this is about. Once you’re satisfied with the command name, browse to your Apps & Integrations page in Slack and click “Add Slash Command Integration”. This can be a little hard to find, so here is the full path:
  • Start here: https://youraccount.slack.com/home
  • Click Configure Apps in the sidebar
  • Click Build in the menu at the top right of the page
  • Click on the Make a Custom Integration box
  • Choose Slash commands from the list
  • Use the name you’ve chosen
To configure the command you’ll need a webhook URL for triggering deployments. In DeployBot, go to “Webhooks & Badges” section of your repository settings, and copy the one associated with your environment of choice.
Now let’s go over the configuration fields of a slash command integration in Slack:
  1. Command. The name you picked when you created the integration. Feel free to modify it if you changed your mind.
  2. URL. The deploy webhook URL you copied from DeployBot, paste it here.
  3. Method. HTTP request method, should be POST.
  4. Token. It has a pre-set value by default — leave it be or delete it. DeployBot’s webhook URL already includes a secret token called secret.
  5. Customize Name. We suggest that you set it to "DeployBot", but you can do what you like.
  6. Customize Icon. If you picked “DeployBot” on the previous step, you might as well use our avatar here.
  7. Show this command in the autocomplete list. Check this, unless you want this slash command to stay a secret.
  8. Autocomplete help text. Especially useful if you went with a “creative” name for your slash command. It’s a good place to explain what the command actually does, i.e. “Deploy Project Alpha to production”.
  9. Descriptive Label. A label to distinguish this command amongst your other integrations in Slack. For example, “DeployBot production”.  Once you’ve completed the configuration, click “Save Integration”. You should be able to see this command in autocomplete dropdown in Slack (unless you chose the option to exclude it from there). From now on, every time your environment is behind, using this slash command will trigger a deployment of the latest available commit in the branch associated with the environment.
That’s it. Happy deploying!

Common Issues

If a deployment is triggered from Slack, who shows as the deploying user?
The committing user is shown as the one deploying in your DeployBot account. Because a deployment can be triggered by anyone who has access to Slack, even if they do not exist in your DeployBot account, we use the commit information to show the deploying user.
Why do I not see my channel in DeployBot?
There are some scenarios where DeployBot will not see a new channel in your Slack account.
  1. If your account was renamed, simply click the Connect button once again from the Settings > Integrations page in your DeployBot account.
  2. If the connection from Slack has been interrupted and new channels are not showing, you can rename your Slack channel, then change it back to the original name. This will force a re-sync.
We’re missing notifications in Slack. What do I do?
In some situations with multi-server environments, a deployment may fail or be skipped. There are times when this results in no notification being sent to Slack. You can add the following command in DeployBot to put a delay on one server in an multi-server environment:
sleep 5
This will increase the chances that the delayed server will complete successfully, even others do not.

Still need help? Contact Us Contact Us