SlideShare a Scribd company logo
1 of 82
Continuous Integration/
Continuous Delivery веб-приложения
Evgeniy Kuzmin, CTO Smart Gamma
Agile attributes
- Continuous integration with codebase
- Development with autotests
- Continuous feedback
- Bugfix first
- Feature planning & releases
Goals
- Increase development speed
- Increase product quality
- Decrease risk
- Improve feedback
- Increase time-to-market
Goal
Use CI/CD not only for big
teams
Initial Conditions
- workstationhealth.com
- Laravel framework
- 3 in house devs
- AWS
- Jira
- bitbucket
- QA/DevOps consulting
CI/CD Journey
Trunc-based flow - “pure” CI
Feature / task branching GIT flow
Is this CI?
- small team
- short-lived branches
- force integration with develop in the
task branch “in-progress” state
Requirements
Force developers for faster integration
Docker local development
docker-compose.yml
docker-compose-local.yml
https://gist.github.com/Evgenas/c6da523eb2462d848d93505ef
603208b
$ docker-compose -f docker-compose.yml -f docker-compose.local.yml up
Or use Makefile
$ make up
Auto-testing
“Одним только тестированием качества не
добиться. Рецепт получения высокого качества:
смешивайте разработку и тестирование в
блендере, пока они не станут единой
субстанцией.”
“Вся ответственность за качество лежит на
плечах тех, кто пишет код. Разработчик
отвечает за качество всего кода, к которому он
прикасается: пишет, исправляет или вносит
изменения.”
Роли: разработчик, разработчик в тестировании, инженер по тестированию
Типы тестов: лёгкие, средние, долгие, супердолгие
100% покрытие vs избирательное
тестирование
Модульные тесты (лёгкие)
dependencies
amount
Algorithmic
complexity
Mediators
бизнес-логика
Простой код
без
зависимостей
God Object /
Spaghetti
Функциональные тесты (средние)
Attributes
Database connection
Request modeling
Response assertion
Database assertion
Goals
API layer stability
Business logic
Testing code coverage (over unit
testing coverage)
Laravel pros
Easy HOW TO START documentation
Phpunit wrapper
Transaction support “from the box”
Testing code coverage
phpdbg – allows get test code coverage faster then
xdebug
find tests/ -name '*Test.php' |
./vendor/liuggio/fastest/fastest -o -p 4 -x phpunit.xml
'phpdbg -qrr ./vendor/phpunit/phpunit/phpunit {} --
coverage-php ./tests/_reports/logs/{n}.cov;'
phpcov – allows merge test coverage from threads
phpdbg -qrr ./vendor/bin/phpcov merge tests/_reports/logs/
--clover tests/_reports/logs/clover.xml
Etalon Datas
Data loading variation:
- Inline in each test
- Preload before suite
Laravel:
- Seeds / factories
- Organize domain data builders
- Transactions
Domain Data Builders
Transactions in phpunit
Restore DB to the initial state after each test is completed
How to get faster feedback?
Goal-keep Limits:
- 5 mins for unit/functional tests
- 20 mins for UI tests
Benchmark for 1 thread
Tests: 632, Assertions: 6765:
5 minutes 21 seconds
Optimizations:
- tests multithreading execution
- seeds reload optimization
- selective build code coverage
(only in development branch)
Multithreading tests
Tool:
Fastest - https://github.com/liuggio/fastest
find tests/ -name '*Test.php' |
./vendor/liuggio/fastest/fastest
-o -p 4 -x phpunit.xml 'phpdbg -qrr
./vendor/phpunit/phpunit/phpunit {} --coverage-php
./tests/_reports/logs/{n}.cov;'
Seeds reload optimization
Optimization result
5 minutes 52 seconds vs 59 seconds
Phing - build automation tool
Goal: One step build
Tool: https://www.phing.info/
Sample: https://gist.github.com/Evgenas/97fc0bfb
Jenkins
Trigger light tests suite build (ergoblitz-build-minimal)
BitBucket Plugin: https://plugins.jenkins.io/bitbucket
Bitbucket Pullrequest Builder: https://plugins.jenkins.io/bitbucket-pullrequest-builder
Phing Plugin:
https://plugins.jenkins.io/phing
Tests feedback notifications
Slack Notification Plugin: https://plugins.jenkins.io/slack
Trigger next level tests
Parameterized Trigger Plugin:
https://plugins.jenkins.io/parameterized-trigger
UI/User Stories testing automation - end2end tests
Behat - what is inside?
BDD or not BDD?
Jenkins behat job config
Run upstream behat job from build-ci-minimal job
Jenkins behat job config
Clean up end2end. environment
Reseed / redeploy before testing
Run tests with fastest for multithreading
Success result
Trace failed tests
Linked screenshot
Jira releases
Jenkins prepare release job
How to stick Jenkins build to Jira release
Jira Plugin: https://plugins.jenkins.io/jira
Merge develop to master
Prepare docker images for production
Amazon ECR
Jenkins Docker build
DockerCommon Plugin:
https://plugins.jenkins.io/docker-commons
CloudBees Docker Build and Publish Plugin:
https://plugins.jenkins.io/docker-build-publish
Amazon ECR Plugin:
https://plugins.jenkins.io/amazon-ecr
Preproduction
deployment
Amazon Elastic Beanstalk
Multicontainer Docker Environment
Beanstalk Environments
Blue/Green deploy
BlueGreen
deploy settings
AWS Elastic Beanstalk Plugin: https://plugins.jenkins.io/awseb-deployment-plugin
How to connect Jenkins and AWS Beanstalk
AWS Beanstalk configuration files
App deployment: /Dockerrun.aws.json
DB Migrations: ./ebextensions/my-scripts.config
Cron: ./ebextensions/cronjob.config
https://gist.github.com/Evgenas/8bdf43a1
Dockerrun.aws.json
Cronjob setup on deploy
Run migration on deploy
Blue-Green Deployment execution
Migrations rules for blue-green deployments
https://wiki.openstack.org/wiki/DBMigrationBestPractices
Additional preproduction auto-testing with BrowserStack
Deploy to production
Production / preproduction errors monitoring with Slack
evgeniy.k@smart-gamma.com
https://www.linkedin.com/in/evgeniy-kuzmin-03816a52/

