Jenkins Service doesn't support sub-uri's since 8.0.5
Between 8.0.4 and 8.0.5 the following code was added to help support both multi-project jobs in Jenkins and non-multi-project jobs:
# When multi-project is enabled we need to have a different URL. Rather than
# relying on the user to provide the proper URL depending on multi-project
# we just parse the URL and make sure it's how we want it.
def base_project_url
url = URI.parse(project_url)
URI.join(url, '/job').to_s
end
If you have your Jenkins install setup at anything but the ROOT of the server, then Gitlab will not be able to find the job because it will be missing the base path.
For instance:
If my url to a job is http://somehostname.com/jenkins/job/cool_jenkins_job, then the code will generate http://somehostname.com/job/cool_jenkins_job and get a 404.
I'm not exactly sure the correct way to fix this. Two thoughts I've had are
- adding yet another configuration property with the base path
- adding a bit more smarts to the function above that extracts from the url until the job part or take the whole thing if it doesn't exist
I'm willing to submit a patch for this if needed and the direction is decided upon.
Edited by Service Account - security-triage