[2024]Digital Global Overview Report 2024 Meltwater.pdf
Jenkins-meetup
1. Jenkins User Meetup
"XTrigger, EnvInject
and DryRun plugins"
Grégory BOISSINOT
(@gboissinot)
2012-02-06
Jenkins 1
2. • Senior Consultant and Trainer at Zenika
– Setting up CI processes in major companies
• Hudson Committer since February 2008
• Active Jenkins contributor and committer
– Creator and maintainer ~30 plugins
– Mainly on my free time
• A pragmatic guy:
– Clearcase is a great VCS tools
– Ivy is the best dependency manager
– FarManager is the best file manager on Windows
Jenkins 2
3. Development
JAVA ...
Event
Environment Jenkins
Development
Integrator
Project
Manager
Jenkins 3
4. Jenkins roles
1. Monitor an external infrastructure environment
2. Prepare the running environment of the CI process
3. Start the integration process
4. Ensure traceability tool with the software configuration
management from the source to the generated binaries
(bidirectional)
5. Orchestrating quality tools code
6. Notify the development team
Jenkins is focuses on the developer needs
Jenkins 4
5. SCMTrigger
Environment
FSTrigger
Polling URLTrigger
IvyTrigger
Jenkins
MavenTrigger
BuildResultTrigger
ScriptTrigger
• ot only a SCM
N
XTrigger
• any ways to trigger a job
M
Jenkins 5
6. • OB_A is triggered if there are changes in
J
SCM
• OB_B is triggered only if there are new
J
artefacts in the file system repository
• OB_A and JOB_B are not tied together.
J
POLL
JOB_A PUSH
"Build & UnitTests" POLL
Artifact
RUN JOB_B
"Functional Tests"
RUN
Jenkins 6
7. JOB1 JOB2 JOB3 JOB4
Polling jobs status
such as "looking for new
failures"
Clean JOB
Environment
Launch a clean
Procedure
Jenkins 7
8. CommonF1
Build dependencies and
the usage of latest
ivy.xml
strategy
ivy.xml
Client
Server
POLL
Client
PUSH
Ivy
PUSH
CommonF1
Ivy
IvyTrigger
POLL
SCMTrigger
Common
PUSH
Client
Server
Server
IvyTrigger
Jobs are triggered by events
No dependencies between Jenkins jobs
You build only jobs that have to build (incremental build
at Jenkins level) Jenkins 8
9. JOB_A PUSH
Environment
Jenkins
POLL
JOB_B
• o static dependencies between jobs
N
• ependencies in the build chain are driven to a change of an external resource
D
• ou can rebuild your application without a dependency on Jenkins
Y
DEMO
Jenkins 9
10. • In practice
– Do not exceed polling in your system
– Choosing the right schedule is indispensable
• However, except for SCM, handle events (hooks) is difficult
– FileSystem?
– Binary Repository ?
– URL?
Maybe an evolution
Jenkins 10
11. • For the FSTrigger plugin
– Implement the core in Python (or other language close to OS)
• For the IvyTrigger plugin
– Add credentials
• XTrigger
– Add GradleTrigger typlogy
– Add a DSL on top of for describing a build chain
Jenkins 11
12. DOXYGEN_HOME
ANT_HOME
..
EnvInject
VARA=.. Plugin
VARB=..
DOXYGEN_HOME
ANT_HOME
..
VARA
VARB
..
Prepare Env
Prepare Env
vars from vars from job
node
Jenkins 12
13. • Removes inherited environment variables by the Jenkins Java
process
• Injects environment variables at node (master/slave) startup
• Executes a setup script before or/and after a SCM checkout
• Injects environment variables before or/and after a SCM checkout
• Injects environment variables as a build step.
• Exports environment variables at the end of the build in order to to
know the set of environment variables used for each build
DEMO
Jenkins 13
14. • Share objects and populate these objects as environment
variables
– Public File Path
– Simple Value
– Clearcase Object
– ...
Jenkins 14
15. • Get your build context and export it
– Delegate to EnvInject for getting environment variables used
in your build
Jenkins 15
16. • Makes a dry-run at job level
– Exectutes the jobs steps with the dry-run option
• obProperty/RunListeners
J
• uildWrappers
B
• uilders
B
• ublishers
P
• Supported plugins at the moment
– Gradle builder
– xUnit publisher
DEMO
Jenkins 16
17. • Acitivate dry-un
– on RunListeners
– on SCMs
• Add a dry-run mode to the following plugins
– Ant/Ivy (build+ publisher)
– ArtifactDeployer
Jenkins 17
18. • Trying to federate the plugins
– xUnit, xTrigger, ...
• Do not put all business value in Jenkins
– DTKit for managing metric reports (conversion,
validation, database, rest server, ...)
• Having an industry approach
– Manage your environment with the EnvInject
– Capture your build context with the BuildContextCapture
– Do not grow the number of tools in your continuous build
Jenkins 18