Trigger Rundeck or Jenkins jobs from Slack.
100K+
Trigger your Rundeck or Jenkins jobs from Slack.
Example:
@corebot deploy user-service 1.0 to staging
> corebot:
> OK, I'm deploying user-service version 1.0 to staging.
> Status of job is: running
> Details: http://rundeck/jobs/abc/123
Why would you want this? Check out ChatOps.





The quickest way to get up and running is to use the Docker image:
docker run -d \
--env SLACK_AUTH_TOKEN="CHANGEME" \
--env SLACK_CHANNEL_NAME="corebot" \
--env RUNDECK_API_TOKEN="CHANGEME" \
--env RUNDECK_BASE_URL="http://rundeck:4440" \
-v /path/to/actions.yml:/opt/corebot/actions.yml \
outofcoffee/corebot
Note: the container doesn't require any inbound ports to be exposed.
The bot has both built-in actions and custom actions. Examples of built in actions are the lock/unlock actions. Custom actions are triggers for your Rundeck jobs, configured using a configuration file, typically called actions.yml.
Note: the default path for
BOT_CONFIGis/opt/corebot/actions.yml
Example:
version: '1'
actions:
services:
jobId: 9374f1c8-7b3f-4145-8556-6b55551fb60f
template: deploy services {version} to {environment}
File structure:
actions blockservices in this example)An action template provides the syntax for invoking the command.
Example:
deploy services
A template also allows you to specify job options as placeholders, such as:
deploy services {version} to {environment}
In this example both version and environment are captured from the command, such as:
@corebot deploy services 1.0 to UAT
This will result in the action being fired, passing the following options:
Sometimes you might want to pass an option to a job by default, and not require the user to provide it. You can do this with the options action block:
version: '1'
actions:
services:
jobId: 9374f1c8-7b3f-4145-8556-6b55551fb60f
template: deploy services {version} to {environment}
options:
myOption: someValue
This will result in the action being fired, passing the following options:
Sometimes actions can be run on multiple jobs. To do this, set the tags block:
version: '1'
actions:
deploy-services:
jobId: 9374f1c8-7b3f-4145-8556-6b55551fb60f
template: deploy services {version} to {environment}
tags:
- services
restart-services:
jobId: e9d12eec-abff-4780-89cd-56a48b8c67be
template: restart services in {environment}
tags:
- services
Here, two actions are defined: deploy-services and restart-services, both tagged with services. This means you can do things like:
@corebot lock services
…and both actions will be locked.
Tip: There is a special tag set on all actions, named 'all'. This means you can do things like
@corebot lock all.
There are a number of built in actions, such as:
@corebot lock {action name or tag} - lock action(s) to prevent them being triggered accidentally.@corebot unlock {action name or tag} - unlock locked action(s).@corebot status {action name or tag} - show status of action(s).@corebot enable {action name or tag} - set the Rundeck execution status for a job - Note: this requires the Rundeck ACL to permit the API user to set the execution status of a job.@corebot disable {action name or tag} - set the Rundeck execution status for a job - Note: this requires the Rundeck ACL to permit the API user to set the execution status of a job.Pull requests accepted at https://github.com/outofcoffee/corebot
Slack API: https://api.slack.com/bot-users
Rundeck API: http://rundeck.org/2.6.9/api/index.html#running-a-job
Any Rundeck instance can be used as long as it supports API v14 or higher.
As an example, here is an unofficial Rundeck Docker image: https://hub.docker.com/r/jordan/rundeck/
docker run -it \
-p 4440:4440 \
-e SERVER_URL=http://localhost:4440 \
jordan/rundeck
Content type
Image
Digest
sha256:f8ce2eaa9…
Size
98.7 MB
Last updated
almost 4 years ago
docker pull outofcoffee/corebot