I am currently converting an old pipeline to a Jenkinsfile (scripted) based one. But one thing I was not able to get going is the “Trigger builds remotely (e.g., from scripts)”. This has been asked over and over on Stackoverflow and so far I have not found an answer.
It is possible to create a user token and use that and passing it via a POST call. But that way I am not able to make the new pipeline backward compatible which may break other scripts and pipelines.
What I want to do is to specify a token which can be used when my build is called like this: http://jenkins_url/job/HUGE_PROJECT/build?token=MY_TOKEN
Where MY_TOKEN is specified by me in the script. It is possible with the normal pipeline so it should be possible with a Jenkinsfile as well, shouldn’t it?
Edit my only way I can see so far is to keep the old job and make it trigger the Jenkinsfile-based one.