voxxed days thessaloniki 2016 - continuous delivery: jenkins, docker and spring boot

56
Rafal Leszko (@RafalLeszko, [email protected]) Continuous Delivery: Jenkins, Docker and Spring Boot

Upload: voxxed-days-thessaloniki

Post on 16-Apr-2017

130 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Rafal Leszko (@RafalLeszko, [email protected])

Continuous Delivery: Jenkins, Docker and Spring Boot

Page 2: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Jez Humble

Page 3: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 4: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 5: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

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

Page 6: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 7: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

What is Continuous Delivery?

Page 8: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 9: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 10: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 11: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 12: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 13: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

"Traditional" Delivery

Customer

"Agile" team

Centralized QA IT OperationsAnalysis + Design

Development

Testing + Showcase

Integration + QARelease and operation

Acceptance Tests

Page 14: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Customer

"Agile" team

Centralized QA IT OperationsAnalysis + Design

Development

Testing + Showcase

Release and operation

Continuous Integration

Integration + QA

Acceptance Tests

Page 15: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Continuous Integration

Page 16: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

https://github.com/Dynatrace/ufo

Page 17: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 18: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Customer

"Agile" team

Centralized QA IT OperationsAnalysis + Design

Development

Testing + Showcase

Release and operation

Continuous Integration

Integration + QA

Acceptance Tests

Page 19: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Customer

"Agile" team

Centralized QA IT OperationsAnalysis + Design

Development

Testing + Showcase

Release and operation

Continuous Integration

Integration + QA

Acceptance Tests

"last mile"

Page 20: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Customer

"Agile" team

Centralized QA IT OperationsAnalysis + Design

Development

Testing + Showcase

Release and operation

Continuous Integration

Integration + QA

Acceptance Tests

"last mile"

Automated Tests

Page 21: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

AutomatedTesting

Page 22: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Customer

"Agile" team

Centralized QA IT OperationsAnalysis + Design

Development

Testing + Showcase

Release and operation

Continuous Integration

Integration + QA

Acceptance Tests

"last mile"

Automated Tests

Page 23: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

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

Page 24: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Continuous Delivery Pipeline

Page 25: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

CheckoutCompile

Unit TestsDeploy to Staging

Acceptance TestsRelease

Smoke Test

Page 26: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 27: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 28: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 29: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

dev machine

github server

jenkins server

push

pull

Page 30: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 31: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

CheckoutCompile

Unit TestsDeploy to Staging

Acceptance TestsRelease

Smoke Test

Page 32: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

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

Page 33: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 34: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

serverapplicationapp.jar

Page 35: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

serverapplicationapp.jar

java -jar app.jar

Page 36: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

server

applicationapp2.jar

java -jar app.jar

applicationapp.jar

Page 37: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 38: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

treat your servers like cattle, not pets

Page 39: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 40: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 41: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 42: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Dockerfile:

FROM frolvlad/alpine-oraclejdk8:slimADD build/libs/vox-0.0.1-SNAPSHOT.jar app.jarENTRYPOINT ["java","-jar","app.jar"]

Page 43: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

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> .

Page 44: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

$ docker run --name <container_name> <image_name>

Page 45: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

$ docker run --name <container_name> <image_name>

Page 46: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Docker registry

● registry for docker images

Page 47: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Docker image name

<registry_address>/<image_name>

Page 48: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Docker image name

<registry_address>/<image_name>

docker push <image_name>

Page 49: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Docker image name

<registry_address>/<image_name>

docker push <image_name>

docker pull <image_name>

Page 50: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Port Mapping

$ docker run -p 8080:8080 --name <container_name> <image_name>

Page 51: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

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>

Page 52: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Example

$ docker run -H 192.168.0.15:2375 -p 8080:8080 -d --name exchange-rate 192.168.0.20/exchange-rate:15

Page 53: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

dev machine

github server

jenkins server

push

pull

staging machine

production machine

deploy

acceptance test

deploy

smoke test

docker registry

push

pull

pull

Page 54: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot
Page 55: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Easy?

Page 56: Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spring Boot

Questions?