ParameterizedBuilds / parameterized-builds

Other
31 stars 27 forks source link

Support for Organization Folders #63

Closed lindt closed 7 years ago

lindt commented 7 years ago

it seems that if Organization Folders are used, the job cannot be triggered anymore. The URL will not be jenkins/job/foo, but more like jenkins/job/MY_FOLDER/job/foo. If configure the job-name as MY_FOLDE/job/foo then it finds the job, but still cannot trigger it, even if it then gets a 200.

a-hacker commented 7 years ago

I was able to trigger the job using MY_FOLDER/job/foo as the job-name. May I ask what version of Jenkins and the Folder plugin you are using?

lindt commented 7 years ago

When I configure MY_FOLDER/job/foo then I get a yellow message "job was not found" in stash when I trigger a branch-build manually. Maybe there is also a difference between a normal folder and a "folder" created by cloudbees-bitbucket-branch-source?

Jenkins: 2.32.3 Jenkins Plugins:

Parameterized Builds Stash Plugin: v2.6.6

ganievs commented 7 years ago

Hi guys! I have same problem. My jenkins version is 2.46.2

ganievs commented 7 years ago

MY_FOLDER/job/foo

It's work when Build Token Root disabled screenshot 1

a-hacker commented 7 years ago

Hey everyone, sorry for dropping communication here. I struggled to set up a test environment for this issue when it was first mentioned and then a lot of stuff came up. I'm willing to take another look at it though.

@ganievs, based on what you've mentioned, there may be an issue with the way the rest API interacts with the cloudbees-bitbucket-branch-source plugin. @lindt, if this issue is still relevant to you, could you confirm whether or not you were using the build token root plugin when the issue occurred?

lindt commented 7 years ago

@a-hacker: it is still relevant.

did a workaround. cause still cannot trigger builds. The workaround is to everytime rescan the whole project for each code change. it is not nice, but at least it works.

a-hacker commented 7 years ago

@lindt, Okay. I'm working on a branch to support multibranch pipelines which I believe we solve this problem for you. I've been posting in the open, referenced issue linked above. If you think that their requests match yours, I'd ask that you close this issue and help give some insight/support there. Since I'm not too familiar with this feature of Jenkins, I'm not sure how related these requests are or the best way to solve them. Thanks for your patience.

a-hacker commented 7 years ago

@lindt, version 3.2.0 should solve your issue. If it does not, please feel free to re-open this issue.

Gi0rgi0s commented 6 years ago

A little late here... I found that formatting the job name like this Folder/job-name in Stash did the trick.

mariafleetwood commented 5 years ago

I am trying to use "Parameterized Builds for Jenkins" (in bitbucket) to trigger jenkins job which created in folders.

I have 3.2.10 version of "Parameterized Builds for Jenkins" with 2.121.3 version of Jenkins. "Build Token Root Plugin" disabled.

When trigger build in Bitbucket for jobs with are located in folders and in subfolder. I tested both cases, both does not work. I used folder/job
folder/subfolder/job

I got message "Job was not found". Triggering works fine for jobs which are not in folders.

a-hacker commented 5 years ago

@mariafleetwood, If you are just using the regular folders then you'll want to set your job name as folder/job/job. So if your jenkins folder name is "AuditJobs" and your jenkins job name is "AuditDatabaseSize" then you'd set the job name in the hook settings as "AuditJobs/job/AuditDatabaseSize".

The issue here was with Multibranch Pipelines and Organization Folders which behave differently. If you are trying to trigger jobs that are part of a multibranch pipeline, make sure you set the Multibranch Pipeline checkbox and then set the job name as the Organization Folder.

mariafleetwood commented 5 years ago

@mariafleetwood, If you are just using the regular folders then you'll want to set your job name as folder/job/job. So if your jenkins folder name is "AuditJobs" and your jenkins job name is "AuditDatabaseSize" then you'd set the job name in the hook settings as "AuditJobs/job/AuditDatabaseSize".

The issue here was with Multibranch Pipelines and Organization Folders which behave differently. If you are trying to trigger jobs that are part of a multibranch pipeline, make sure you set the Multibranch Pipeline checkbox and then set the job name as the Organization Folder.

Thanks!

I just found it works if you don't use name of the job as it shown in JOB_NAME variable but use job name how it shown in browser (it work for jobs in subfolders as well)

Job in subfolder <Folder Name>/job/<Sub-Folder Name>/job/<Your Job Name>