GithubHelp home page GithubHelp logo

pombredanne / buildrotator-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heremaps/buildrotator-plugin

0.0 0.0 0.0 11 KB

A Jenkins plugin to perform rotation of build history with low memory pressure.

License: MIT License

Java 100.00%

buildrotator-plugin's Introduction

Build Rotator Plugin

A Jenkins plugin which allows to perform rotation of build history with low memory pressure.

Table of contents

  1. Overview
  2. Building
  3. Basic Usage
  4. Authors
  5. License

Overview

The reason we created this plugin is because we found the default rotation in Jenkins to use a lot of memory. In our case 25% percent of memory footprint was related to job history rotation alone. This is caused by an implementation detail of the default implementation: It guarantees that if you want to keep only last X builds in history, it would keep exactly X builds. The main idea of this plugin is to make a little bit different guarantee: If you want to keep only last X builds in history, it would keep a maximum of X builds.

Here are some examples to illustrate the difference.

Let us assume that we have 5 builds in history and we want to keep 5 builds:

  • build1
  • build2
  • build3
  • build4
  • build5

After that you want to remove build3, because it is broken. So, now you have only:

  • build1
  • build2
  • build4
  • build5

And after build6 just finished:

  • build1
  • build2
  • build4
  • build5
  • build6

The Log Rotator strategy in this case would load the entire history in memory to check whether there are 5 builds in reality or not, and it would not delete anything at the end. As a result the list would be the same:

  • build1
  • build2
  • build4
  • build5
  • build6

The Build Rotator is checking only the difference between last build number and the number of builds it should keep. And if it's more than 5, it would remove the first build. So, afterwards you would have:

  • build2
  • build4
  • build5
  • build6

More importantly, Build Rotator respects all other aspects of rotation in same way as the Log Rotator strategy. IN particular, it does not remove:

  • Builds that have "Keep log" enabled.
  • The "Last successful build" in the history.
  • The "Last stable build" in the history.
  • An ongoing build.

Building

Prerequisites:

  • JDK 7 (or above)
  • Apache Maven

Build process is quite simple:

mvn install

Basic Usage

To get started:

  1. Install the plugin.
  2. Go to the Jenkins Configuration.
  3. Enable on "Discard Old Builds".
  4. Set the "Build Rotator" strategy.

Authors

Alexander Akbashev - [email protected]

License

Licensed under the MIT License (MIT).

buildrotator-plugin's People

Contributors

jimilian avatar sschuberth avatar

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.