Coder Social home page Coder Social logo

jlleitschuh / jenkinsci__nodepool-agents-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jenkinsci/nodepool-agents-plugin

0.0 2.0 0.0 551 KB

Nodepool plugin for Jenkins

Shell 0.47% Java 93.40% HTML 5.61% CSS 0.05% JavaScript 0.25% Dockerfile 0.22%

jenkinsci__nodepool-agents-plugin's Introduction

NodePool plugin

This repository contains a Jenkins plugin to perform builds on cloud instance nodes sourced from NodePool.

Pipeline Steps

nodePoolHold

This step allows a user to hold the current node from within a job, assuming the current node is a node pool node.

Usage:

    node("nodepool-debian"){
        nodePoolHold() // hold for one day
        nodePoolHold(duration: "1w") // hold for one week
        nodePoolHold(duration: "1w", reason: "Investigating issue IS-123") // specify reason
    }

The hold end time will be calculated from the specified duration and is visible on the Computer page in the Jenkins UI for each nodepool node. The reason is also visible in the same place.

Structure

The implementation consists of a listener class that creates agents (slaves) when a item with a matching label enters the Jenkins build queue. There is also another listener that releases each node after it is used once.

Building Prerequisites

To build the NodePool plugin from the source, the following tools are needed:

  • Java JDK 8
  • Apache Maven 3.x

Building

To build the project from source, run the following command:

mvn clean compile test findbugs:findbugs

It's highly recommended to run the findbugs target to discover any issues prior to submitting a pull request. The Jenkins CI system will run the findbugs target anyway, but it's convenient to catch the issues early. The findbugs:gui target will launch a tool to display any errors - otherwise the results will be in the target folder. The CI system uses a more elaborate command line (which may change in the future). Here's an example:

mvn --batch-mode \
  --errors \
  -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
  --update-snapshots \
  -Dmaven.test.failure.ignore \
  clean install

To generate the hpi installation file for Jenkins, run:

mvn hpi:hpi

Running

To launch Jenkins with the NodePool plugin from the command line, run:

mvn hpi:run

Releasing

The following are instructions to release a new version of the plugin so it will appear as an available plugins under Manage Plugins in the Jenkins UI. For more information, see here.

Steps:

  1. Edit ~/.m2/settings.xml to add your Jenkins CI username and password. Add this block to the XML:
<servers>
  <server>
    <id>maven.jenkins-ci.org</id> <!-- For parent 1.397 or newer; this ID is used for historical reasons and independent of the actual host name -->
    <username>username</username>
    <password>password</password>
  </server>
</servers>
  1. Confirm the pom.xml in the master branch of the repository has a tag containing SNAPSHOT.

  2. Run the maven release plugin: mvn [-B] mvn release:prepare release:perform

  • The -B flag is optional to accept all default choices.
  1. After this completes, edit the wiki to add a new version to the history here.

The maven release plugin will do the following:

  • Run unit tests
  • Build a new plugin version
  • Upload the new plugin artifact to the maven repository here.
  • Tag git with the new plugin version.
  • Update the git master branch pom.xml with a SNAPSHOT tag representing the next (unreleased) development version.

Availability

Experimental Versioning

NOTE that installation of experimental plugins in Jenkins seems to be broken!

Releasing experimental plugins

To release an experimental version of a plugin, put alpha or beta in the version string.

Installing experimental plugins

(Assuming the above issue gets fixed)

To install an experimental plugin:

Full details on experimental plugins are here.

jenkinsci__nodepool-agents-plugin's People

Contributors

dealako avatar hughsaunders avatar

Watchers

 avatar  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.