SlideShare a Scribd company logo
1 of 93
Download to read offline
@mgrzejszczak
Continuous Deployment to the Cloud
Marcin Grzejszczak, @mgrzejszczak
2
Spring Cloud developer at Pivotal
Working mostly on
● Spring Cloud Sleuth
● Spring Cloud Contract
● Spring Cloud Pipelines
About me
Twitter: @mgrzejszczak
Blog: http://toomuchcoding.com
3
What problem are we trying to solve?
4
The necessity to create a deployment
pipeline from scratch for each new project
5
Spring Cloud Pipelines
• opinionated template of a deployment pipeline
• based on good practices from different projects
• we believe in the “Infrastructure as Code” approach
• in case of automation server going down you can recover
everything in no time
• the automation server setup should be automated too!
• you can even write tests for your pipelines
6
Spring Cloud Pipelines
• we support following automation servers out of the box
• Concourse
• Jenkins using Jenkins Job DSL plugin
• Jenkins using Jenkinsfile with Blue Ocean
• logic of all steps done via Bash scripts
• you can convert the internals to suit your needs
• you can use whatever automation server you want
• supports Maven & Gradle
7
Spring Cloud Pipelines - Concourse
8
Concourse
9
Spring Cloud Pipelines - Jenkins Job DSL
10
Jenkins Job DSL
11
Spring Cloud Pipelines - Jenkinsfile & Blue Ocean
12
Jenkinsfile
13
SPRING CLOUD PIPELINES
REPOSITORY & AUTOMATION SERVER
DEMO
14
WHAT ARE WE GOING TO WORK WITH?
15
Demo - flow
GITHUB-WEBHOOK GITHUB-ANALYTICS
AMQPHOOK
16
Definitions
• Build environment is a machine where the building of the application takes
place. It’s a CI / CD tool worker
• Test is an environment where you can deploy an application to test it. It
doesn’t resemble production
• Stage is an environment where you can deploy an application to test it. It
does resemble production. Typically shared by multiple teams
• Prod is a production environment where we want our tested applications to
be deployed for our customers
17
Why do we deploy software?
• We’re paid for delivering business value
• Features are done when they are deployed to production
• It’s better to deploy frequently for faster feedback
• It’s better to fail the deployment pipeline as fast as possible
• Deployments should take place in a standardised, automated fashion
• Your deployment pipeline should test rollback
• That way you can perform A/B or zero downtime deployment to
production
18
Spring Cloud Pipelines
• We’re paid for delivering business value
• Features are done when they are deployed to production
• It’s better to deploy frequently for faster feedback
• It’s better to fail the deployment pipeline as fast as possible
• Deployments should take place in a standardised, automated fashion
• Your deployment pipeline should test rollback
• That way you can perform A/B or zero downtime deployment to
production
19
Spring Cloud Pipelines
20
Problem - slow feedback
• Nobody wants to wait until the end of the pipeline to see that something is
not working fine
• We want to fail fast - even during build time
• If integration is faulty
• If our API is backward incompatible
• There should be no need to wait until end to end tests are executed
21
Solution - fail fast
• We’re running unit and integration tests during build time
• To test faulty integration we use Spring Cloud Contract for HTTP / messaging
• Producer defines a contract
• From the contract
o tests are generated to see if the producer is not lying
o stubs are generated for consumers to use
• Consumer can reuse it without running the producer
• Fail at build time if integration fails (fail fast!)
• All stubs reside in Nexus / Artifactory (thus can be reused)
22
CONTRACT TESTS DEMO
(BREAKING CONSUMER)
23
Initial contract (producer)
Body contains username and
repository
24
Generated test (producer)
Body contains username and
repository
25
Expected model (consumer)
26
Passing contract test (consumer)
27
Breaking contract (producer)
Was username and repository
and we’ve made a breaking
change by converting those to
user and repo
28
New, generated test (producer)
Was username and repository
and we’ve made a breaking
change by converting those to
user and repo
29
Installing broken stubs locally (producer)
New stubs with backward
incompatible changes
installed in Maven local
30
Broken contract test locally (consumer)
Expected repository and
username but got repo
and user
31
CONTRACT TESTS DEMO
(BREAKING PRODUCER)
32
Contract for deletion of issues
33
Demo - backward incompatible API change
GITHUB-ANALYTICS V1
with DELETE
@ /issues
Contracts
V1
with
DELETE @
/issues
GITHUB-ANALYTICS V2
removed DELETE
@ /issues
Contracts
V2
removed
DELETE @
/issues
GITHUB-ANALYTICS V2
removed DELETE
@ /issues
Contracts
V1
with
DELETE @
/issues
34
Backward incompatible changes of the API
We delete
the
contract
and the
DELETE
endpoint
35
Broken build
Current
implementation
does not support
old contracts
36
Broken build
37
Broken build
38
Spring Cloud Pipelines
• We’re paid for delivering business value
• Features are done when they are deployed to production
• It’s better to deploy frequently for faster feedback
• It’s better to fail the deployment pipeline as fast as possible
• Deployments should take place in a standardised, automated fashion
• Your deployment pipeline should test rollback
• That way you can perform A/B or zero downtime deployment to
production
39
Spring Cloud Pipelines
40
STANDARDISATION GIVES LOWER
SUPPORT COSTS AND MORE CHANCES
OF PEOPLE ROTATION
41
Solution - PaaS & tooling
• Use a PaaS to standardise the way you deploy and monitor your software
• Spring Cloud Pipelines uses Cloud Foundry [1] as a PaaS implementation
• For the demo purposes we’re using PCF Dev [2]
• Cloud Foundry abstracts the application governance from underlying
infrastructure
• you can deploy, scale, manage applications in the same way if CF is
running on your laptop, Amazon, Google, Azure etc.
• Database schema upgrade is done via tools like Flyway [3] or Liquibase [4]
[1] https://www.cloudfoundry.org
[2] https://pivotal.io/pcf-dev
[3] https://flywaydb.org/
[4] http://www.liquibase.org/
42
Deploying apps with CF
https://www.cloudfoundry.org
https://pivotal.io/pcf-dev
$ cf push
43
CF DEMO
44
Pivotal Cloud Foundry Apps Manager
Different spaces for
different environments
45
Pivotal Cloud Foundry Apps Manager
Running application in
production space
46
Pivotal Cloud Foundry Apps Manager
Audit events of what
happened with your
instances State of your instances
Number of instance you
want to run
Limits for memory and disk
47
Pivotal Cloud Foundry Apps Manager
Bound services to the
application. Credentials
get injected automatically
48
Solution - schema upgrade standardisation (Flyway example)
49
DEMO OF CONVENTIONS IN THE CODE
50
Spring Cloud Pipelines
After the application got deployed to test
environment
• The database schema gets updated upon
application startup
• We run a handful of smoke tests to see if crucial
parts of our application are working fine
• We want to test if the app is properly packaged
• The application is surrounded by stubs - no real
integrations take place
• Spring Cloud Contract Stub Runner Boot app is
responsible for serving stubs
51
Problem - rollback DB
• Deployment pipelines should test whether the application can be rolled back
• Rolling back database changes is extremely difficult
• Especially if you deploy once every 6 months (the number of changes is
gigantic)
• How can you roll back a deletion of a column?
52
Solution - application rollback
• The easiest solution is… NOT TO DB ROLLBACK
• Perform only backward compatible changes (always add data)
• Or perform backward incompatible changes
in a backward compatible way [1]
• Roll back the application only (the JAR)
• The application and DB changes need to be
backward compatible
• That way you can ensure that two applications (old
/ new versions) can run simultaneously at the same time
[1] https://spring.io/blog/2016/05/31/zero-downtime-deployment-with-a-database
53
Demo - backward incompatible DB change
GITHUB-ANALYTICS V1
with repository
DB
V1
with
repository
GITHUB-ANALYTICS V2
with repo
DB
V2
with
repo
GITHUB-ANALYTICS V1
with repository
DB
V2
with
repo
54
BACKWARD INCOMPATIBLE
DB CHANGE DEMO
55
Demo - initial DB state
56
Demo - initial state
57
Demo - backward incompatible DB change
58
Demo - backward incompatible DB change
59
ROLLBACK DEMO
60
Demo - first run
61
Demo - deploying backward incompatible DB change
62
Demo - errors in the app logs Old version can’t insert
data to a missing DB
column
63
Spring Cloud Pipelines
64
65
Problem - end to end tests
• It takes ages to run end to end tests
• They are slow and brittle
• QA department writes an E2E for every feature we have
• E2E environment setup
• one environment shared between all applications?
• one environment per application?
• Surrounding apps should be deployed in
• production versions?
• development versions?
66
Solution - don’t do E2E?
• Regardless of the time spent on QA / UAT you can still have bugs on
production
• Assuming that you ...
• embrace failure
• introduce monitoring of business KPIs
• introduce alerting over the metrics
• ensure that you can rollback on production
• … you could stop doing any end to end tests
67
Spring Cloud Pipelines
• The whole step is optional
• it’s left there cause the “no e2e tests”
approach is controversial
• Deploy to stage and running e2e tests are manual
steps
• you have to wait for your turn for the env
• some manual work has to be done to purge
stale data etc.
68
Spring Cloud Pipelines
• We’re paid for delivering business value
• Features are done when they are deployed to production
• It’s better to deploy frequently for faster feedback
• It’s better to fail the deployment pipeline as fast as possible
• Deployments should take place in a standardised, automated fashion
• Your deployment pipeline should test rollback
• That way you can perform A/B or zero downtime deployment to
production
69
Spring Cloud Pipelines
70
Problem - deployment to production
• We don’t want to deploy the application to production at night
• We want to treat a production deployment like any other deployment
• We’d like to be able to perform A/B testing and zero downtime deployment
• We’d like to easily rollback when sth goes wrong
71
Solution - CF + SC Pipelines
• Our application has KPI monitoring in place
• Alerting are set for KPIs
• It has been tested that the application can be easily rolled back
• Cloud Foundry can take care of zero downtime deployment
72
Spring Cloud Pipelines
• Deploy to prod deploys the pipeline version of the
app to production next to the current production
version
• Complete switch over allows to delete the old
instance and leave only the new one
• Once deployed we tag the repo with
prod/VERSION_NUMBER
73
A/B ON CF
DEMO
74
Two versions running at the same time
Two versions registered
under same hostname
Old instance
New instance
75
After complete switch over
One app remains
76
Demo - alerts
GITHUB-WEBHOOK GITHUB-ANALYTICS
AMQPPOST POLL
77
Demo - alerts
GITHUB-ANALYTICS
DELETE
POLL PUSH
78
METRICS & ALERTS DEMO
79
Insert some data to the service
80
Grafana Satisfactory number of
issues
Threshold below which
alerts will be sent
Metric configuration
81
Slack notifications
82
Delete all issues
83
Grafana - alert
The metric went down to 0
84
Slack notifications
85
Spring Cloud Pipelines
86
Customizing Spring Cloud Pipelines
87
Customizing Spring Cloud Pipelines
$ curl -LOk https://github.com/spring-cloud/spring-cloud-pipelines/archive/v1.0.0.M5.zip
$ unzip v1.0.0.M5.zip
$ cd spring-cloud-pipelines-v1.0.0.M5
$ git init
$ # modify the pipelines to suit your needs
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin ${YOUR_REPOSITORY_URL}
$ git push origin master
88
Customizing Spring Cloud Pipelines
89
Summary
• Continuous Deployment allows you to continuously deliver business value
• Spring Cloud Pipelines gives you OOB tooling to test your software via
• unit and integration testing
• contract testing
• rollback testing
• Spring Cloud Pipelines allows you to easily adjust the deployment pipeline to
suit your company’s needs
• Thanks to Cloud Foundry you can easily do A/B & zero downtime deployment
90
91
▪ Github Analytics: https://github.com/spring-cloud-samples/github-analytics
▪ Github Webhook: https://github.com/spring-cloud-samples/github-webhook
▪ SC-Pipelines documentation: https://cloud.spring.io/spring-cloud-pipelines/
▪ No end to end tests
• https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html
• http://www.alwaysagileconsulting.com/articles/end-to-end-testing-considered-harmful/
▪ Prometheus on CF https://github.com/mkuratczyk/prometheus-on-PCF
▪ Prometheus for PCF Dev (Docker compose) https://github.com/vegasbrianc/prometheus
▪ Pivotal Web Services trial : https://run.pivotal.io/
▪ PCF Dev (CF on your laptop) : https://docs.pivotal.io/pcf-dev/
Links
92
Learn More. Stay Connected.
▪ Read the docs
http://cloud.spring.io/spring-cloud-pipelines/
▪ Talk to us on Gitter
https://gitter.im/spring-cloud/spring-cloud-pipelines
Twitter: twitter.com/springcentral
YouTube: spring.io/video
LinkedIn: spring.io/linkedin
Google Plus: spring.io/gplus
93
mgrzejszczak

