Skip to content

sharkySharks/l3-gobot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L3-Gobot

l3-37

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.

Quickstart

  1. Clone the repo to any directory and navigate into the new cloned directory.
  2. Run go get && go install in the l3-gobot directory.
  3. 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)
  4. Copy .env.example to .env and fill in secret information.
  5. Run go run main.go to start the bot.
  6. 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 with PONG

Secrets needed for .env

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

Future Features

  • 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

About

A Chatbot Written in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages