SlideShare a Scribd company logo
Meet Magento Croatia
Osijek
18.03.2017.
2017
#MM17HR
Magento Continuous	Integration	&	
Continuous	Delivery
Denis	Ristić
Who	am	I?
• Magento developer since 2012
• Software	Architect
• DevOps Engineer
• Team	Lead
• Scrum Master
• Ecommerce	Consultant
• @denisristic
What is Continuous Integration?
• Definition:	CI	is	the	practice	in	software	engineering	of	merging	all	
working	copies	with	a	shared	mainline	several	times	a	day
• a	development	methodology
• of	daily developer	integrations
• verified	by	automated builds
What is Continuous Integration?
CI is	the	practice	in	software	engineering	of	merging	all	working	copies	
with	a	shared	mainline	several	times	a	day
What is Continuous Integration?
• What	is CI?
• a	development	methodology
• of	daily developer	integrations
• verified	by	automated builds
• What	is	not CI?
• nightly	builds
• dev	branches
• building	via	IDEs
CI	Benefits
• Better
• Build	better
quality software	
• That	is	tested	early	
and	often	
• Using	best	
practices	and	
coding	standards
• Faster	
• Test	in parallel,	
not	at	the	end	
• No integration	
points	
• Builds	become	a	
non	event
• Cheaper	
• Identify	defects	
earlier	
• Fix	when	least
costly	
• Easy	repeatable
testing
What is Continuous Deployment?
• Definition:	CD	is	a	software	engineering	approach	in	which	teams	produce	
software	in	short	cycles,	ensuring	that	the	software	can	be	reliably	released	
at	any	time
• CD Ingredients
• Compilation	
• Tests	execution	
• Database	integration	
• Code	inspection	
• Automated	deployment	(!!!)	
• Documentation	generation
CD	Ingredients
Compilation
Ensure	code	actually	
compiles	on	every	target	
platform
Test	Execution
Ensures	product	functions
as	expected	through
repeatable testing
Database	Integration
Ensures	that	DB	and	code	
are	in	sync	
Automates	(re)creation	of	
DB	and	test	data
Code	Inspections
Ensures	a	healthy code	
base
Identifies	problems	early
Enforces	best practices
Automated	Deployment
Products	can	be	released	
anytime	
Continually demo-able	
state	
Eliminates	“works	on	my	
machine”
Document	Generation
• Ensures	documentation	is	
current	
• Removes	burden from	
developers	
• Products	build	reports	
and metrics
How	do	I	get	started?
When do	I	build?
• At	every check-in
• Every	time	a	
dependency changes
How do	I	build?
• Use	a	single build	script	
• That	can	run	from	
console	
• Do	not depend	on	an	
IDE
How	to	do	it	continuously?
• Use	a	dedicated	CI	server,	
not	cron
• Trigger	on	all daily	check-
ins	
• Not	(only)	at	midnight
Pay	attention to	your	builds
• Provide	immediate
feedback	
• Make	it	easily	accessible	
• Require	no developer	
effort
• Metrics Matter
• Identify	key	metrics	and	
track	them	visually	
• Act on	them	
immediately
Cookbook
1. Commit	early,	commit	often	
2. Never commit	broken	code	
3. Fix	build	failures	immediately	
4. Fail	fast	
5. Act on	metrics	
6. Build	in	every target	environment	
7. Create	artifacts	from	every build
Jenkins
• PHP
• MySQL
• SCM	(BitBucket,	GitHub,	GitLab…)
• Composer
• Phing (or	Ant,	Maven…)
• NodeJs &	Grunt
• Messenger	(HipChat,	Slack…)
Jenkins	modules
• BlueOcean
• Pipeline &	Multi-Branch
• Git,	Php,	Phing,	NodeJs
• PHPUnit,	PHPmd,	PHPcs,	
PHPloc,	Pdepend,
• BitBucket &	HipChat
• Selenium	&	Chromedriver
• Clover,	Static	Analysis	
Collector,	Plot,	PMD,	jUnit,	
jDepend,	CheckStyle
• Publish Over SSH,	…
Jenkins Jobs
• Freestyle
• While	standard	Jenkins	“freestyle”	jobs	support	simple	continuous	
integration	by	allowing	you	to	define	sequential	tasks	in	an	application	
lifecycle,	they	do	not	create	a	persistent	record	of	execution,	enable	one	
script	to	address	all	the	steps	in	a	complex	workflow,	or	confer	the	other	
advantages	of	pipelines
• Pipeline
• Pipelines	enable	you	to	define	the	whole	application	lifecycle.	Pipeline	
functionality	helps	Jenkins	to	support	continuous	delivery	(CD).
• Multibranch pipeline
• The	Multibranch Pipeline	project	type	enables	you	to	implement	different	
Jenkinsfiles for	different	branches	of	the	same	project.	In	a	Multibranch
Pipeline	project,	Jenkins	automatically	discovers,	manages	and	executes	
Pipelines	for	branches	which	contain	a	Jenkinsfile in	source	control.
Job Triggers
• Webhook
• Git commit	
• Pull	request
• Periodically
• Trigger	builds	remotely
Build steps
• Checkout	SCM
• Notify	BitBucket &	HipChat
• Phing Build	(build.xml)
• Clean	&	prepare	workspace
• Composer	install
• Magento clean,	chmod,	enable	modules,	install?,	sync	db?,	compile,	upgrade,	deploy	
static	content
• phplint,	phpcs,	phpcpd,	phpmd,	phploc,	pdepend,	phpunit,	grunt,	build	docs
• Create	release	(git tag)	&	ChangeLog
• Create	artefacts
• Deploy	to	staging	and/or	production
• Notify	BitBucket &	HipChat
Deployment
• Rsync artefacts	and	execute	deploy	script
• Extract	artefacts	to	release	folder	(i.e.	
/var/www/public_html/build-17/)
• Link	(ln –s)	shared	folders	(var/log/,	pub/media/)
• Set	permissions
• Run	upgrade	(php bin/magento setup:upgrade --keep-
generated)
• Set	deploy	mode	(php bin/magento deploy:mode:set
production or	developer)
• Remove	build	files	(Jenkinsfile,	build.xml,	build/,	deploy.sh)
• Set	release	as	current
Server	folder	structure after deployment
├── public_html -> release-0.2
├── release-0.1
│ ├── app
│ ├── dev
│ ├── ...
├── release-0.2
│ ├── app
│ ├── dev
│ ├── lib
│ ├── phpserver
│ ├── pub
│ │ ├── errors
│ │ ├── media -> ../../static/pub/media
│ │ ├── opt
│ │ └── static
│ ├── setup
│ ├── update
│ ├── var
│ │ ├── backups
│ │ ├── cache
│ │ ├── log -> ../../static/var/log
│ │ ├── ...
│ └── vendor
└── static
├── pub
│ └── media
│ ├── captcha
│ ├── catalog
│ ├── ...
└── var
└── log
HipChat	commit	&	build	notifications
BitBucket repository	commits
Jenkins	dashboard
Jenkins	project	dashboard
Jenkins	build	status
Jenkins	multibranch project	dashboard
Bitbucket Multibranch (GitFlow)	commits
Blue	Ocean	dashboard
Blue	Ocean	Pipeline	Editor
Blue	Ocean	build	status
Tips’n Tricks (1)
• When	building	your	first	build.xml &	Jenkinsfile use	empty	
Magento and	test	locally
• Use	Magento dev	tools	&	rulesets	(phpunit,	phpmd,	phpcs)
• Turn	on	all	outputs	(phing passthru="true”)
• Don’t	put	checkreturn="true” on	all	tasks	(i.e.	pdepend &	
phpcs)
Tips’n Tricks (2)
• Some	CLI	tools	use	arguments	in	format	--agrument=value (i.e.	
phpcs,	phpcpd…)	and	others	--argument value (i.e.	phpmd,	
phpunit…)
• Create	different	Phing build	targets	(e.g.	build,	build-fast,	build-full…)
• Use	ssh keys	for	deployment
• Don’t	test	on	production	J
• Disable	Jenkins	CSRF	protection	(it	strips	webhook payload)	and	add	
Jenkins	oAuth credentials	to	webhook url
Summary
CI	&	CD	
can	help	you	build	better	quality	
software	faster,	with	more	
confidence
Thank you!

More Related Content

What's hot

Dev ops using Jenkins
Dev ops using JenkinsDev ops using Jenkins
Supermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talkSupermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talk
Michael Peacock
 
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
Puppet
 
Continuous Integration and PHP
Continuous Integration and PHPContinuous Integration and PHP
Continuous Integration and PHP
Arno Schneider
 
Jenkins
JenkinsJenkins
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
Carlo Bonamico
 
Docker Best Practices Workshop
Docker Best Practices WorkshopDocker Best Practices Workshop
Docker Best Practices Workshop
Ahmed AbouZaid
 
JUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and GroovyJUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and Groovy
CloudBees
 
Hacking Jenkins
Hacking JenkinsHacking Jenkins
Hacking Jenkins
Miro Cupak
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDN
Edmund Turbin
 
Git essentials
Git essentialsGit essentials
Git essentials
Otto Kekäläinen
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017
Edmund Turbin
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
Jenkins for java world
Jenkins for java worldJenkins for java world
Jenkins for java world
Ashok Kumar
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitisSteve Povilaitis
 
Let’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkinsLet’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkins
Tomohide Kakeya
 
Gozengo sauce presentation
Gozengo sauce presentationGozengo sauce presentation
Gozengo sauce presentationDaniel Straus
 
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - SydneySimplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Abhinav Gupta
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Борис Зора
 

What's hot (20)

Dev ops using Jenkins
Dev ops using JenkinsDev ops using Jenkins
Dev ops using Jenkins
 
Supermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talkSupermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talk
 
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
 
Continuous Integration and PHP
Continuous Integration and PHPContinuous Integration and PHP
Continuous Integration and PHP
 
Jenkins
JenkinsJenkins
Jenkins
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Docker Best Practices Workshop
Docker Best Practices WorkshopDocker Best Practices Workshop
Docker Best Practices Workshop
 
JUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and GroovyJUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and Groovy
 
Hacking Jenkins
Hacking JenkinsHacking Jenkins
Hacking Jenkins
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDN
 
Git essentials
Git essentialsGit essentials
Git essentials
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
Jenkins for java world
Jenkins for java worldJenkins for java world
Jenkins for java world
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
 
Let’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkinsLet’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkins
 
Gozengo sauce presentation
Gozengo sauce presentationGozengo sauce presentation
Gozengo sauce presentation
 
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - SydneySimplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
 

Similar to Magento Continuous Integration & Continuous Delivery @MM17HR

Ciprian redinciuc continuous integration with jenkins for i os
Ciprian redinciuc   continuous integration with jenkins for i osCiprian redinciuc   continuous integration with jenkins for i os
Ciprian redinciuc continuous integration with jenkins for i os
Codecamp Romania
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
ecubemarketing
 
DevOps
DevOpsDevOps
DevOps
RavneetArora
 
Introduction to jenkins for the net developer
Introduction to jenkins for the net developerIntroduction to jenkins for the net developer
Introduction to jenkins for the net developer
Abe Diaz
 
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Endava
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
willemstuursma
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
XPDays
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
Ryan Street
 
Build Time Hacking
Build Time HackingBuild Time Hacking
Build Time Hacking
Mohammed Tanveer
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
Heiko Voigt
 
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshiftTekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
bashwen2022
 
SanDiego_DevOps_Meetup_9212016
SanDiego_DevOps_Meetup_9212016SanDiego_DevOps_Meetup_9212016
SanDiego_DevOps_Meetup_9212016w2fong
 
SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8Rajwinder Singh
 
PHP Unconference Continuous Integration
PHP Unconference Continuous IntegrationPHP Unconference Continuous Integration
PHP Unconference Continuous Integration
Nils Hofmeister
 
Hudson
HudsonHudson
Hudson
8x8
 
Jenkins.pdf
Jenkins.pdfJenkins.pdf
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101
Hazzim Anaya
 
Continuous integrations - Basics
Continuous integrations - BasicsContinuous integrations - Basics
Continuous integrations - Basics
Barış İNANÇ
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 

Similar to Magento Continuous Integration & Continuous Delivery @MM17HR (20)

Ciprian redinciuc continuous integration with jenkins for i os
Ciprian redinciuc   continuous integration with jenkins for i osCiprian redinciuc   continuous integration with jenkins for i os
Ciprian redinciuc continuous integration with jenkins for i os
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
 
DevOps
DevOpsDevOps
DevOps
 
Introduction to jenkins for the net developer
Introduction to jenkins for the net developerIntroduction to jenkins for the net developer
Introduction to jenkins for the net developer
 
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
Continuos integration with Jenkins for iOS | SuperSpeakers@CodeCamp Iasi, 2014
 
Enter the Team City
Enter the Team CityEnter the Team City
Enter the Team City
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Build Time Hacking
Build Time HackingBuild Time Hacking
Build Time Hacking
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
 
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshiftTekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
 
SanDiego_DevOps_Meetup_9212016
SanDiego_DevOps_Meetup_9212016SanDiego_DevOps_Meetup_9212016
SanDiego_DevOps_Meetup_9212016
 
SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8
 
PHP Unconference Continuous Integration
PHP Unconference Continuous IntegrationPHP Unconference Continuous Integration
PHP Unconference Continuous Integration
 
Hudson
HudsonHudson
Hudson
 
Jenkins.pdf
Jenkins.pdfJenkins.pdf
Jenkins.pdf
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101
 
Continuous integrations - Basics
Continuous integrations - BasicsContinuous integrations - Basics
Continuous integrations - Basics
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 

More from Denis Ristic

25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards
Denis Ristic
 
24 Scrum #burningkeyboards
24 Scrum #burningkeyboards24 Scrum #burningkeyboards
24 Scrum #burningkeyboards
Denis Ristic
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
Denis Ristic
 
22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards
Denis Ristic
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
Denis Ristic
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards
Denis Ristic
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
Denis Ristic
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
Denis Ristic
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
Denis Ristic
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards
Denis Ristic
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
Denis Ristic
 
14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards
Denis Ristic
 
13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards
Denis Ristic
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboards
Denis Ristic
 
11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards
Denis Ristic
 
10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards
Denis Ristic
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
Denis Ristic
 
08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards
Denis Ristic
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
Denis Ristic
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboards
Denis Ristic
 

More from Denis Ristic (20)

25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards
 
24 Scrum #burningkeyboards
24 Scrum #burningkeyboards24 Scrum #burningkeyboards
24 Scrum #burningkeyboards
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
 
22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
 
14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards
 
13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboards
 
11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards
 
10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
 
08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboards
 

Recently uploaded

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