More Related Content

What's hot

Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICDKnoldus Inc.
 
TMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasTMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasKJR
 
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationQConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationRodrigo Russo
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardTechWell
 
Agnostic Continuous Delivery
Agnostic Continuous DeliveryAgnostic Continuous Delivery
Agnostic Continuous DeliveryHervé Leclerc
 
Continuous Delivery Distilled
Continuous Delivery DistilledContinuous Delivery Distilled
Continuous Delivery DistilledMatt Callanan
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CloudBees
 
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...Gene Kim
 
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...Puppet
 
Transforming Organizations with CI/CD
Transforming Organizations with CI/CDTransforming Organizations with CI/CD
Transforming Organizations with CI/CDCprime
 
CI/CD Overview
CI/CD OverviewCI/CD Overview
CI/CD OverviewAn Nguyen
 
From Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOpsFrom Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOpsLuca Minudel
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopMichael Palotas
 
Continuous Testing in DevOps
Continuous Testing in DevOpsContinuous Testing in DevOps
Continuous Testing in DevOpsTechWell
 
Orchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release PipelineOrchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release PipelineDevOps.com
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersAmazon Web Services
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101Hazzim Anaya
 
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Mike Villiger
 

What's hot (20)

Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
How to Build a DevOps Toolchain
How to Build a DevOps ToolchainHow to Build a DevOps Toolchain
How to Build a DevOps Toolchain
 
TMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasTMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael Palotas
 
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationQConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New Standard
 
Agnostic Continuous Delivery
Agnostic Continuous DeliveryAgnostic Continuous Delivery
Agnostic Continuous Delivery
 
Continuous Delivery Distilled
Continuous Delivery DistilledContinuous Delivery Distilled
Continuous Delivery Distilled
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
 
From Continuous Integration to DevOps
From Continuous Integration to DevOpsFrom Continuous Integration to DevOps
From Continuous Integration to DevOps
 
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
 
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
 
Transforming Organizations with CI/CD
Transforming Organizations with CI/CDTransforming Organizations with CI/CD
Transforming Organizations with CI/CD
 
CI/CD Overview
CI/CD OverviewCI/CD Overview
CI/CD Overview
 
From Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOpsFrom Continuous Integration to Continuous Delivery and DevOps
From Continuous Integration to Continuous Delivery and DevOps
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Continuous Testing in DevOps
Continuous Testing in DevOpsContinuous Testing in DevOps
Continuous Testing in DevOps
 
Orchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release PipelineOrchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release Pipeline
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containers
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101
 
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
 

Similar to Continuous Deployment to the Cloud with Spring Cloud Pipelines

Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of LifeMelissa Benua
 
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsSetting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsDaniel Stange
 
Orchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release PipelineOrchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release PipelineDevOps.com
 
2016 09-dev opsjourney-devopsdaysoslo
2016 09-dev opsjourney-devopsdaysoslo2016 09-dev opsjourney-devopsdaysoslo
2016 09-dev opsjourney-devopsdaysosloJon Arild Tørresdal
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийVitebsk Miniq
 
Jenkins Workflow Webinar - Dec 10, 2014
Jenkins Workflow Webinar - Dec 10, 2014Jenkins Workflow Webinar - Dec 10, 2014
Jenkins Workflow Webinar - Dec 10, 2014CloudBees
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksGoDataDriven
 
Building and Managing Reliable Infrastructure with Chef and Chef Delivery
Building and Managing Reliable Infrastructure with Chef and Chef DeliveryBuilding and Managing Reliable Infrastructure with Chef and Chef Delivery
Building and Managing Reliable Infrastructure with Chef and Chef DeliveryMandi Walls
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDavide Benvegnù
 
Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)Mike McGarr
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsSOASTA
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps JumpstartOri Donner
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsSOASTA
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Mary Joy Sabal
 
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...Inflectra
 
CI CD OPS WHATHAVEYOU
CI CD OPS WHATHAVEYOUCI CD OPS WHATHAVEYOU
CI CD OPS WHATHAVEYOUHanokh Aloni
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery AppliedExcella
 
Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied (Agile Richmond)Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied (Agile Richmond)Mike McGarr
 

