A Slack bot inspired by Hubot written in Golang using the go-joe/joe library.
Named after the piloting droid L3-37, aka L3.
This bot will trigger a remote Jenkins job when you interact with it in Slack. It can also save information to a redis store.
- Clone the repo to any directory and navigate into the new cloned directory.
- Run
go get && go install
in thel3-gobot
directory. - Start a redis server, running
redis-server
, in a separate terminal window. (Install redis-server if you do not already have it on your system) - Copy
.env.example
to.env
and fill in secret information. - Run
go run main.go
to start the bot. - Test out the bot by running a command in Slack:
@bot-name ping
and if it is configured correctly the bot should respond in Slack withPONG
Key | Description |
---|---|
SLACK_TOKEN |
Follow Slack docs to add an app to your Slack workspace. After creation the app will be given a token. |
JENKINS_CRUMB |
Follow this article on how to retrieve a Jenkins crumb in order to authenticate a remote Jenkins API call to your Jenkins server |
JENKINS_USER |
Service account user for Jenkins server |
JENKINS_USER_TOKEN |
Log in to Jenkins server UI with the JENKINS_USER and configure an API token |
JENKINS_URL |
Full URL (including https:// ) for Jenkins server |
- Containerize bot and redis setup
- Deploy bot somewhere
- Add authNZ to limit who can run certain commands
- Add tests
- Add Jenkins build info output and/or command to get information on the triggered job