SlideShare a Scribd company logo
1 of 20
Download to read offline
Live Deployment.
Continuous Integration.
Drupal.
Andriy Podanenko, @podarok, ProPeople.
Technologies used
1. sh/bash scripting
2. drush/drupal/php
3. Jenkins server master/slave CI server.
4. mysql advanced configuration
5. vagrant virtualization, puppet scripting (ruby)
6. java (if You need to extend basic Jenkins’es plugins) (optional)
7. apache/nginx/php5-fpm/mysql (Full LAMP/MAMP stack)
8. phantomjs/javascript scripting
9. git/GitHub
10. code sniffer stack (php codesniffer, jshint, scss lint, twig lint etcetera)
The problems
● Code merged to *master without real testing
● Configs from dev site do not pushed to stage
● Different dev/stage/prod server environments
● Code review is not comprehensive.
● Visual regression needs a lot of love.
● Deploy is a horror.
● Client make changes that brake upgrade path.
● Update/upgrade path not tested.
Demo/Live content.
● drush si build_profile_name...
● rebuild.sh script with all steps for getting dev build
●
After first release for content management
● liverebuild.sh script for getting live DB from hosting
server to meet latest content/config changes.
● helps with visual regression testing when there is
frontend’s pull request for review and content/config
changed.
rebuild.sh script example(in repo!!!)
#!/bin/sh
service memcached restart
chmod +w sites/default/settings.php && rm -rf sites/default/settings.php
drush -vy si sitename --db-url=mysql://drupal:drupal@127.0.0.1:/drupal --account-name=admin --account-pass=pass
chmod +w sites/default/settings.php && rm -rf sites/default/settings.php && cp sites/default/settings_devel.php
sites/default/settings.php
cd sites/all/modules/contrib/guzzle
composer update
cd ../../../../../
pwd
cd sites/all/modules/custom/salespush
composer update
cd ../../../../../
drush some_custom_command
drush en devel -y
drush cc all
liverebuild.sh script example
#!/bin/sh
rm -rf livedb.sql*
wget http://URL_TO/livedb.sql.gz
gunzip -f livedb.sql.gz
mysql --force -e "drop database IF EXISTS livedrupal;create database IF NOT EXISTS livedrupal;use livedrupal;source
livedb.sql;"
rm -rf sites/default/settings.php
cp sites/default/settings_live.php sites/default/settings.php
drush -y updatedb
drush upwd admin --password=dEvPasS
create-solr-instance inst_x 7
create-solr-instance inst_i 7
drush en -y live_solr_settings
drush cc all
drush -dvy en migrate_master
drush -dvy updatedb
MySQL fast restoring from dump
SET foreign_key_checks = 0;SET UNIQUE_CHECKS = 0; SET AUTOCOMMIT = 0;
source dbdump.sql;
SET foreign_key_checks = 1;SET UNIQUE_CHECKS = 1; COMMIT;
------------------------------------------------------------------------------------
innodb_file_per_table = 1
tmp_table_size = 160M
max_heap_table_size = 160M
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_flush_log_at_trx_commit = 2
query_cache_size = 160M
table_cache = 800
innodb_buffer_pool_size = 900M
GitHub ads (PR matters)
- Jenkins
- GitHub PR builder plugin (triggers a build job
in Jenkins for a PR’s hash)
- create a build from scratch using cloned repo
from PR, demo content or even live db if any.
- Create a comment at PR’s thread with links to
build/job results
How it looks like in PR’s comment
Sniffers hell (Code Review matters)...
● PHP CodeSniffer
● JSHint
● SCSS lint
● yslow.js + phantomjs...
● Drupal SimpleTest
● PHPUnit tests
● Performance tests (custom made)
PHP CodeSniffer log example
FILE: .../smartling.admin.inc
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 7 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
20 | ERROR | global variables should start with a single underscore
| | followed by the module and another underscore
346 | WARNING | Unused variable $s_locale.
451 | ERROR | global variables should start with a single underscore
| | followed by the module and another underscore
464 | WARNING | Unused variable $need_fix.
618 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
740 | ERROR | global variables should start with a single underscore
| | followed by the module and another underscore
762 | WARNING | Unused variable $need_fix.
--------------------------------------------------------------------------------
JSHint log example
demo.js: line 5, col 5, Missing "use strict" statement.
demo.js: line 5, col 26, 'hideUnusedFn' is defined but never used.
demo.js: line 26, col 25, 'hideUnused3' is defined but never used.
demo.js: line 10, col 27, 'unusedVariable' is defined but never used.
demo.js: line 12, col 23, 'hideUnused' is defined but never used.
demo.js: line 9, col 43, 'unusedArg' is defined but never used.
demo.js: line 17, col 25, 'anotherUnusedArg' is defined but never used.
demo.js: line 16, col 27, 'unusedArgAfterUsed' is defined but never used.
demo.js: line 23, col 26, 'anotherUnusedArg2' is defined but never used.
demo.js: line 1, col 34, 'unusedGlobalVar' is defined but never used.
10 errors
SCSS lint log example
_base.scss:568 [W] Class `footer-article-icon-Case-study` in selector should be written in all lowercase as `footer-
article-icon-case-study`
_base.scss:725 [W] Merge rule `.pane-block` with rule on line 612
_base.scss:971 [W] Merge rule `.hp-marquee` with rule on line 966
_base.scss:982 [W] Selector should have depth of applicability no greater than 3, but was 4
_colors.scss:14 [W] Color `#666666` should be written as `#666`
_comments.scss:10 [W] `border: 0;` is preferred over `border: none;`
_comments.scss:171 [W] URLs should be enclosed in quotes
_reset.scss:25 [W] Use `//` comments everywhere
_reset.scss:26 [W] Each selector in a comma sequence should be on its own line
_slider.scss:17 [W] Properties should be sorted in order, with vendor-prefixed extensions before the standardized CSS
property
yslow.js graph example
$ phantomjs yslow.js --info grade --format tap --threshold '{"yminify": 90}' example.com
TAP version 13
1..24
ok 1 B (88) overall score
not ok 2 C (72) ynumreq: Make fewer HTTP requests
ok 3 C (70) ycdn: Use a Content Delivery Network (CDN)
ok 4 A (100) yemptysrc: Avoid empty src or href
not ok 5 F (12) yexpires: Add Expires headers
ok 6 A (100) ycompress: Compress components with gzip
ok 7 A (100) ycsstop: Put CSS at top
ok 8 A (100) yjsbottom: Put JavaScript at bottom
ok 9 A (100) yexpressions: Avoid CSS expressions
ok 10 N/A (-1) yexternal: Make JavaScript and CSS external # SKIP score N/A
not ok 11 C (70) ydns: Reduce DNS lookups
ok 12 A (90) yminify: Minify JavaScript and CSS
ok 13 A (100) yredirects: Avoid URL redirects
ok 14 A (100) ydupes: Remove duplicate JavaScript and CSS
ok 15 A (100) yetags: Configure entity tags (ETags)
ok 16 A (100) yxhr: Make AJAX cacheable
ok 17 A (100) yxhrmethod: Use GET for AJAX requests
ok 18 A (100) ymindom: Reduce the number of DOM element
PHPUnit/SimpleTest tests example
./runtests.sh
Configuration read from /var/www/pr/*****/build717/app/phpunit.xml.dist
F.....
Time: 219 ms, Memory: 13.00Mb
There was 1 failure:
1) HPBundleAuthBundleTestsControllerDefaultControllerTest::testIndex
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Authentication required.'
+'"Argument 2 passed to SymfonyBundleTwigBundleExtensionAssetsExtension::__construct() must be an
instance of SymfonyComponentRoutingRequestContext, none given, called in
/var/www/pr/*****/build717/app/cache/test/appTestDebugProjectContainer.php on line 3496 and
defined"'
/var/www/pr/***/build717/src/**/Bundle/AuthBundle/Tests/Controller/DefaultControllerTest.php:21
FAILURES!
Tests: 6, Assertions: 10, Failures: 1.
Live Deployment map
Full Demo
Useful links
● https://www.drupal.org/coding-standards
● http://www.squizlabs.com/php-codesniffer
● http://jshint.org/
● https://github.com/causes/scss-lint
● https://github.com/asm89/twig-lint
● https://github.com/jenkinsci/ghprb-plugin
● https://github.com/podarok/ghprb-plugin (Extended version)
● http://puphpet.drupal.ua/ (Custom version for Drupal devs)
● http://www.vagrantup.com/
● http://drush.ws/
Future plans
Add twig templates linting
Visual Regression tool
Performance tests
Thank You
Questions?
Andriy Podanenko, Software Architect, DevOp.
http://dgo.to/@podarok
http://druler.com/contact
http://wearepropeople.com

More Related Content

What's hot

為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測謝 宗穎
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Ontico
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsBo-Yi Wu
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境謝 宗穎
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.jsBo-Yi Wu
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
Modern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetModern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetPuppet
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...ZeroTurnaround
 
Building scala with bazel
Building scala with bazelBuilding scala with bazel
Building scala with bazelNatan Silnitsky
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet
 
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜Jumpei Miyata
 
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 GalChad Woolley
 
Frontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeFrontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeDamien Seguin
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
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 UsersJules Pierre-Louis
 
Grooving with Jenkins
Grooving with JenkinsGrooving with Jenkins
Grooving with JenkinsAnton Weiss
 
中華電信 教育訓練
中華電信 教育訓練中華電信 教育訓練
中華電信 教育訓練謝 宗穎
 
Zero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudZero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudJames Heggs
 

What's hot (20)

為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjs
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Modern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetModern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with Puppet
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
 
Building scala with bazel
Building scala with bazelBuilding scala with bazel
Building scala with bazel
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
 
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
 
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
 
Frontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeFrontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the like
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
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
 
Grooving with Jenkins
Grooving with JenkinsGrooving with Jenkins
Grooving with Jenkins
 
中華電信 教育訓練
中華電信 教育訓練中華電信 教育訓練
中華電信 教育訓練
 
