Giter Club home page Giter Club logo

ircbot's Introduction

JIRA/GitHub management IRCBot

Build Status Docker Pulls

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

MIT 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

  1. Use Maven to build the project and to run the unit tests.
  2. Then use Dockerfile to create a Docker image

For detailed examples see Jenkinsfile located in this repository.

Testing the bot locally

Preconditions:

  1. You have a JIRA Test Project, where you have admin permissions.
  2. You have a GitHub Organization with Administer permissions

Setting up the environment:

  1. Setup Github credentials in the ~/.github file
  • Format: Java properties
  • Entries to set: login and password
  • It's also possible oauth and endpoint properties (see github-api)
  1. Setup JIRA credentials in the ~/.jenkins-ci.org file
  • Format: Java properties
  • Entries to set: userName and password

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.

ircbot's People

Contributors

batmat avatar bitwiseman avatar christ66 avatar daniel-beck avatar dduportal avatar dependabot[bot] avatar jglick avatar jieryn avatar jlleitschuh avatar kinow avatar kohsuke avatar kutzi avatar lemeurherve avatar lemeurhervecb avatar mika avatar ndeloof avatar notmyfault avatar olblak avatar oleg-nenashev avatar orrc avatar pierrebtz avatar rtyler avatar slide avatar timja avatar uhafner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ircbot's Issues

Add timestamps in logs

Looking at IRCBot pod logs, I've noticed they aren't timestamped.

Could timestamps be added to the logs?

Update deployment instructions in README.md

The current deployment instructions for the ircbot don't seem to be correct (e.g., there is no longer a helm chart for it?). It would be good for someone with the information to update the deployment instructions area of the README.md if there is anything that needs to be done to get the updated bot deployed. If there are no longer any manual steps that need to happen, it would be good to remove the deployment instructions from the README.md

Don't attempt deployment on ci.jenkins.io

Every build fails at the moment, because executing the build logic provided by the makefile attempts to deploy the image to the docker hub: https://ci.jenkins.io/job/Infra/job/ircbot/job/main/14/

Maybe we can outsource the logic to the Jenkinsfile and use a isInfra() condition to check, whether the pipeline is executed on ci.j or infra.ci.j. Depending on the result, the pipeline deploys the image to the docker hub. There's no need to attempt that on ci.j, given we can't deploy from there.

For comparison, the build succeeds on infra.ci: https://infra.ci.jenkins.io/job/docker-jobs/job/ircbot/job/main/

Support for Java 17

Only tests will need an update, the dependencies to build the project should support Java 11 and 17 out of the box.
Although, powermock doesn't support JUnit 5, but we can probably get a rid of it and use mockito 4 with JUnit or hamcrest assertion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.