I'm struggling with a bit of trouble here. I'm supposed to trigger Jenkins build via Jenkins CLI. While it should be easy in itself, it is not. The trouble is that, my jobs look like following
A-
|
B-
|
C
So they are nested. When I give command list all I only receive A as an output. So I can only trigger job A but my task is to trigger job C. How can I do it?
I've tried passing the link of C job as a parameter in Jenkins CLI but it didn't help.
Figured it out, maybe it will help somebody later on. Instead of passing job as 'a/job/b/job/c' we're supposed to pass it as 'a/b/c'.
Related
I've setup a webhook trigger from JIRA to trigger a Jenkins job.
This works fine for 1 particular Jenkins job, I can see the JIRA content coming in and the test Jenkins job runs fine.
However I can't get any other jobs to run from the webhook. Even if I copy the job that works correctly, that doesn't trigger either and I can't see anyway of debugging the issue.
Can anyone help shed some light on my issue please?
Thanks
I would recommend you to use the Generic Webhook Trigger plugin, you can add a Token that will help you specify which job you need to run for a specific webhook.
https://plugins.jenkins.io/generic-webhook-trigger/
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?
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
I have a Jenkins pipeline job defined. The Jenkinsfile of this job has an input defined using a dropdown. So when the build is triggered the user is requested to select an input.
For manually triggering this is working great!
However, if we want the same job to be triggered by another job as a downstream. How can we do this? providing the input parameters.
Thanks
As #StephenKing pointed out to get setup we need, we have to move away from using input step and make the build parameterized.
The answer I was looking for is here
I want to create this parameterized job in Jenkins using code. Can somebody point me or give me hint to make it possible.
I have a job "Project-A" in Jenkins which runs every 1 hour. I have another job "Project-B" which runs once in a day. When the job "Project-B" is triggered, I will pass "project-A" name as parameter, it will read the last successful build information of Project-A, such as build_id, in which slave node the build was run, timestamp etc. I am doing this via curl and Jenkins API.
Would like to know is there any better way to do this. Instead of curl. groovy or anything better? or any plugins to achieve this.
Thanks