Zero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudZero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google Cloud
 

Viewers also liked

Do + ldo for developers(full)
Do + ldo for developers(full)Do + ldo for developers(full)
Do + ldo for developers(full)Andrii Podanenko
 
DrupalCamp Kyiv 2009 Official Report
DrupalCamp Kyiv 2009 Official ReportDrupalCamp Kyiv 2009 Official Report
DrupalCamp Kyiv 2009 Official ReportDrupal Camp Kyiv
 
Ubercart7 views catalog ru
Ubercart7 views catalog ruUbercart7 views catalog ru
Ubercart7 views catalog ruAndrii Podanenko
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flowAndrii Podanenko
 
Drupal codesprint kyiv drupal cafe 07.02.2013
Drupal codesprint   kyiv drupal cafe 07.02.2013Drupal codesprint   kyiv drupal cafe 07.02.2013
Drupal codesprint kyiv drupal cafe 07.02.2013Andrii Podanenko
 
Drupal на 20-ти мегабайтах или издевательства над Shared Hosting
Drupal на 20-ти мегабайтах или издевательства над Shared HostingDrupal на 20-ти мегабайтах или издевательства над Shared Hosting
Drupal на 20-ти мегабайтах или издевательства над Shared HostingAndrii Podanenko
 
Happy ever afters with ci workflow
Happy ever afters with ci workflowHappy ever afters with ci workflow
Happy ever afters with ci workflowAlbina Tiupa
 
Who is here? DrupalCamp Kyiv 2009 opening
Who is here? DrupalCamp Kyiv 2009 openingWho is here? DrupalCamp Kyiv 2009 opening
Who is here? DrupalCamp Kyiv 2009 openingDrupal Camp Kyiv
 
Drupal code sprint для новичков
Drupal code sprint для новичковDrupal code sprint для новичков
Drupal code sprint для новичковOvadiah Myrgorod
 
Порівняння Drupal та Typo3
Порівняння Drupal та Typo3Порівняння Drupal та Typo3
Порівняння Drupal та Typo3Drupal Camp Kyiv
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011camp_drupal_ua
 
Многоязычие сайта на Drupal
Многоязычие сайта на DrupalМногоязычие сайта на Drupal
Многоязычие сайта на DrupalDrupal Camp Kyiv
 
Drupal Continuous Integration Workflow
Drupal Continuous Integration WorkflowDrupal Continuous Integration Workflow
Drupal Continuous Integration WorkflowAndrii Podanenko
 
природна і економна дорожня карта для переходу команди розробки на тест центр...
природна і економна дорожня карта для переходу команди розробки на тест центр...природна і економна дорожня карта для переходу команди розробки на тест центр...
природна і економна дорожня карта для переходу команди розробки на тест центр...Andrii Podanenko
 
Історія, теорія та використання CMS Drupal
Історія, теорія та використання CMS DrupalІсторія, теорія та використання CMS Drupal
Історія, теорія та використання CMS DrupalIgor Bronovskyy
 
