4. 4
Test before you push
Syntax, Workflow, Unit Tests
Test after you push
Reproducibility, Build Environments, Unit Tests
Test before you deploy
Integration Tests, Performance Tests, Merge Tests
Continuous Integration
Did I just break something?
5. 5
Code moves through a set of manual and automated gates in a feature branch
before being committed to the master branch.
Example CI Pipeline
used by OpenStack Nova project
6. 6
Installs Django library, validates data models, and runs unit tests.
Example Jenkins Build Script
for Django application
/usr/bin/virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py validate
python manage.py syncdb --noinput
python manage.py test
7. 7
Package the code
Prepare the code for distribution
Deploy the package
Push the package to the production environment
Test the deployment in production
QA the deployed application
Continuous Delivery
It works - deploy it for me.
8. 8
Example Jenkins Deploy Process
for Django application
● Package the application (either pypi or RPM)
– rpmbuild -bb build/package.spec
● Push the package to an application repository
– scp build/*.rpm yum@repo
● Pull the package down to an integration environment
– ssh host yum -y update
● Restart services on the integration environment
– ssh host service httpd restart
9. 9
In the traditional deployment model, a subset of servers are updated with the latest
build and put through UAT. Then the load balancer cuts over the new build.
Production Rollout
for Django application behind load balancer
11. 11
Consistent Delivery Format
No wars, jars, ears, tars, or RPMs.
Consistent Packaging Definition
Dockerfiles are stored alongside code and are human
readable
Built-in Deployment Infrastructure
Docker Registries simplify application deployment
Introducing Docker
Docker simplifies the delivery pipeline
15. 15
Example Jenkins Deploy Process
for Django application with Docker
● Copy the source into a new Docker image
– ADD . /webapps/polls/
● Build the new Docker image
– docker build -t rhel6-django16-polls .
● Tag the Docker image
– docker tag rhel6-django16-polls:$BUILD_NUMBER
● Push the image to the registry
– docker push ...
● Run the new image alongside the existing image
16. 16
In the docker deployment model, all servers run both the latest build and production
build during UAT.
Production Rollout with Docker
for Django application behind load balancer
17. For more information on Docker in RHEL:
http://red.ht/1Gk9w62
RH_PREStemp_light_v1_0324
18. INSERT DESIGNATOR, IF NEEDED 18
THANK YOU
plus.google.com/+RedHa
t
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatin
c
twitter.com/RedHatNew
s