2. Agenda
● CI - Why, What & How
● YAML file and JJB
● CI Work-flow
● Build triggers
● Parameterize the jobs
● Build jobs using JJB
● Q&A session
3. Why CI?
● Company Goal
● Delay in response
● Env issues & User errors
● Inefficient use of tools/resources
● Duplicate test reports
● Compromise in Quality
4. What does CI do?
● Automatic execution of tests
● Integrate different tools
● Latest & greatest pkgs
● Clean env
● TIER based runs
● Centralized reporting
6. ● YAML file and JJB
YAML file
Global defaults
Project vars & Jobs
Jenkins vars
Json file
Restraint xml
Builders
Parameters
Jobs
Jenkins Jobs
Trigger
Repo creation
Provision
Runtest
Teardown
Build jobs from Jenkins
JJB(Python script)
GIT repo
Jenkins
Master
Config
file(Creds)
10. Build triggers
● Upstream job - Trigger
● Downstream – Provision
● Triggers:
- ci-trigger:
jms-selector: |
CI_TYPE IN ('brew-tag')
AND
CI_NAME IN ('389-ds-base','nss','openldap')
AND
tag IN '{brew-tag}'
11. Build triggers contd...
● Periodic build trigger
● Jenkins job trigger
– Build when jobs built
– Build when jobs promoted
– Build based on results of multiple jobs
● Script trigger – Shell script
● Gerrit trigger
– Gerrit server details
– When patchset created, merged
18. Parameterize jobs
● Change variable values
– Troubleshooting & Manual execution
● choice:
name: tag
choices:
- rhel-7.2-z-candidate
- rhel-7.2-candidate
description: "Brew tag for this build."
● string:
name: REPORT_EMAIL
default: redhat-list@redhat.com
description: Default email id for reports
19. JJB with Gerrit refspec
● Add a parameter - GERRIT_REFSPEC
● Add a build step – Execute shell
pushd $WORKSPACE/dirsrv-tests
git pull
https://code.engineering.redhat.com/gerrit/dirsrv-tests
$GERRIT_REFSPEC
popd
● cd $WORKSPACE
● python -m jenkins_jobs.cmd --conf
$WORKSPACE/dirsrv-tests/jobs/config --flush-cache
update $WORKSPACE/dirsrv-tests/jobs/
$GIT_BRANCH
20. References
About CI in MOJO - https://mojo.redhat.com/search.jspa?q=CI
%20workflow
Setup CI with Jenkins -
http://www.vogella.com/tutorials/Jenkins/article.html
Jenkins CI plugin - https://mojo.redhat.com/docs/DOC-986839
CI Reference guide - https://mojo.redhat.com/docs/DOC-1030059