Code Monkey home page Code Monkey logo

port-allocator-plugin's Introduction

Port allocator plugin

TCP port number allocation

When you have several jobs that involve in launching a daemon process (such as application servers), making sure that each job uses unique TCP port numbers becomes tedious. If you don't manage this, however, two jobs that happen to run on the same machine may use the same port, like 8080, and end up interfering each other.

This plugin is written to solve this problem by letting Jenkins do the book-keeping. With this plugin, you'd just say "I need HTTP_PORT and JMS_PORT for this job", and Jenkins will assign unique available TCP port numbers to them and expose them to the build as environment variables.

The following screenshot illustrates this configuration.

Reserving a fixed port

Sometimes, your job requires a certain port. For example, it's not unusual to see tests that have hard-coded port numbers, or maybe you are testing SMTP servers that really do require port 25.

In such a case, you'd just need to say "this job requires port 25, so don't run it with any other job that requires the same port." Jenkins will then schedule jobs accordingly so that the collision won't happen.

The following screenshot illustrates this configuration.

Shutting down run-away daemons

Often these allocated TCP ports are used to run background daemon processes, like application servers. A typical problem in this set up is that when a job fails abnormally, the job may fail to terminate those servers properly. This interferes with successive builds that use the same machine.

To fix this problem, when you allocate a port (or reserve a fixed port), you can choose one of the port types that have the knowledge of shutting down the process. Currently, two port types are available, and more can be added as additional plugins.

  • GlassFish JMX port that lets Jenkins shut down a run-away GlassFish through JMX. You can configure a job to require fixed port 8686, which is the default port number for this.
  • Tomcat shutdown port that lets Jenkins shut down a run-away Tomcat through the shut down port. See the Tomcat 9 configuration reference for more about this feature.

The following screenshot illustrates this configuration.

Version History

GitHub releases provide details of recent releases.

CHANGELOG provides releases before 2014

port-allocator-plugin's People

Contributors

alanharder avatar daniel-beck avatar daniel-beck-bot avatar dependabot[bot] avatar larrys avatar markewaite avatar ndeloof avatar oldelvet avatar olivergondza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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