0

I am running external script to trigger parameterized Jenkins job.Basically I want to run parallel jobs. But I don't want to execute the job with same parameter is already running. I guess, That logic I have write into the external script. Now my question is, let's say Job is running with parameter A, B and C. In this case I should be able to trigger Job with parameter D, E,F but at the same I should not able to trigger job with A, B and C parameter as it is already running. To achive that I need to know running build with their parameters. How can I do that?

1 Answer 1

1

First you need to get the current build ID (the build in running state).

You can have a look here how to do that.

Then use this id do get the parameters of the job.

Considering 18 the build ID

http://your-jenkins-server.domain.com/jobName/18/parameters/

Compare the parameters between current build and possible next build to trigger.

I advise you to read Jenkins API for general information and also take a look at

http://your-jenkins-server.domain.com/jobName/api
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.