GithubHelp home page GithubHelp logo

isabella232 / remote-jenkins-job Goto Github PK

View Code? Open in Web Editor NEW

This project forked from optimizely/remote-jenkins-job

0.0 0.0 0.0 9 KB

Trigger a Remote Jenkins Job with parameters and get console output as well as result

License: Apache License 2.0

Shell 100.00%

remote-jenkins-job's Introduction

remote-jenkins-job

Trigger a Remote Jenkins Job with parameters and get console output in real time, as well as result (pass/fail)

Background

This script is intended to replace the Jenkins Parameterized Remote Trigger Plugin.

At the time of writing this, the plugin appears unmaintained and the last commit was sometime in August, 2015. Recent Jenkins updates have made this plugin extremely unstable, resulting in frequent NullPointerError failures.

Requirements

jq, curl, Jenkins

Usage

Extremely simple, use as follows:

remote-job.sh -u https://jenkins-url.com -j JOB_NAME -p "PARAM1=999" -p "PARAM2=123" -t BUILD_TOKEN -i

Where the following parameters are set:

  • -u: url of jenkins host
  • -j: JOB_NAME on jenkins host (eg master-build).
  • -p: parameter(s) to pass in. Send multiple parameters by passing in multiple -p flags.
  • -t: BUILD_TOKEN on remote machine to run job
  • -i: ignore certificate validation (useful if you see curl SSL errors while polling)

You can optionally set the polling interval (POLL_INTERVAL, default 5) and build timeout (BUILD_TIMEOUT_SECONDS, default 3600) as environment variables.

The script will poll the job until completion, and output the console of the running job in near-real time as it is updated. It does this by setting a cursor on the last line received and only outputting new lines (using a simple tail -n command).

Notes

Currently the script outputs all parameters (including tokens) for logging purposes. You may want to implement a mask on any sensitive fields like tokens through Jenkins password fields.

remote-jenkins-job's People

Contributors

brianlucas avatar spencerwilson-optimizely 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.