We are setting up a continuous delivery pipeline in Jenkins, using the build pipeline plugin.
Our deployment steps uses a proprietary deploy tool (triggered by a HTTP request from jenkins), but we need to have an additional Jenkins step for acceptance tests on the then deployed project. So our deploy tool will need to trigger the last pipeline step.
The jenkins setup for this is obvious:
For a Manually Triggered downstream build step: To add a build step that will wait for a manual trigger:
- Select the Build Pipeline Plugin, Manually Execute Downstream Project check-box
- Enter the name(s) of the downstream projects in the Downstream Project Names field. (n.b. Multiple projects can be specified by using comma, like "abc, def".)
Source: Build Pipeline Plugin
The problem is: I can't seem to find a way to trigger this downstream build through a URL.
In fact I'd need the URL in the deploy job, so I can send it to the deploy tool as a callback URL. Can anybody help?
The path to become a Jenkins expert An easy way to obtain the Jenkins environment variables list from your local installation is to append env-vars. html to the server's URL. For a locally hosted Jenkins server, the URL would be: http://localhost:8080/env-vars.html.
The Jenkins URL is a combination of your system's hostname and the port used by Jenkins. For instance, when logging in on your system using the default port 8080: http://localhost:8080/env-vars.html.
To create a simple pipeline from the Jenkins interface, perform the following steps: Click New Item on your Jenkins home page, enter a name for your (pipeline) job, select Pipeline, and click OK. In the Script text area of the configuration screen, enter your pipeline syntax.
If I understand correctly, you want to use remote access API, which to my knowledge is no different between general project or pipeline one. Take a look here:
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
Submitting jobs Jobs without parameters You merely need to perform an HTTP POST on JENKINS_URL/job/JOBNAME/build?token=TOKEN where TOKEN is set up in the job configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With