Run Jenkins build from command is very simple in Linux system. Jenkins has support to command line client that allows you to access Jenkins from command line.

To Trigger Jenkins build from command line some prequiste are there

Jenkins service is running. Enable security option under “Configure Global Security”

Go to jenkins dashboard in Home page ( e.g http://localhost:8080/ ) -> Manage Jenkins

-> Configure Global Security -> Click on “Enable security” checkbox

You can also configure “Access Control” and “Authorization” option in Global Security page.

Jenkins allow us to trigger Jenkins build with any specific user, For that we have to pass username and password in command line.

You can check all CLI option in http://<jenkins server >/cli/ ( e.g http://localhost:8080/cli/ ) page.

To access CLI feature in Jenkins download jenkins-cli.jar (http://<jenkins server>/jnlpJars/jenkins-cli.jar) and place this jar your directory or location from you are going to run jenkins build command.

Jenkins Command build Option:-

Syntax :-

java -jar jenkins-cli.jar -s http://<jenkins server>/ build build-name [-c] [-f] [-p] [-r N] [-s] [-v] [-w]

Option Descriptions:-

build-name : Name of the job to build -c : Check for SCM changes before starting the build, and if there's no change, exit without doing a build -f : Follow the build progress. Like -s only interrupts are not passed through to the build. -p : Specify the build parameters in the key=value format. -s : Wait until the completion/abortion of the command. Interrupts are passed through to the build. -v : Prints out the console output of the build. Use with -s -w : Wait until the start of the command

e.g.

java -jar jenkins-cli.jar -s http://localhost:8080/ build 'my-project-build' --username roop --password roop

Run Jenkins Build From Command Line http://techieroop.com/run-jenkins-build-from-command-line/ http://techieroop.com/wp-content/uploads/2014/07/jenkins.jpg http://techieroop.com/wp-content/uploads/2014/07/jenkins.jpg DevOPS Jenkins build-tools,CI,jenkins,linux Run Jenkins build from command is very simple in Linux system. Jenkins has support to command line client that allows you to access Jenkins from command line.To Trigger Jenkins build from command line some prequiste are there Jenkins service is running. Enable security option under 'Configure Global Security'Go to... Run Jenkins build from command is very simple in Linux system. Jenkins has support to command line client that allows you to access Jenkins from command line.<strong>To Trigger Jenkins build from command line some prequiste are there</strong> <ol> <li> Jenkins service is running.</li> <li> Enable security option under "Configure Global Security"</li> </ol> Go to jenkins dashboard in Home page ( e.g http://localhost:8080/ ) -> Manage Jenkins -> Configure Global Security -> Click on "<strong>Enable security</strong>" checkboxYou can also configure "<strong>Access Control</strong>" and "<strong>Authorization</strong>" option in Global Security page. Jenkins allow us to trigger Jenkins build with any specific user, For that we have to pass username and password in command line.<a href="http://techieroop.com/wp-content/uploads/2014/07/Configure-Global-Security-Jenkins-2014-07-07-18-44-04.png"><img class="size-medium wp-image-267 aligncenter" src="http://techieroop.com/wp-content/uploads/2014/07/Configure-Global-Security-Jenkins-2014-07-07-18-44-04-300x276.png" alt="Configure Global Security [Jenkins] 2014-07-07 18-44-04" width="300" height="276" /></a>You can check all CLI option in <strong>http://<jenkins server >/cli/</strong> ( e.g http://localhost:8080/cli/ ) page.To access <strong>CLI</strong> feature in Jenkins download <strong>jenkins-cli.jar</strong> (http://<jenkins server>/jnlpJars/jenkins-cli.jar) and place this jar your directory or location from you are going to run jenkins build command.Jenkins Command build Option:-<strong>Syntax :-</strong> <pre><code>java -jar jenkins-cli.jar -s http://<jenkins server>/ build build-name [-c] [-f] [-p] [-r N] [-s] [-v] [-w] </code></pre> <strong>Option Descriptions:-</strong> <pre><code>build-name : Name of the job to build -c : Check for SCM changes before starting the build, and if there's no change, exit without doing a build -f : Follow the build progress. Like -s only interrupts are not passed through to the build. -p : Specify the build parameters in the key=value format. -s : Wait until the completion/abortion of the command. Interrupts are passed through to the build. -v : Prints out the console output of the build. Use with -s -w : Wait until the start of the command </code></pre> e.g. <pre><code>java -jar jenkins-cli.jar -s http://localhost:8080/ build 'my-project-build' --username roop --password roop</code></pre> Roopendra https://plus.google.com/+Techieroopendra Roopendra Vishwakarma roopendramca@gmail.com Administrator I'm Roopendra Vishwakarma, a DevOps Engineer and Blogger from India. I have experience in DevOps, Web Development and various Open Source Technology. I mostly write about latest technology, getting started tutorial and tricks and tips. TechieRoop Run Jenkins build from command is very simple in Linux system. Jenkins has support to command line client that allows you to access Jenkins from command line.To Trigger Jenkins build from command line some prequiste are there Jenkins service is running. Enable security option under "Configure Global Security" Go to jenkins dashboard in Home page ( e.g http://localhost:8080/ ) -> Manage Jenkins -> Configure Global Security -> Click on "Enable security" checkboxYou can also configure "Access Control" and "Authorization" option in Global Security page. Jenkins allow us to trigger Jenkins build with any specific user, For that we have to pass username and password in command line. You can check all CLI option in http:// /cli/ ( e.g http://localhost:8080/cli/ ) page.To access CLI feature in Jenkins download jenkins-cli.jar (http:// /jnlpJars/jenkins-cli.jar) and place this jar your directory or location from you are going to run jenkins build command.Jenkins Command build Option:-Syntax :- java -jar jenkins-cli.jar -s http:// / build build-name [-c] [-f] [-p] [-r N] [-s] [-v] [-w] Option Descriptions:- build-name : Name of the job to build -c : Check for SCM changes before starting the build, and if there's no change, exit without doing a build -f : Follow the build progress. Like -s only interrupts are not passed through to the build. -p : Specify the build parameters in the key=value format. -s : Wait until the completion/abortion of the command. Interrupts are passed through to the build. -v : Prints out the console output of the build. Use with -s -w : Wait until the start of the command e.g. java -jar jenkins-cli.jar -s http://localhost:8080/ build 'my-project-build' --username roop --password roop

(Visited 29,332 times, 109 visits today)