Головні Принципи Автоматизації
Головні Принципи АвтоматизаціїГоловні Принципи Автоматизації
Головні Принципи АвтоматизаціїAndrii Podanenko
 

Viewers also liked (20)

Do + ldo for developers(full)
Do + ldo for developers(full)Do + ldo for developers(full)
Do + ldo for developers(full)
 
Start using vagrant now!
Start using vagrant now!Start using vagrant now!
Start using vagrant now!
 
DrupalCamp Kyiv 2009 Official Report
DrupalCamp Kyiv 2009 Official ReportDrupalCamp Kyiv 2009 Official Report
DrupalCamp Kyiv 2009 Official Report
 
Ubercart7 views catalog ru
Ubercart7 views catalog ruUbercart7 views catalog ru
Ubercart7 views catalog ru
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flow
 
Feeds drupal cafe
Feeds drupal cafeFeeds drupal cafe
Feeds drupal cafe
 
Drupal Optimization
Drupal OptimizationDrupal Optimization
Drupal Optimization
 
Drupal codesprint kyiv drupal cafe 07.02.2013
Drupal codesprint   kyiv drupal cafe 07.02.2013Drupal codesprint   kyiv drupal cafe 07.02.2013
Drupal codesprint kyiv drupal cafe 07.02.2013
 
Drupal на 20-ти мегабайтах или издевательства над Shared Hosting
Drupal на 20-ти мегабайтах или издевательства над Shared HostingDrupal на 20-ти мегабайтах или издевательства над Shared Hosting
Drupal на 20-ти мегабайтах или издевательства над Shared Hosting
 
Happy ever afters with ci workflow
Happy ever afters with ci workflowHappy ever afters with ci workflow
Happy ever afters with ci workflow
 
Who is here? DrupalCamp Kyiv 2009 opening
Who is here? DrupalCamp Kyiv 2009 openingWho is here? DrupalCamp Kyiv 2009 opening
Who is here? DrupalCamp Kyiv 2009 opening
 
Drupal code sprint для новичков
Drupal code sprint для новичковDrupal code sprint для новичков
Drupal code sprint для новичков
 
Порівняння Drupal та Typo3
Порівняння Drupal та Typo3Порівняння Drupal та Typo3
Порівняння Drupal та Typo3
 
Drupal Paranoia
Drupal ParanoiaDrupal Paranoia
Drupal Paranoia
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
 
Многоязычие сайта на Drupal
Многоязычие сайта на DrupalМногоязычие сайта на Drupal
Многоязычие сайта на Drupal
 
Drupal Continuous Integration Workflow
Drupal Continuous Integration WorkflowDrupal Continuous Integration Workflow
Drupal Continuous Integration Workflow
 
природна і економна дорожня карта для переходу команди розробки на тест центр...
природна і економна дорожня карта для переходу команди розробки на тест центр...природна і економна дорожня карта для переходу команди розробки на тест центр...
природна і економна дорожня карта для переходу команди розробки на тест центр...
 
Історія, теорія та використання CMS Drupal
Історія, теорія та використання CMS DrupalІсторія, теорія та використання CMS Drupal
Історія, теорія та використання CMS Drupal
 
Головні Принципи Автоматизації
Головні Принципи АвтоматизаціїГоловні Принципи Автоматизації
Головні Принципи Автоматизації
 

Similar to Live deployment, ci, drupal

X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
2016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES62016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES6양재동 코드랩
 
Angular 1 + es6
Angular 1 + es6Angular 1 + es6
Angular 1 + es6장현 한
 
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
 Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2   Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2 Adil Khan
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinSigma Software
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebMikel Torres Ugarte
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformniyof97
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionFrederic Descamps
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовDrupalCamp Kyiv Рысь
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersThe Incredible Automation Day
 

Similar to Live deployment, ci, drupal (20)

X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
[W3C HTML5 2016] Angular + ES6
[W3C HTML5 2016] Angular + ES6[W3C HTML5 2016] Angular + ES6
[W3C HTML5 2016] Angular + ES6
 
2016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES62016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES6
 
Angular 1 + es6
Angular 1 + es6Angular 1 + es6
Angular 1 + es6
 
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
 Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2   Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
Recipe to build open splice dds 6.3.xxx Hello World example over Qt 5.2
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтов
 
