MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to Trigger builds remotely in Jenkins? | Jenkins Tutorials


curl -X POST --user rajesh:1152f227ae20792ed6ac30120d73f547a3 http://20.81.129.174:8080/job/Rajesh/job/raj-compile/build?delay=0secCode language: JavaScript (javascript)

Jenkins user Configure page with a new API token named command-line generated
Jenkins job Build Triggers tab with Trigger builds remotely enabled and Authentication Token field
Curl -X POST to the Jenkins job1 build URL from a terminal, with build #4 pending in Build History
ย 
How to Trigger builds remotely in Jenkins?
ย 
1. Create a user – You need to create a user in jenkins using you would like to trigger a jenkins jobs from remote loction or script
ย 
How to create users in Jenkins?
Manage Jenkins –> Manage Users –> Create User
ย 
2. Assign a right privillage to the specific user?
How to assign privillage to the user?
Manage Jenkins –> Configure Global Security –> Enabled “Anyone can do anything”
OR
Manage Jenkins –> Configure Global Security –> Configure “Matrix-based security” for the specific users and assign atleast following Permissions.
ย 
Overall – Read
Job – Build
Job – Read
Job – Workspace
ย 
3. Find out jenkins user “API Token”
How to find jenkins user “API Token”?
“
Click on the user name located at top right(e.g http://54.171.140.1:8080/user/admin1/) –> Configure –> Locate the “API Token” section.
ย 
4. Enabled “Trigger builds remotely” in Jenkins Job Configuration.
Click on the desired job –> Configure –> Locate the “Trigger builds remotely” under “Build Triggers” Tab
Enabled the check box of “Trigger builds remotely”
Provide some Authentication Token e.g – iFBDOBhNhaxL4T9ass93HRXun2JF161Z
$ Save
ย 
5. Formulate the command to run using curl.ย 
> curl –user userid:API-Token http://IP OR HOST:PORT/job/JOB_NAME/build?token=Authentication_Token
eg.curl –user admin1:91367cf0389eaf89669f74c9963c9fb3 http://54.171.140.1:8080/job/ANT-BUILD/build?token=iFBDOBhNhaxL4T9ass93HRXun2JF161Z
ย 
Some of other formats which is being tried in google but need to be tested with specific users. there are working with “Anonymous”
> curl -X POST http://admin1:91367cf0389eaf89669f74c9963c9fb3@54.171.140.1:8080/job/ANT-BUILD/build?token=iFBDOBhNhaxL4T9ass93HRXun2JF161Z
ย 

> wget http://admin1:91367cf0389eaf89669f74c9963c9fb3@54.171.140.1:8080/job/ANT-BUILD/build?token=iFBDOBhNhaxL4T9ass93HRXun2JF161Z

WORKING WITH NEW JENKINS
>ย wget –auth-no-challenge –user=admin –password=5ad344f0518640f62d0483084bb889bc http://13.126.143.49:8080/job/ANT//build?token=iFBDOBhNhaxL4T9ass93HRXun2JF161Z

If you are using wget 1.11 against Jenkins version 1.586 and above with the JENKINS-25169 fix, you might need to use the following options:
wget –auth-no-challenge –http-user=user –http-password=apiToken –secure-protocol=TLSv1 http://jenkins.yourcompany.com/job/your_job/build?token=TOKEN

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:apiToken@jenkins.yourcompany.com/job/your_job/build?token=TOKEN

If you are a Windows User!
ย 
โ€˜gitbashโ€™ is a program combined of git and bash. A bash is shell that runs commands once you type the name of command and press enter. ๐Ÿ™‚
ย 
Download ย the git bash from here https://git-scm.com/download/win and install it.
ย 

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

DevOps Lifecycle Explained: Stages, Tools, Benefits & Real-World Examples

Introduction to the DevOps Lifecycle Modern software teams must build, test, and release applications faster than ever. Customers expect websites and mobile apps to work smoothly. Businesses…

Read More

How to Build a CI/CD Pipeline for an MVP Without Slowing the Launch

A CI/CD pipeline for an MVP is the smallest automated path from a merged commit to a running staging environment: build, test, deploy, and a way to…

Read More

DevOps Explained: Why It Matters in Modern Software Development

Introduction Modern software engineering is no longer limited to writing code and building applications. A successful software product must also be tested, deployed, monitored, secured, and continuously…

Read More

How to Build a Reliable CI Pipeline for 3D Assets

A repository that performs well with source code can become slow and difficult to maintain once a team begins adding 3D models, textures, animations, and generated previews….

Read More

Bare Metal vs Cloud for CI/CD Runners and Build Servers

Why it matters where your pipelines run Most teams pick a CI runner once and never revisit it. The usual default is the hosted runner that comes…

Read More

How to Add an AI Model API to a DevOps Pipeline Safely

Adding an AI/ML service to a DevOps pipeline involves more than placing an API key in an environment variable. The team must decide which pipeline stages can…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x