0

i need lauch a job in a secuered jenkins from remote, i have tried with api token, instead launching job it show a jenkins login page. The URL that i use is:

http://user:api_token@server_jenkins:8080/job/name_build/build?delay=0sec

Thanks

hellb0y77
  • 955
  • 5
  • 11
  • 21

2 Answers2

0

I've found the solution: need to able Trigger builds remotely (e.g., from scripts) to project page and insert any token. The request URL is:

http://user:api_token@server_jenkins:8080/job/name_build/build?token=token_insert_to_project

hellb0y77
  • 955
  • 5
  • 11
  • 21
0

you can do this using curl command as well. create an API token for the jenkins Job and use it to trigger the job. you can use jenkins user password for this as well.

enter image description here

command would be

curl -I -u auto:<user_api_token> http://<jenkins_Server>/job/test/build?token=wefiytgwiefiweihfqweiodf

results would be enter image description here

for more information how to trigger jenkins job via curl command remotely

Prabath Dolawatta
  • 511
  • 1
  • 5
  • 13