Similar to Continuous Deployment to the Cloud with Spring Cloud Pipelines (20)

Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
 
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsSetting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce Apps
 
Orchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release PipelineOrchestrate Your End-to-end Mainframe Application Release Pipeline
Orchestrate Your End-to-end Mainframe Application Release Pipeline
 
2016 09-dev opsjourney-devopsdaysoslo
2016 09-dev opsjourney-devopsdaysoslo2016 09-dev opsjourney-devopsdaysoslo
2016 09-dev opsjourney-devopsdaysoslo
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
 
Jenkins Workflow Webinar - Dec 10, 2014
Jenkins Workflow Webinar - Dec 10, 2014Jenkins Workflow Webinar - Dec 10, 2014
Jenkins Workflow Webinar - Dec 10, 2014
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure Databricks
 
Building and Managing Reliable Infrastructure with Chef and Chef Delivery
Building and Managing Reliable Infrastructure with Chef and Chef DeliveryBuilding and Managing Reliable Infrastructure with Chef and Chef Delivery
Building and Managing Reliable Infrastructure with Chef and Chef Delivery
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps world
 
Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)Continuous delivery applied (RJUG)
Continuous delivery applied (RJUG)
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18
 
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
Inflectracon2020: Advantages of Integrating a DevSecOps Pipeline with the Spi...
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery Applied
 
CI CD OPS WHATHAVEYOU
CI CD OPS WHATHAVEYOUCI CD OPS WHATHAVEYOU
CI CD OPS WHATHAVEYOU
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery Applied
 
Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied (Agile Richmond)Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied (Agile Richmond)
 

More from Marcin Grzejszczak

Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureMarcin Grzejszczak
 
Consumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @GeeconConsumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @GeeconMarcin Grzejszczak
 
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMicroservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMarcin Grzejszczak
 
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUGConsumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUGMarcin Grzejszczak
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureMarcin Grzejszczak
 
Spring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice ArchitectureSpring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice ArchitectureMarcin Grzejszczak
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureMarcin Grzejszczak
 
Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)Marcin Grzejszczak
 
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMicroservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMarcin Grzejszczak
 
Microservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and ZipkinMicroservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and ZipkinMarcin Grzejszczak
 
Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015Marcin Grzejszczak
 
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 ConfituraStick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 ConfituraMarcin Grzejszczak
 
Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...Marcin Grzejszczak
 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsMarcin Grzejszczak
 

More from Marcin Grzejszczak (15)

Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Consumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @GeeconConsumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @Geecon
 
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMicroservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
 
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUGConsumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Spring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice ArchitectureSpring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice Architecture
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)
 
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMicroservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
 
Microservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and ZipkinMicroservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and Zipkin
 
Spring Cloud’s Groovy
Spring Cloud’s GroovySpring Cloud’s Groovy
Spring Cloud’s Groovy
 
Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015
 
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 ConfituraStick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
 
Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...
 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transforms
 

Recently uploaded

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsDILIPKUMARMONDAL6
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptxNikhil Raut
 

Recently uploaded (20)

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teams
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptx
 

