voxxed days thessaloniki 2016 - continuous delivery: jenkins, docker and spring boot
TRANSCRIPT
Rafal Leszko (@RafalLeszko, [email protected])
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 OperationsAnalysis + Design
Development
Testing + Showcase
Integration + QARelease and operation
Acceptance Tests
Customer
"Agile" team
Centralized QA IT OperationsAnalysis + 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 OperationsAnalysis + Design
Development
Testing + Showcase
Release and operation
Continuous Integration
Integration + QA
Acceptance Tests
Customer
"Agile" team
Centralized QA IT OperationsAnalysis + Design
Development
Testing + Showcase
Release and operation
Continuous Integration
Integration + QA
Acceptance Tests
"last mile"
Customer
"Agile" team
Centralized QA IT OperationsAnalysis + Design
Development
Testing + Showcase
Release and operation
Continuous Integration
Integration + QA
Acceptance Tests
"last mile"
Automated Tests
AutomatedTesting
Customer
"Agile" team
Centralized QA IT OperationsAnalysis + Design
Development
Testing + Showcase
Release and operation
Continuous Integration
Integration + QA
Acceptance Tests
"last mile"
Automated Tests
Customer
"Agile" team
Centralized QA IT OperationsAnalysis + Design
Development
Testing + Showcase
Release and operation
Continuous Integration
Integration + QA
Acceptance Tests
"last mile"
Automated Tests
Configuration Management
+Monitoring
Continuous Delivery Pipeline
CheckoutCompile
Unit TestsDeploy to Staging
Acceptance TestsRelease
Smoke Test
dev machine
github server
jenkins server
push
pull
CheckoutCompile
Unit TestsDeploy to Staging
Acceptance TestsRelease
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
serverapplicationapp.jar
serverapplicationapp.jar
java -jar app.jar
server
applicationapp2.jar
java -jar app.jar
applicationapp.jar
treat your servers like cattle, not pets
Dockerfile:
FROM frolvlad/alpine-oraclejdk8:slimADD build/libs/vox-0.0.1-SNAPSHOT.jar app.jarENTRYPOINT ["java","-jar","app.jar"]
Dockerfile:
FROM frolvlad/alpine-oraclejdk8:slimADD build/libs/vox-0.0.1-SNAPSHOT.jar app.jarENTRYPOINT ["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?
Questions?