ircbot
ircbot copied to clipboard
Jenkins IRCbot
JIRA/GitHub management IRCBot
This IRC bot sits on #jenkins as jenkins-admin and allow users to create/fork repositories on GitHub, etc. More info: Jenkins IRC Bot Page
Deployment
This repo is containerized (image available on docker hub), then deployed to our infrastructure via Helmfile.
You can find the helm chart and instructions to install it in jenkins-infra/helm-charts.
License
Developer guide
This section contains some info for developers.
Reusing IRCBot in non-Jenkins project
The bot is designed to be used in Jenkins, but it can be adjusted in other projects,
which use the similar infrastructure (GitHub, IRC, JIRA).
Adjustements can be made via System properties.
These properties are located and documented in the
org.jenkinsci.backend.ircbot.IrcBotConfig class.
Several examples are provided below.
Building the bot
- Use Maven to build the project and to run the unit tests.
- Then use Dockerfile to create a Docker image
For detailed examples see Jenkinsfile located in this repository.
Testing the bot locally
Preconditions:
- You have a JIRA Test Project, where you have admin permissions.
- You have a GitHub Organization with
Administerpermissions
Setting up the environment:
- Setup Github credentials in the
~/.githubfile
- Format: Java properties
- Entries to set:
loginandpassword - It's also possible
oauthandendpointproperties (see github-api)
- Setup JIRA credentials in the
~/.jenkins-ci.orgfile
- Format: Java properties
- Entries to set:
userNameandpassword
Running the bot for testing:
java -Dircbot.name=test-ircbot \
-Dircbot.channels="#jenkins-ircbot-test" \
-Dircbot.testSuperUser="${YOUR_IRC_NAME}" \
-Dircbot.github.organization="jenkinsci-infra-ircbot-test" \
-Dircbot.jira.url=${JIRA_URL} \
-Dircbot.jira.defaultProject=TEST \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat="yyyy-MM-dd HH:mm:ss:SSS Z"
-jar target/ircbot-2.0-SNAPSHOT-bin/ircbot-2.0-SNAPSHOT.jar
After executing this command the bot should connect to your IRC chat.