Giter Site home page Giter Site logo

yapah's Introduction

YAPah - Yet Another Pull Request Jenkins Plugin

Summary

A very simplistic plugin that alerts a job when a pull request is opened and runs that job. Designed to specifically notify the pull request as a post to the issue and again once the job as completed. Setup is very lightweight and requires minimal configuration.

Example Use Case

Code coverage with Sonar

Job is triggered from a pull request, the Sonar runner plugin analyzes the code and gets a code coverage percent. If this percentage is below a company standard, the shell build script fails out. The publisher post action will comment on the pull request saying the build has failed, be careful to merge and includes a link to the build to explain why.

Required Jenkins Plugins

Jenkins Installation (Suggested)

  1. Build the plugin (mvn package)
  2. Log into Jenkins
  3. Click Manage Jenkins
  4. Click Manage Plugins
  5. Click Advanced Tab
  6. Under upload plugin, select the HPI file from the target directory and select upload

Manual Installation

  1. Build the plugin (mvn package)
  2. Copy YAPah.hpi from your target directory into your plugins directory. (Note: One way to find your plugins directory on mac or linux is to run the ps shell command as in ps -ef | grep Jenkins)
  3. Restart Jenkins

Configuration

  1. Go to Manage Jenkins
  2. Configure System
  3. YAPah Github Pull Request Poller
  4. Change github.com to any enterprise github (github.company.com)

Build Configuration

  1. Create a parameterized build
  2. Create a String parameter with the name of sha and the default value of master
  3. Create a String parameter with the name of gitHubHeadRepository and default it to your repository
  4. Select Git as your Source Code Management
  5. Enter ${gitHubHeadRepository} for the Repository URL
  6. Enter ${sha} for Branches to Build
  7. Select YAPah Github Pull Request Poller under Build Triggers
  8. Enter a Cron Schedule to your preference (e.g. * * * * * for once a minute)
  9. Enter your Github Repository
  10. Enter the owners name of the repository
  11. Enter the Repository Name
  12. Store a user to whom has access to comment on pull requests for the repository. Please try to use a System user as passwords tend to expire.
  13. Click Test Connection to validate that everything is setup correctly.
  14. Add a Post build Action and select YAPah Github API Pull Request Validator

Flow Diagram

alt tag

Example Configuration

alt tag

Example Comments

alt tag

Dev Environment Setup

The following details should be helpful for those looking to contribute to development of this plugin. Start by creating a fork of the repository to be able to later submit pull requests and you can use the guidance below to set up the project in your IDE.

Intellij

Create a maven project in intellij. Since some of the sources are generated at build time, you'll need to use the Generate Sources and Update Folders sub-option found under the Maven option when you right click on your project module.

Eclipse

Since some of the sources are generated at build time, these are best picked up by creating eclipse configuration files from maven by running the command: mvn eclipse:eclipse . You can then create your eclipse project from these eclipse configuration files.

yapah's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

c3riley

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.