Rafal Leszko (@RafalLeszko, rafal.leszko@gmail.com)
Continuous Delivery: Jenkins,
Docker and Spring Boot
Jez Humble
Continuous Delivery
The ability to get changes-features, configuration changes, bug
fixes, experiments - into production or into the hands of users
safely and quickly in a sustainable way
What is
Continuous
Delivery?
"Traditional" Delivery
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Integration + QA
Release and operation
Acceptance Tests
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Release and operation
Continuous
Integration
Integration + QA
Acceptance Tests
Continuous Integration
https://github.com/Dynatrace/ufo
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Release and operation
Continuous
Integration
Integration + QA
Acceptance Tests
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Release and operation
Continuous
Integration
Integration + QA
Acceptance Tests
"last mile"
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Release and operation
Continuous
Integration
Integration + QA
Acceptance Tests
"last mile"
Automated Tests
Automated
Testing
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Release and operation
Continuous
Integration
Integration + QA
Acceptance Tests
"last mile"
Automated Tests
Customer
"Agile" team
Centralized QA IT Operations
Analysis + Design
Development
Testing + Showcase
Release and operation
Continuous
Integration
Integration + QA
Acceptance Tests
"last mile"
Automated Tests
Configuration
Management
+
Monitoring
Continuous Delivery Pipeline
Checkout
Compile
Unit Tests
Deploy to Staging
Acceptance Tests
Release
Smoke Test
dev machine
github server
jenkins server
push
pull
Checkout
Compile
Unit Tests
Deploy to Staging
Acceptance Tests
Release
Smoke Test
issues?
● Each server has to be configured
● Different environment in staging and production
● Different Java version for different applications
● Applications using the same ports
● Versioning
server
application
app.jar
server
application
app.jar
java -jar app.jar
server
application
app2.jar
java -jar app.jar
application
app.jar
treat your servers like cattle,
not pets
Dockerfile:
FROM frolvlad/alpine-oraclejdk8:slim
ADD build/libs/exchange-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
Dockerfile:
FROM frolvlad/alpine-oraclejdk8:slim
ADD build/libs/exchange-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
docker build -t <image_name> .
$ docker run --name <container_name> <image_name>
$ docker run --name <container_name> <image_name>
Docker registry
● registry for docker
images
Docker image name
<registry_address>/<image_name>
Docker image name
<registry_address>/<image_name>
docker push <image_name>
Docker image name
<registry_address>/<image_name>
docker push <image_name>
docker pull <image_name>
Port Mapping
$ docker run -p 8080:8080 --name <container_name>
<image_name>
External Docker Host
$ docker run -p 8080:8080 --name <container_name>
<image_name>
$ docker run -H 192.168.0.15:2375 -p 8080:8080 --name
<container_name> <image_name>
Example
$ docker run -H 192.168.0.15:2375 -p 8080:8080 -d
--name exchange-rate 192.168.0.20/exchange-rate:15
dev machine
github server
jenkins server
push
pull
staging machine
production machine
deploy
acceptance test
deploy
smoke test
docker registry
push
pull
pull
Easy?

Continuous Delivery - Voxxed Days Thessaloniki 21.10.2016