Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Lab Jenkins (i.e. your own) will schedule the jobs, collect the logs locally, and push them out to a your own 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 JobLab" 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.  

...

  1. Determine what your lab name should be.  Example: "windriver".
  2. 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".
  3. 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 Lab integration.
  4. Set up your Lab Jenkins jobs to deploy its log files to a publicly readable log server website as specified in he the previous section.
  5. Define the External Jobs Lab jobs to which 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".  
  6. Add a post-build step to your Lab Jenkins job to trigger the External Job Lab job on LF Jenkins.

Triggering the LF Jenkins External Lab Job

Here is an example script to put in your post-build step.

Code Block
languagebash
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 Lab job name.  Example: https://jenkins.onap.org/job/lab-windriver-beijing-oom-deploy/buildWithParameters

The External Lab job expects two parameters:

Any questions?  Contact Gary Wu or post to comments here.