Aegir presentation
Aegir presentation Aegir presentation
Aegir presentation
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Php version 7
Php version 7Php version 7
Php version 7
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containers
 

More from Andrii Podanenko

Глобальні навчальні дні друпал
Глобальні навчальні дні друпалГлобальні навчальні дні друпал
Глобальні навчальні дні друпалAndrii Podanenko
 
Сейчас самое время...ЖИТЬ!
Сейчас самое время...ЖИТЬ!Сейчас самое время...ЖИТЬ!
Сейчас самое время...ЖИТЬ!Andrii Podanenko
 
Drupal 8 what to wait from
Drupal 8   what to wait fromDrupal 8   what to wait from
Drupal 8 what to wait fromAndrii Podanenko
 
Диалоговый интенсив 2012 карпаты
Диалоговый интенсив 2012 карпатыДиалоговый интенсив 2012 карпаты
Диалоговый интенсив 2012 карпатыAndrii Podanenko
 
психолог в социальных медиа
психолог в социальных медиапсихолог в социальных медиа
психолог в социальных медиаAndrii Podanenko
 
Ubercart7 Dynamic properties ru
Ubercart7 Dynamic properties ruUbercart7 Dynamic properties ru
Ubercart7 Dynamic properties ruAndrii Podanenko
 
Yaremchuk - Drupal CodeLobster
Yaremchuk - Drupal CodeLobsterYaremchuk - Drupal CodeLobster
Yaremchuk - Drupal CodeLobsterAndrii Podanenko
 
Yaremchuk - Корпоративные сайты
Yaremchuk - Корпоративные сайтыYaremchuk - Корпоративные сайты
Yaremchuk - Корпоративные сайтыAndrii Podanenko
 
управление проектами отношение к клиенту
управление проектами   отношение к клиентууправление проектами   отношение к клиенту
управление проектами отношение к клиентуAndrii Podanenko
 
Друпал - стандартні модулі
Друпал - стандартні модуліДрупал - стандартні модулі
Друпал - стандартні модуліAndrii Podanenko
 

More from Andrii Podanenko (14)

Глобальні навчальні дні друпал
Глобальні навчальні дні друпалГлобальні навчальні дні друпал
Глобальні навчальні дні друпал
 
Сейчас самое время...ЖИТЬ!
Сейчас самое время...ЖИТЬ!Сейчас самое время...ЖИТЬ!
Сейчас самое время...ЖИТЬ!
 
Drupal 8 what to wait from
Drupal 8   what to wait fromDrupal 8   what to wait from
Drupal 8 what to wait from
 
Диалоговый интенсив 2012 карпаты
Диалоговый интенсив 2012 карпатыДиалоговый интенсив 2012 карпаты
Диалоговый интенсив 2012 карпаты
 
психолог в социальных медиа
психолог в социальных медиапсихолог в социальных медиа
психолог в социальных медиа
 
Ubercart7 Dynamic properties ru
Ubercart7 Dynamic properties ruUbercart7 Dynamic properties ru
Ubercart7 Dynamic properties ru
 
Ubercart 7 ru
Ubercart 7 ruUbercart 7 ru
Ubercart 7 ru
 
Drupal 7 database api
Drupal 7 database api Drupal 7 database api
Drupal 7 database api
 
Yaremchuk - Drupal CodeLobster
Yaremchuk - Drupal CodeLobsterYaremchuk - Drupal CodeLobster
Yaremchuk - Drupal CodeLobster
 
Yaremchuk - Корпоративные сайты
Yaremchuk - Корпоративные сайтыYaremchuk - Корпоративные сайты
Yaremchuk - Корпоративные сайты
 
управление проектами отношение к клиенту
управление проектами   отношение к клиентууправление проектами   отношение к клиенту
управление проектами отношение к клиенту
 
Друпал - стандартні модулі
Друпал - стандартні модуліДрупал - стандартні модулі
Друпал - стандартні модулі
 
Друпал Drush
Друпал DrushДрупал Drush
Друпал Drush
 
