This is a simple Slackbot, based on hubot, and the k8s config required to stand him up.
There are two ways to customize this bot. The simplest is just to add existing scripts from the NPM registry.
- Find the script you want and learn how to configure it.
- Environment variables will go in
k8s/deployment.yaml
.
- Environment variables will go in
- Add the name of the script to
external-scripts.json
. - Add the script and any dependencies to the
npm install
call in theDockerfile
.
You can also write a custom script.
- Write the script in the
scripts
directory.- Don't add this to
external-scripts.json
, that happens automatically.
- Don't add this to
- Add any dependencies to the
npm install
call in theDockerfile
. - Add any environment variables needed to
k8s/deployment.yaml
.
- Build the image with
rake docker:build
. - Run the bot locally for testing with
rake docker:run
. This will drop you into a shell bot simulator where you can "direct message" with the bot. - If you need filesystem access, you can run the image directly:
docker run -it puppetlabs/bunsen /bin/sh
- Start the shell with
bin/hubot
This requires push access to the puppet-community
GCR namespace. Setting that
up is out of scope for this document. You'll also need to be a slack admin to
recycle the bot.
rake docker:push
- Wait 30 seconds
- In slack:
@bunsen restart
Yes, this process will be improved shortly.