Fundamentals of Continuous Integration: Jenkins
Fundamentals of Continuous Integration: Jenkins
Fundamentals of
Continuous Integration
with
Jenkins and server
by Slavey Karadzhov
Fundamentals of Continuous Integration with Jenkins and Zend Server
Introduction
Continuous Delivery is a methodology, a mindset change and a leadership practice that focuses on how to
achieve rapid application delivery throughout the software application lifecycle. This relies on the adoption of
automation to streamline manual processes and enforce consistency and repeatability in the software delivery
pipeline, as well as enhanced collaboration and shared metrics and processes across Dev and Ops teams [1].
One of the fundamental requirements for establishing Continuous Delivery is the implementation of an
automated Continuous Integration system that automatically and consistently builds the application from
code components and resources to a deployable package.
This paper will demonstrate the steps and advantages of implementing a Continuous Integration system
utilizing Jenkins and the Zend Server Continuous Delivery platform.
Developers Pull and Run unit tests Assemble Automated Automated Project Provide
working in organize and static application provisioning application specific instant
branches. application code analysis artifacts of deployment functional feedback and
Trigger CI artifacts and tools to including infrastructure across all testing & diagnostics
when dependencies ensure code dependencies resources & runtime production on deployed
merging quality & configuration platforms environments sign-off application to
into main into deployable development
master validated and
branch/ package operations
trunk teams
A key principle of a Continuous Delivery approach is that the application is always production ready. This
means that all artifacts required to build the application are stored and managed in a version control system,
and that code must be consistently and regularly checked in to the source mainline to ensure small increments
between builds. Basically, the code in mainline is expected to be continuously production ready.
There are three important and foundational elements that underpin any Continuous Integration System.
1. Commitment to building tests. The first is one of the most important elements; the commitment of the
development team to produce a comprehensive test suite at the unit level and functional level together
with their code. This is essential to achieve the “guaranteed” level of code quality that can be production
ready at any moment.
2. Never break the build. The goal is that the application must be ready to be built, packaged and deployed
on every committed change. This (of course), means that broken or untested code should never be
committed.
3. Version Control. Another foundational element to Continuous Integration is version control. To be ready
to focus on implementing Continuous Integration, the code has to be managed by strict version control
policies.
When the code is always production ready, managed by strict version control policies, and the development
team has adopted an agile development and unit testing practice, organizations can move to implement a
Continuous Integration environment.
Each distinct stage in the Continuous Delivery blueprint can be then implemented to complete the Continuous
Delivery workflow. Below is a sequence diagram explaining the suggested flow of steps in a Continuous
Delivery workflow.
Check in
Trigger
New Code
Continuous
Feedback Integration Failure
Check in
Trigger
Fix
Continuous
Integration Trigger
Automated
testing
Developers
Failure
Diagnostics
Check in
Trigger
Fix
Trigger
Provision environment
and deploy application
Production
Trigger Promotion Production
Production Feedback and diagnostics Approval
Continuous Integration
The Continuous Integration approach is designed to create an automation environment ensuring that every
change to the application results in a releasable version, and that any version can be built automatically at
the push of a button. At a broader level, Continuous Delivery aims to make the entire end to end release
process of that application hands free (automated) where the built application (from Continuous Integration
system), is delivered frequently to the testing and then production environments. The goal of the Continuous
Delivery cycle is to ensure consistency and high quality by delivering fast user centric feedback [2]. Continuous
Integration is an important subset of Continuous Delivery.
The goal of Continuous Integration is to automate traditionally manual stages in the application development
process in which a feature complete version of the software is moving for the first time from development to
the system integration and integration testing phase.
With Continuous Integration, applications are built from a very early stage in the development process
at specific frequent intervals or on every change checked in by the developers. This effectively eliminates
the need for integration testing and the cost associated with developers spending time on this phase. The
enablement of frequent incremental builds and mandating a comprehensive automated testing process also
allows developers to detect problems early and as a result, ensure higher application quality.
4. The Continuous Integration server gets the source code from the repository.
See illustration
on next page 5. The Continuous Integration server runs unit tests to validate the quality.
6. The Continuous Integration server packages the files into distributable units
and deploys the package onto a test server and validates the package and
basic functionality by running automated functional tests.
7. The Continuous Integration server deploys the same package on the testing
environments for thorough user acceptance testing.
8. Once the acceptance tests are successful the same package is deployed on
the production servers. Implementing infrastructure and release automation
enables end to end automation and allows provisioning and deploying the
application packages on all servers with a click of a button.
Developers
commit
push
Source
Control
Jenkins
Cl
Testing Staging
Production
Automated Cluster
Metrics & Trends
Cluster Deployment Provisioning
Dashboards
PHP Stack
Consistency Dependencies & Cloud Elasticity
Root Cause Analysis
Versioning
Error Detection Multi-Server
Shared Dev/Ops
Automated Rollback Config Mgmt.
Visibility
App and Library
Packaging Auto-deploy Clustering & H/A
Change Tracking &
on Scale-Up
Auditing
Auto scaling
About Zend
Zend partners with businesses to rapidly deliver modern apps across web, mobile and
cloud. We helped establish the PHP language, which today powers over 200 million
applications and web sites. Our flagship offering, Zend Server, is the leading Application
Platform for developing, deploying and managing business-critical applications in PHP.
More than 40,000 companies rely on Zend solutions, including NYSE Euronext, BNP
Paribas, Bell Helicopter, France Telecom and other leading brands worldwide.
Corporate Headquarters: Zend Technologies, Inc. 19200 Stevens Creek Blvd. Cupertino, CA 95014, USA · Tel 1-408-253-8800 · Fax 1-408-253-8801
Central Europe: (Germany, Austria, Switzerland) Zend Technologies GmbH, St.-Martin-Str. 53, 81669 Munich, Germany · Tel +49-89-516199-0 · Fax +49-89-516199-20
International: Zend Technologies Ltd. 12 Abba Hillel Street, Ramat Gan, Israel 52506 · Tel 972-3-753-9500 · Fax 972-3-613-9671
France: Zend Technologies SARL, 105 rue Anatole France, 92300 Levallois-Perret, France · Tel +33-1-4855-0200 · Fax +33-1-4812-3132
Italy: Zend Technologies, Largo Richini 6, 20122 Milano, Italy · Tel +39-02-5821-5832 · Fax +39-02-5821-5400
Ireland: Zend Technologies, The Digital Court, Rainsford Street, Dublin 8, Ireland · Tel +353-1-6908019
© 2014 Zend Corporation. Zend and Zend Server are registered trademarks of Zend Technologies Ltd.
All other trademarks are the property of their respective owners.