LOGIN
Sign In or Register
Avatar
Not Registered Yet?

Join Now! It's FREE. Get full access and benefit from this site

Reset My password - Remind Me My username

Username
Password
Remember me

Ways to Login Jenkins using Command line

Ways to Login Jenkins using Command line

&

Way to trigger Jenkins job using Command line or script

Wget


Note: If you are using wget 1.11, you might need to use the following options:

 wget --auth-no-challenge --http-user=user --http-password=apiToken http://jenkins.yourcompany.com/job/your_job/build?token=TOKEN

With wget 1.10.x the following is enough (but will not work with 1.11.x) :

 wget http://user:This email address is being protected from spambots. You need JavaScript enabled to view it./job/your_job/build?token=TOKEN

ex - wget http://yourserver/job/MyJobname/build?delay=0sec

CURL

Without authentication:

$ curl http://jenkins:8080/job/my%20job/build [ HTML page saying "Authentication required" ]

 

With authentication:

$ curl --user dbacher:$MY_API_TOKEN http://jenkins:8080/job/my%20job/build [ returns nothing and the build starts ]
curl -X POST http://server/view/name/job/jobname/build?delay=0sec --user 1019352:61bb8531292794315f5dda8113548630 

Login Jenkins using groovy script or Perl Script or Java, please refer the reference page...

Reference:
https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients

https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

 

Rate this item
(2 votes)
Rajesh Kumar

.

Total, Over 12 years of extensive experience in the Software Configuration Management domain having depth knowledge of DevOps, Continuous Integration and Delivery, Configuration Management, Build and Installer, Release Management and Application Management.