Continuous Deployment to the Cloud with Spring Cloud Pipelines

  • 1. @mgrzejszczak Continuous Deployment to the Cloud Marcin Grzejszczak, @mgrzejszczak
  • 2. 2 Spring Cloud developer at Pivotal Working mostly on ● Spring Cloud Sleuth ● Spring Cloud Contract ● Spring Cloud Pipelines About me Twitter: @mgrzejszczak Blog: http://toomuchcoding.com
  • 3. 3 What problem are we trying to solve?
  • 4. 4 The necessity to create a deployment pipeline from scratch for each new project
  • 5. 5 Spring Cloud Pipelines • opinionated template of a deployment pipeline • based on good practices from different projects • we believe in the “Infrastructure as Code” approach • in case of automation server going down you can recover everything in no time • the automation server setup should be automated too! • you can even write tests for your pipelines
  • 6. 6 Spring Cloud Pipelines • we support following automation servers out of the box • Concourse • Jenkins using Jenkins Job DSL plugin • Jenkins using Jenkinsfile with Blue Ocean • logic of all steps done via Bash scripts • you can convert the internals to suit your needs • you can use whatever automation server you want • supports Maven & Gradle
  • 9. 9 Spring Cloud Pipelines - Jenkins Job DSL
  • 11. 11 Spring Cloud Pipelines - Jenkinsfile & Blue Ocean
  • 13. 13 SPRING CLOUD PIPELINES REPOSITORY & AUTOMATION SERVER DEMO
  • 14. 14 WHAT ARE WE GOING TO WORK WITH?
  • 15. 15 Demo - flow GITHUB-WEBHOOK GITHUB-ANALYTICS AMQPHOOK
  • 16. 16 Definitions • Build environment is a machine where the building of the application takes place. It’s a CI / CD tool worker • Test is an environment where you can deploy an application to test it. It doesn’t resemble production • Stage is an environment where you can deploy an application to test it. It does resemble production. Typically shared by multiple teams • Prod is a production environment where we want our tested applications to be deployed for our customers
  • 17. 17 Why do we deploy software? • We’re paid for delivering business value • Features are done when they are deployed to production • It’s better to deploy frequently for faster feedback • It’s better to fail the deployment pipeline as fast as possible • Deployments should take place in a standardised, automated fashion • Your deployment pipeline should test rollback • That way you can perform A/B or zero downtime deployment to production
  • 18. 18 Spring Cloud Pipelines • We’re paid for delivering business value • Features are done when they are deployed to production • It’s better to deploy frequently for faster feedback • It’s better to fail the deployment pipeline as fast as possible • Deployments should take place in a standardised, automated fashion • Your deployment pipeline should test rollback • That way you can perform A/B or zero downtime deployment to production
  • 20. 20 Problem - slow feedback • Nobody wants to wait until the end of the pipeline to see that something is not working fine • We want to fail fast - even during build time • If integration is faulty • If our API is backward incompatible • There should be no need to wait until end to end tests are executed
  • 21. 21 Solution - fail fast • We’re running unit and integration tests during build time • To test faulty integration we use Spring Cloud Contract for HTTP / messaging • Producer defines a contract • From the contract o tests are generated to see if the producer is not lying o stubs are generated for consumers to use • Consumer can reuse it without running the producer • Fail at build time if integration fails (fail fast!) • All stubs reside in Nexus / Artifactory (thus can be reused)
  • 23. 23 Initial contract (producer) Body contains username and repository
  • 24. 24 Generated test (producer) Body contains username and repository
  • 27. 27 Breaking contract (producer) Was username and repository and we’ve made a breaking change by converting those to user and repo
  • 28. 28 New, generated test (producer) Was username and repository and we’ve made a breaking change by converting those to user and repo
  • 29. 29 Installing broken stubs locally (producer) New stubs with backward incompatible changes installed in Maven local
  • 30. 30 Broken contract test locally (consumer) Expected repository and username but got repo and user
  • 33. 33 Demo - backward incompatible API change GITHUB-ANALYTICS V1 with DELETE @ /issues Contracts V1 with DELETE @ /issues GITHUB-ANALYTICS V2 removed DELETE @ /issues Contracts V2 removed DELETE @ /issues GITHUB-ANALYTICS V2 removed DELETE @ /issues Contracts V1 with DELETE @ /issues
  • 34. 34 Backward incompatible changes of the API We delete the contract and the DELETE endpoint
  • 38. 38 Spring Cloud Pipelines • We’re paid for delivering business value • Features are done when they are deployed to production • It’s better to deploy frequently for faster feedback • It’s better to fail the deployment pipeline as fast as possible • Deployments should take place in a standardised, automated fashion • Your deployment pipeline should test rollback • That way you can perform A/B or zero downtime deployment to production
  • 40. 40 STANDARDISATION GIVES LOWER SUPPORT COSTS AND MORE CHANCES OF PEOPLE ROTATION
  • 41. 41 Solution - PaaS & tooling • Use a PaaS to standardise the way you deploy and monitor your software • Spring Cloud Pipelines uses Cloud Foundry [1] as a PaaS implementation • For the demo purposes we’re using PCF Dev [2] • Cloud Foundry abstracts the application governance from underlying infrastructure • you can deploy, scale, manage applications in the same way if CF is running on your laptop, Amazon, Google, Azure etc. • Database schema upgrade is done via tools like Flyway [3] or Liquibase [4] [1] https://www.cloudfoundry.org [2] https://pivotal.io/pcf-dev [3] https://flywaydb.org/ [4] http://www.liquibase.org/
  • 42. 42 Deploying apps with CF https://www.cloudfoundry.org https://pivotal.io/pcf-dev $ cf push
  • 44. 44 Pivotal Cloud Foundry Apps Manager Different spaces for different environments
  • 45. 45 Pivotal Cloud Foundry Apps Manager Running application in production space
  • 46. 46 Pivotal Cloud Foundry Apps Manager Audit events of what happened with your instances State of your instances Number of instance you want to run Limits for memory and disk
  • 47. 47 Pivotal Cloud Foundry Apps Manager Bound services to the application. Credentials get injected automatically
  • 48. 48 Solution - schema upgrade standardisation (Flyway example)
  • 49. 49 DEMO OF CONVENTIONS IN THE CODE
  • 50. 50 Spring Cloud Pipelines After the application got deployed to test environment • The database schema gets updated upon application startup • We run a handful of smoke tests to see if crucial parts of our application are working fine • We want to test if the app is properly packaged • The application is surrounded by stubs - no real integrations take place • Spring Cloud Contract Stub Runner Boot app is responsible for serving stubs
  • 51. 51 Problem - rollback DB • Deployment pipelines should test whether the application can be rolled back • Rolling back database changes is extremely difficult • Especially if you deploy once every 6 months (the number of changes is gigantic) • How can you roll back a deletion of a column?
  • 52. 52 Solution - application rollback • The easiest solution is… NOT TO DB ROLLBACK • Perform only backward compatible changes (always add data) • Or perform backward incompatible changes in a backward compatible way [1] • Roll back the application only (the JAR) • The application and DB changes need to be backward compatible • That way you can ensure that two applications (old / new versions) can run simultaneously at the same time [1] https://spring.io/blog/2016/05/31/zero-downtime-deployment-with-a-database
  • 53. 53 Demo - backward incompatible DB change GITHUB-ANALYTICS V1 with repository DB V1 with repository GITHUB-ANALYTICS V2 with repo DB V2 with repo GITHUB-ANALYTICS V1 with repository DB V2 with repo
  • 55. 55 Demo - initial DB state
  • 57. 57 Demo - backward incompatible DB change
  • 58. 58 Demo - backward incompatible DB change
  • 61. 61 Demo - deploying backward incompatible DB change
  • 62. 62 Demo - errors in the app logs Old version can’t insert data to a missing DB column
  • 64. 64
  • 65. 65 Problem - end to end tests • It takes ages to run end to end tests • They are slow and brittle • QA department writes an E2E for every feature we have • E2E environment setup • one environment shared between all applications? • one environment per application? • Surrounding apps should be deployed in • production versions? • development versions?
  • 66. 66 Solution - don’t do E2E? • Regardless of the time spent on QA / UAT you can still have bugs on production • Assuming that you ... • embrace failure • introduce monitoring of business KPIs • introduce alerting over the metrics • ensure that you can rollback on production • … you could stop doing any end to end tests
  • 67. 67 Spring Cloud Pipelines • The whole step is optional • it’s left there cause the “no e2e tests” approach is controversial • Deploy to stage and running e2e tests are manual steps • you have to wait for your turn for the env • some manual work has to be done to purge stale data etc.
  • 68. 68 Spring Cloud Pipelines • We’re paid for delivering business value • Features are done when they are deployed to production • It’s better to deploy frequently for faster feedback • It’s better to fail the deployment pipeline as fast as possible • Deployments should take place in a standardised, automated fashion • Your deployment pipeline should test rollback • That way you can perform A/B or zero downtime deployment to production
  • 70. 70 Problem - deployment to production • We don’t want to deploy the application to production at night • We want to treat a production deployment like any other deployment • We’d like to be able to perform A/B testing and zero downtime deployment • We’d like to easily rollback when sth goes wrong
  • 71. 71 Solution - CF + SC Pipelines • Our application has KPI monitoring in place • Alerting are set for KPIs • It has been tested that the application can be easily rolled back • Cloud Foundry can take care of zero downtime deployment
  • 72. 72 Spring Cloud Pipelines • Deploy to prod deploys the pipeline version of the app to production next to the current production version • Complete switch over allows to delete the old instance and leave only the new one • Once deployed we tag the repo with prod/VERSION_NUMBER
  • 74. 74 Two versions running at the same time Two versions registered under same hostname Old instance New instance
  • 75. 75 After complete switch over One app remains
  • 76. 76 Demo - alerts GITHUB-WEBHOOK GITHUB-ANALYTICS AMQPPOST POLL
  • 79. 79 Insert some data to the service
  • 80. 80 Grafana Satisfactory number of issues Threshold below which alerts will be sent Metric configuration
  • 83. 83 Grafana - alert The metric went down to 0
  • 87. 87 Customizing Spring Cloud Pipelines $ curl -LOk https://github.com/spring-cloud/spring-cloud-pipelines/archive/v1.0.0.M5.zip $ unzip v1.0.0.M5.zip $ cd spring-cloud-pipelines-v1.0.0.M5 $ git init $ # modify the pipelines to suit your needs $ git add . $ git commit -m "Initial commit" $ git remote add origin ${YOUR_REPOSITORY_URL} $ git push origin master
  • 89. 89 Summary • Continuous Deployment allows you to continuously deliver business value • Spring Cloud Pipelines gives you OOB tooling to test your software via • unit and integration testing • contract testing • rollback testing • Spring Cloud Pipelines allows you to easily adjust the deployment pipeline to suit your company’s needs • Thanks to Cloud Foundry you can easily do A/B & zero downtime deployment
  • 90. 90
  • 91. 91 ▪ Github Analytics: https://github.com/spring-cloud-samples/github-analytics ▪ Github Webhook: https://github.com/spring-cloud-samples/github-webhook ▪ SC-Pipelines documentation: https://cloud.spring.io/spring-cloud-pipelines/ ▪ No end to end tests • https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html • http://www.alwaysagileconsulting.com/articles/end-to-end-testing-considered-harmful/ ▪ Prometheus on CF https://github.com/mkuratczyk/prometheus-on-PCF ▪ Prometheus for PCF Dev (Docker compose) https://github.com/vegasbrianc/prometheus ▪ Pivotal Web Services trial : https://run.pivotal.io/ ▪ PCF Dev (CF on your laptop) : https://docs.pivotal.io/pcf-dev/ Links
  • 92. 92 Learn More. Stay Connected. ▪ Read the docs http://cloud.spring.io/spring-cloud-pipelines/ ▪ Talk to us on Gitter https://gitter.im/spring-cloud/spring-cloud-pipelines Twitter: twitter.com/springcentral YouTube: spring.io/video LinkedIn: spring.io/linkedin Google Plus: spring.io/gplus