More Related Content

What's hot

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
Rodrigo Russo
 
Continuous integration with teamcity
Continuous integration with teamcityContinuous integration with teamcity
Continuous integration with teamcity
Eugene Sheretov
 

What's hot (20)

Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
FAST for SharePoint Deep Dive
FAST for SharePoint Deep DiveFAST for SharePoint Deep Dive
FAST for SharePoint Deep Dive
 
Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-Pipelines
 
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
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
 
はじめての JFrog Artifactory
はじめての JFrog Artifactoryはじめての JFrog Artifactory
はじめての JFrog Artifactory
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Continuous integration with teamcity
Continuous integration with teamcityContinuous integration with teamcity
Continuous integration with teamcity
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedback
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Knowledge sharing session Java 9
Knowledge sharing session Java 9Knowledge sharing session Java 9
Knowledge sharing session Java 9
 
Continuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and JenkinsContinuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and Jenkins
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 
Testing AS A Container - Irfan Ahmad
Testing AS A Container - Irfan AhmadTesting AS A Container - Irfan Ahmad
Testing AS A Container - Irfan Ahmad
 
Continuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins WorkflowContinuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins Workflow
 
Continuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfestContinuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfest
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
 
SkyBase - a Devops Platform for Hybrid Cloud
SkyBase - a Devops Platform for Hybrid CloudSkyBase - a Devops Platform for Hybrid Cloud
SkyBase - a Devops Platform for Hybrid Cloud
 
Continuous Integration for Salesforce1 Platform
Continuous Integration for Salesforce1 PlatformContinuous Integration for Salesforce1 Platform
Continuous Integration for Salesforce1 Platform
 

Similar to Continuous Integration/ Continuous Delivery of web applications

Similar to Continuous Integration/ Continuous Delivery of web applications (20)

Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Grunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierGrunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End Tier
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvm
 
Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupal
 
Continuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise StackContinuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise Stack
 
How to Build and Maintain Quality Drupal Sites with Automated Testing
How to Build and Maintain Quality Drupal Sites with Automated TestingHow to Build and Maintain Quality Drupal Sites with Automated Testing
How to Build and Maintain Quality Drupal Sites with Automated Testing
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
CISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 DevelopmentCISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 Development
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
Simple tools to fight bigger quality battle
Simple tools to fight bigger quality battleSimple tools to fight bigger quality battle
Simple tools to fight bigger quality battle
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Webinar get move_on_with_bpmsuite6
Webinar get move_on_with_bpmsuite6Webinar get move_on_with_bpmsuite6
Webinar get move_on_with_bpmsuite6
 
Ship code like a keptn
Ship code like a keptnShip code like a keptn
Ship code like a keptn
 
Performance testing as part of Agile - Continius Delivery solution
Performance testing as part of Agile - Continius Delivery solutionPerformance testing as part of Agile - Continius Delivery solution
Performance testing as part of Agile - Continius Delivery solution
 
"To cover uncoverable", Andrii Shumada
"To cover uncoverable", Andrii Shumada"To cover uncoverable", Andrii Shumada
"To cover uncoverable", Andrii Shumada
 
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 jsАНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
 

More from Evgeniy Kuzmin

Тестирование как панацея для жизни и развития проекта
Тестирование как панацея для жизни и развития проекта Тестирование как панацея для жизни и развития проекта
Тестирование как панацея для жизни и развития проекта
Evgeniy Kuzmin
 

More from Evgeniy Kuzmin (7)

MongoDB - About Performance Optimization, Ivan Griga - Smart Gamma
MongoDB - About Performance Optimization, Ivan Griga - Smart GammaMongoDB - About Performance Optimization, Ivan Griga - Smart Gamma
MongoDB - About Performance Optimization, Ivan Griga - Smart Gamma
 
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
 
Contract testing - isolated testing of microservices - Symfony Camp 2018, Evg...
Contract testing - isolated testing of microservices - Symfony Camp 2018, Evg...Contract testing - isolated testing of microservices - Symfony Camp 2018, Evg...
Contract testing - isolated testing of microservices - Symfony Camp 2018, Evg...
 
Тестирование как панацея для жизни и развития проекта
Тестирование как панацея для жизни и развития проекта Тестирование как панацея для жизни и развития проекта
Тестирование как панацея для жизни и развития проекта
 
Спасение через тестирование - история одного проекта
Спасение через тестирование - история одного проектаСпасение через тестирование - история одного проекта
Спасение через тестирование - история одного проекта
 
Behaivior Driven Development - from the tests to the business logic in a sing...
Behaivior Driven Development - from the tests to the business logic in a sing...Behaivior Driven Development - from the tests to the business logic in a sing...
Behaivior Driven Development - from the tests to the business logic in a sing...
 
Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.Smart Gamma - Real-Time Web applications with PHP and Websocket.
Smart Gamma - Real-Time Web applications with PHP and Websocket.
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Continuous Integration/ Continuous Delivery of web applications