...
Triggering the LF Jenkins External Job
Here is an example script to put in your post-build step.
Code Block | ||
---|---|---|
| ||
CRUMB=$(curl -s -u "${username}:${password}" 'https://jenkins.onap.org/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)') curl -u "${username}:${password}" -H "$CRUMB" -X POST "https://jenkins.onap.org/job/lab-$JOB$EXT_JOB_NAME/buildWithParameters?SRC_BUILD_URL=${BUILD_URL}&LOG_DIR_URL=http://12.234.32.117/logs/job/$JOB_NAME/$BUILD_NUMBER/" |
Use the username and password for the lab Jenkins user LF ID you created earlier.
The HTTP POST should be made to the endpoint corresponding to your External Job name. Example: https://jenkins.onap.org/job/lab-windriver-beijing-oom-deploy/buildWithParameters
The key thing is that the External Job defined expects two parameters:
SRC_BUILD_URL:
The full Jenkins $BUILD_URL that actually ran the job. This will be shown in the LF Jenkins log so that people can click back to the source. Example: http://12.234.32.117/jenkins/job/windriver-beijing-oom-deploy/79/
LOG_DIR_URL:
The URL to the log server website directory. Example: http://12.234.32.117/logs/job/windriver-beijing-oom-deploy/79/
Any questions? Contact Gary Wu or post to comments here.