Web service to redirect to latest build for Jenkins multibranch pipeline job in Blue Ocean
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
templates
.dockerignore
.gitignore
Dockerfile
LICENSE
README.md
app.py
requirements.txt
run.sh

README.md

Jenkins Redirector

A tiny Flask app to discover the latest job ID for a particular multibranch pipeline job on Jenkins and redirect to the Blue Ocean view of that job.

Configuration

Configuration is done via environment variables. The following are available:

# Jenkins server base URL
JENKINS_SERVER=https://your-jenkins-server-domain.com

# Repo URL. Used on the home page.
GITHUB_URL=https://github.com/you/your-fork-of-this-app/

# number of minutes to cache build IDs per job and branch
CACHE_MINUTES=30

You can set those locally in a .env file or with actual environment variables.

Docker

Build your image:

$ docker build -t jenkins-redirector .

Run the thing:

$ docker run -it -p 5000:5000 -e CACHE_MINUTES=1 jenkins-redirector

Deployment

Deploys well as-is to Dokku and Deis. Should work well on Heroku as well, but might require some tweaks.