Drupal Migrate
Drupal MigrateDrupal Migrate
Drupal Migrate
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Live deployment, ci, drupal

  • 2. Technologies used 1. sh/bash scripting 2. drush/drupal/php 3. Jenkins server master/slave CI server. 4. mysql advanced configuration 5. vagrant virtualization, puppet scripting (ruby) 6. java (if You need to extend basic Jenkins’es plugins) (optional) 7. apache/nginx/php5-fpm/mysql (Full LAMP/MAMP stack) 8. phantomjs/javascript scripting 9. git/GitHub 10. code sniffer stack (php codesniffer, jshint, scss lint, twig lint etcetera)
  • 3. The problems ● Code merged to *master without real testing ● Configs from dev site do not pushed to stage ● Different dev/stage/prod server environments ● Code review is not comprehensive. ● Visual regression needs a lot of love. ● Deploy is a horror. ● Client make changes that brake upgrade path. ● Update/upgrade path not tested.
  • 4. Demo/Live content. ● drush si build_profile_name... ● rebuild.sh script with all steps for getting dev build ● After first release for content management ● liverebuild.sh script for getting live DB from hosting server to meet latest content/config changes. ● helps with visual regression testing when there is frontend’s pull request for review and content/config changed.
  • 5. rebuild.sh script example(in repo!!!) #!/bin/sh service memcached restart chmod +w sites/default/settings.php && rm -rf sites/default/settings.php drush -vy si sitename --db-url=mysql://drupal:drupal@127.0.0.1:/drupal --account-name=admin --account-pass=pass chmod +w sites/default/settings.php && rm -rf sites/default/settings.php && cp sites/default/settings_devel.php sites/default/settings.php cd sites/all/modules/contrib/guzzle composer update cd ../../../../../ pwd cd sites/all/modules/custom/salespush composer update cd ../../../../../ drush some_custom_command drush en devel -y drush cc all
  • 6. liverebuild.sh script example #!/bin/sh rm -rf livedb.sql* wget http://URL_TO/livedb.sql.gz gunzip -f livedb.sql.gz mysql --force -e "drop database IF EXISTS livedrupal;create database IF NOT EXISTS livedrupal;use livedrupal;source livedb.sql;" rm -rf sites/default/settings.php cp sites/default/settings_live.php sites/default/settings.php drush -y updatedb drush upwd admin --password=dEvPasS create-solr-instance inst_x 7 create-solr-instance inst_i 7 drush en -y live_solr_settings drush cc all drush -dvy en migrate_master drush -dvy updatedb
  • 7. MySQL fast restoring from dump SET foreign_key_checks = 0;SET UNIQUE_CHECKS = 0; SET AUTOCOMMIT = 0; source dbdump.sql; SET foreign_key_checks = 1;SET UNIQUE_CHECKS = 1; COMMIT; ------------------------------------------------------------------------------------ innodb_file_per_table = 1 tmp_table_size = 160M max_heap_table_size = 160M innodb_file_format = Barracuda innodb_file_format_max = Barracuda innodb_flush_log_at_trx_commit = 2 query_cache_size = 160M table_cache = 800 innodb_buffer_pool_size = 900M
  • 8. GitHub ads (PR matters) - Jenkins - GitHub PR builder plugin (triggers a build job in Jenkins for a PR’s hash) - create a build from scratch using cloned repo from PR, demo content or even live db if any. - Create a comment at PR’s thread with links to build/job results
  • 9. How it looks like in PR’s comment
  • 10. Sniffers hell (Code Review matters)... ● PHP CodeSniffer ● JSHint ● SCSS lint ● yslow.js + phantomjs... ● Drupal SimpleTest ● PHPUnit tests ● Performance tests (custom made)
  • 11. PHP CodeSniffer log example FILE: .../smartling.admin.inc -------------------------------------------------------------------------------- FOUND 3 ERRORS AND 7 WARNINGS AFFECTING 10 LINES -------------------------------------------------------------------------------- 20 | ERROR | global variables should start with a single underscore | | followed by the module and another underscore 346 | WARNING | Unused variable $s_locale. 451 | ERROR | global variables should start with a single underscore | | followed by the module and another underscore 464 | WARNING | Unused variable $need_fix. 618 | WARNING | Do not use the raw $form_state['input'], use | | $form_state['values'] instead where possible 740 | ERROR | global variables should start with a single underscore | | followed by the module and another underscore 762 | WARNING | Unused variable $need_fix. --------------------------------------------------------------------------------
  • 12. JSHint log example demo.js: line 5, col 5, Missing "use strict" statement. demo.js: line 5, col 26, 'hideUnusedFn' is defined but never used. demo.js: line 26, col 25, 'hideUnused3' is defined but never used. demo.js: line 10, col 27, 'unusedVariable' is defined but never used. demo.js: line 12, col 23, 'hideUnused' is defined but never used. demo.js: line 9, col 43, 'unusedArg' is defined but never used. demo.js: line 17, col 25, 'anotherUnusedArg' is defined but never used. demo.js: line 16, col 27, 'unusedArgAfterUsed' is defined but never used. demo.js: line 23, col 26, 'anotherUnusedArg2' is defined but never used. demo.js: line 1, col 34, 'unusedGlobalVar' is defined but never used. 10 errors
  • 13. SCSS lint log example _base.scss:568 [W] Class `footer-article-icon-Case-study` in selector should be written in all lowercase as `footer- article-icon-case-study` _base.scss:725 [W] Merge rule `.pane-block` with rule on line 612 _base.scss:971 [W] Merge rule `.hp-marquee` with rule on line 966 _base.scss:982 [W] Selector should have depth of applicability no greater than 3, but was 4 _colors.scss:14 [W] Color `#666666` should be written as `#666` _comments.scss:10 [W] `border: 0;` is preferred over `border: none;` _comments.scss:171 [W] URLs should be enclosed in quotes _reset.scss:25 [W] Use `//` comments everywhere _reset.scss:26 [W] Each selector in a comma sequence should be on its own line _slider.scss:17 [W] Properties should be sorted in order, with vendor-prefixed extensions before the standardized CSS property
  • 14. yslow.js graph example $ phantomjs yslow.js --info grade --format tap --threshold '{"yminify": 90}' example.com TAP version 13 1..24 ok 1 B (88) overall score not ok 2 C (72) ynumreq: Make fewer HTTP requests ok 3 C (70) ycdn: Use a Content Delivery Network (CDN) ok 4 A (100) yemptysrc: Avoid empty src or href not ok 5 F (12) yexpires: Add Expires headers ok 6 A (100) ycompress: Compress components with gzip ok 7 A (100) ycsstop: Put CSS at top ok 8 A (100) yjsbottom: Put JavaScript at bottom ok 9 A (100) yexpressions: Avoid CSS expressions ok 10 N/A (-1) yexternal: Make JavaScript and CSS external # SKIP score N/A not ok 11 C (70) ydns: Reduce DNS lookups ok 12 A (90) yminify: Minify JavaScript and CSS ok 13 A (100) yredirects: Avoid URL redirects ok 14 A (100) ydupes: Remove duplicate JavaScript and CSS ok 15 A (100) yetags: Configure entity tags (ETags) ok 16 A (100) yxhr: Make AJAX cacheable ok 17 A (100) yxhrmethod: Use GET for AJAX requests ok 18 A (100) ymindom: Reduce the number of DOM element
  • 15. PHPUnit/SimpleTest tests example ./runtests.sh Configuration read from /var/www/pr/*****/build717/app/phpunit.xml.dist F..... Time: 219 ms, Memory: 13.00Mb There was 1 failure: 1) HPBundleAuthBundleTestsControllerDefaultControllerTest::testIndex Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'Authentication required.' +'"Argument 2 passed to SymfonyBundleTwigBundleExtensionAssetsExtension::__construct() must be an instance of SymfonyComponentRoutingRequestContext, none given, called in /var/www/pr/*****/build717/app/cache/test/appTestDebugProjectContainer.php on line 3496 and defined"' /var/www/pr/***/build717/src/**/Bundle/AuthBundle/Tests/Controller/DefaultControllerTest.php:21 FAILURES! Tests: 6, Assertions: 10, Failures: 1.
  • 18. Useful links ● https://www.drupal.org/coding-standards ● http://www.squizlabs.com/php-codesniffer ● http://jshint.org/ ● https://github.com/causes/scss-lint ● https://github.com/asm89/twig-lint ● https://github.com/jenkinsci/ghprb-plugin ● https://github.com/podarok/ghprb-plugin (Extended version) ● http://puphpet.drupal.ua/ (Custom version for Drupal devs) ● http://www.vagrantup.com/ ● http://drush.ws/
  • 19. Future plans Add twig templates linting Visual Regression tool Performance tests
  • 20. Thank You Questions? Andriy Podanenko, Software Architect, DevOp. http://dgo.to/@podarok http://druler.com/contact http://wearepropeople.com