Running Jenkins Job from Command Line

                                               
Running Jenkins Job from Command Line

As we all know there are quite a few situations in real-world where we need to run our Jenkins Job from the command line like automation of some routine task, build updates, troubleshooting, etc.

For that Purpose Jenkins has a built-in command-line interface that allows us to access Jenkins from a script or from a shell interface.


To execute our Jenkins job from command line we need to follow below steps:

1)     Manage JenkinsàJenkins CLIàInstall the Jenkins CLI jar on local the machine at the same location where Jenkins war is file.



2)     For Running a job click on Build Job under Available Command.



3)     Once Click on Build automatically Command will be displayed on the top of the screen to execute Jenkins job for e.g


4)     Now we need to go to the command line and the path where CLI jar is present and fire the command from Step No 3. Please Note we need to replace JOB with our actual job name.


We can also view the job status on the Jenkins Dashboard


5)     For Checking Job progress on the command line, we can use the command line in step 3 followed by the –f. There are other optional filed as well which we can use.








SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post