Created
April 13, 2018 05:34
-
-
Save anuragmathur1/76811ee9a5850f8a94de13aa0ab9bd0c to your computer and use it in GitHub Desktop.
Example : Ruby script to invoke Jenkins job remotely
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jenkins_api_client' | |
SERVER_IP = 'jenkins.dev.example.com' | |
$build = JenkinsApi::Client.new(:server_ip => "#{SERVER_IP}",:username => 'admin', :password => 'admin') | |
$opts = {'build_start_timeout' => 60, 'cancel_on_build_start_timeout' => true} | |
$build.job.build("test-project",{:parameter1=>"value-1",\ | |
:parameter2=>"value-2",\ | |
:parameter3=>"value-3",\ | |
:parameter4=>"value-4"} || {}, $opts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment