This page describes the steps required to integrate your own Lab Jenkins system with the Linux Foundation's hosted Jenkins for ONAP ("LF Jenkins") at https://jenkins.onap.org/view/External%20Labs/. The end result is to allow the job results executed on your lab Jenkins server to be pushed out to LF Jenkins for archival and analysis.
High Level Flow
The Lab Jenkins (i.e. your own) will schedule the jobs, collect the logs locally, and push them out to a log server website that's publicly readable. As an example, see http://12.234.32.117/logs/job/windriver-beijing-oom-deploy/79/.
When a job is done, the Lab Jenkins will issue a REST call to LF Jenkins to trigger the "External Job", passing it the URL to the log directory to archive.
The LF Jenkins "External Lab" jobs are set up to retrieve and archive the job log files from this website directory .
Currently there should be at least the following files:
- console.log (the console log output from the Jenkins job)
log.html (from Robot)
report.html (from Robot)
- output.xml (from Robot)
Additional files can be placed in the same directory and they will be fetched and archived by LF Jenkins.
Integration Steps
- Determine what your lab name should be. Example: "windriver".
- Create a LF ID for your lab Jenkins user. As a convention, the LF ID should be onap-ci-{lab-name}. Example: "onap-ci-windriver".
- Send email to LF helpdesk@onap.org to inform them of this account and request them to grant this account the right permissions for External Job integration.
- Set up your Lab Jenkins jobs to deploy its log files to a publicly log server website as specified in he previous section.
- Define the External Jobs you want to post results to in LF Jenkins. This is done by submitting changes to ONAP ci-management repo. Example: "lab-windriver-beijing-heat-deploy".
- Add a post-build step to your Lab Jenkins job to trigger the External Job on LF Jenkins.
Triggering the LF Jenkins External Job
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_NAME/buildWithParameters?SRC_BUILD_URL=${BUILD_URL}&LOG_DIR_URL=http://12.234.32.117/logs/job/$JOB_NAME/$BUILD_NUMBER/"