Magento Continuous Integration & Continuous Delivery @MM17HR

  • 3. Who am I? • Magento developer since 2012 • Software Architect • DevOps Engineer • Team Lead • Scrum Master • Ecommerce Consultant • @denisristic
  • 4. What is Continuous Integration? • Definition: CI is the practice in software engineering of merging all working copies with a shared mainline several times a day • a development methodology • of daily developer integrations • verified by automated builds
  • 5. What is Continuous Integration? CI is the practice in software engineering of merging all working copies with a shared mainline several times a day
  • 6. What is Continuous Integration? • What is CI? • a development methodology • of daily developer integrations • verified by automated builds • What is not CI? • nightly builds • dev branches • building via IDEs
  • 7. CI Benefits • Better • Build better quality software • That is tested early and often • Using best practices and coding standards • Faster • Test in parallel, not at the end • No integration points • Builds become a non event • Cheaper • Identify defects earlier • Fix when least costly • Easy repeatable testing
  • 8. What is Continuous Deployment? • Definition: CD is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time • CD Ingredients • Compilation • Tests execution • Database integration • Code inspection • Automated deployment (!!!) • Documentation generation
  • 9. CD Ingredients Compilation Ensure code actually compiles on every target platform Test Execution Ensures product functions as expected through repeatable testing Database Integration Ensures that DB and code are in sync Automates (re)creation of DB and test data Code Inspections Ensures a healthy code base Identifies problems early Enforces best practices Automated Deployment Products can be released anytime Continually demo-able state Eliminates “works on my machine” Document Generation • Ensures documentation is current • Removes burden from developers • Products build reports and metrics
  • 10. How do I get started? When do I build? • At every check-in • Every time a dependency changes How do I build? • Use a single build script • That can run from console • Do not depend on an IDE How to do it continuously? • Use a dedicated CI server, not cron • Trigger on all daily check- ins • Not (only) at midnight Pay attention to your builds • Provide immediate feedback • Make it easily accessible • Require no developer effort • Metrics Matter • Identify key metrics and track them visually • Act on them immediately
  • 11. Cookbook 1. Commit early, commit often 2. Never commit broken code 3. Fix build failures immediately 4. Fail fast 5. Act on metrics 6. Build in every target environment 7. Create artifacts from every build
  • 12. Jenkins • PHP • MySQL • SCM (BitBucket, GitHub, GitLab…) • Composer • Phing (or Ant, Maven…) • NodeJs & Grunt • Messenger (HipChat, Slack…) Jenkins modules • BlueOcean • Pipeline & Multi-Branch • Git, Php, Phing, NodeJs • PHPUnit, PHPmd, PHPcs, PHPloc, Pdepend, • BitBucket & HipChat • Selenium & Chromedriver • Clover, Static Analysis Collector, Plot, PMD, jUnit, jDepend, CheckStyle • Publish Over SSH, …
  • 13. Jenkins Jobs • Freestyle • While standard Jenkins “freestyle” jobs support simple continuous integration by allowing you to define sequential tasks in an application lifecycle, they do not create a persistent record of execution, enable one script to address all the steps in a complex workflow, or confer the other advantages of pipelines • Pipeline • Pipelines enable you to define the whole application lifecycle. Pipeline functionality helps Jenkins to support continuous delivery (CD). • Multibranch pipeline • The Multibranch Pipeline project type enables you to implement different Jenkinsfiles for different branches of the same project. In a Multibranch Pipeline project, Jenkins automatically discovers, manages and executes Pipelines for branches which contain a Jenkinsfile in source control.
  • 14. Job Triggers • Webhook • Git commit • Pull request • Periodically • Trigger builds remotely
  • 15. Build steps • Checkout SCM • Notify BitBucket & HipChat • Phing Build (build.xml) • Clean & prepare workspace • Composer install • Magento clean, chmod, enable modules, install?, sync db?, compile, upgrade, deploy static content • phplint, phpcs, phpcpd, phpmd, phploc, pdepend, phpunit, grunt, build docs • Create release (git tag) & ChangeLog • Create artefacts • Deploy to staging and/or production • Notify BitBucket & HipChat
  • 16. Deployment • Rsync artefacts and execute deploy script • Extract artefacts to release folder (i.e. /var/www/public_html/build-17/) • Link (ln –s) shared folders (var/log/, pub/media/) • Set permissions • Run upgrade (php bin/magento setup:upgrade --keep- generated) • Set deploy mode (php bin/magento deploy:mode:set production or developer) • Remove build files (Jenkinsfile, build.xml, build/, deploy.sh) • Set release as current
  • 17. Server folder structure after deployment ├── public_html -> release-0.2 ├── release-0.1 │ ├── app │ ├── dev │ ├── ... ├── release-0.2 │ ├── app │ ├── dev │ ├── lib │ ├── phpserver │ ├── pub │ │ ├── errors │ │ ├── media -> ../../static/pub/media │ │ ├── opt │ │ └── static │ ├── setup │ ├── update │ ├── var │ │ ├── backups │ │ ├── cache │ │ ├── log -> ../../static/var/log │ │ ├── ... │ └── vendor └── static ├── pub │ └── media │ ├── captcha │ ├── catalog │ ├── ... └── var └── log
  • 28. Tips’n Tricks (1) • When building your first build.xml & Jenkinsfile use empty Magento and test locally • Use Magento dev tools & rulesets (phpunit, phpmd, phpcs) • Turn on all outputs (phing passthru="true”) • Don’t put checkreturn="true” on all tasks (i.e. pdepend & phpcs)
  • 29. Tips’n Tricks (2) • Some CLI tools use arguments in format --agrument=value (i.e. phpcs, phpcpd…) and others --argument value (i.e. phpmd, phpunit…) • Create different Phing build targets (e.g. build, build-fast, build-full…) • Use ssh keys for deployment • Don’t test on production J • Disable Jenkins CSRF protection (it strips webhook payload) and add Jenkins oAuth credentials to webhook url