magento testomgeving

19
Presentatie “Magento testomgevingen” - http://slideshare.net/yireo Jisse Reitsma ([email protected]) - Twitter @yireo Magento testomgeving

Upload: yireo

Post on 17-Jan-2015

216 views

Category:

Technology


2 download

DESCRIPTION

Presentatie gegeven tijdens Meet Magento NL 2014 over het opzetten van een Magento testomgeving o.a. met behulp van git.

TRANSCRIPT

Page 1: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Magento testomgeving

Page 2: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Mijn naam is Jisse Reitsma

Magento enthousiast

Lead developer van YireoEmailTester

DeleteAnyOrder

MageBridge brug met Joomla!

en andere Magento extensies

Page 3: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Voor wie?

Magento shop eigenaren

Magento bouwers

Page 4: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Waarom een testomgeving?

Bij iedere wijziging kan iets fout gaan:Configuratie-wijzigingen

Extensies of thema-aanpassingen uitproberen

Magento upgrade testen

Liever een fout op de test site dan op de productie site

Page 5: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

OTAP

Ontwikkeling

Test

Acceptatie

Productie

Page 6: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Testomgeving opzetten (1/2)

Eigen URLtest.example.com

www.example.com/test

Andere server?

ToegangPubliek

Beperkt (HTTP authenticatie, IP restrictie)

Page 7: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Testomgeving opzetten (2/2)

Copieer bestanden van productie naar testFTP of SSH of git

Pas bestand app/etc/local.xml aan

Copieer database van productie naar testphpMyAdmin of script

Pas table core_config_data aan

Cache verversen / indices verversen

Page 8: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Werken met git

Page 9: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Even snel git uitleggen

Alle wijzigingen worden opgeslagen in repository

Repository kan overal zijnPrivate repositories: Eigen git server; GitHub; Assembla

Repository kan overal naar toe worden gecopieerd

Decentrale relatie tussen repository clonesRemote repositories: origin

Branches: master, dev

Page 10: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Waarom git?

VersiebeheerIncrementele backups

Restore naar specifieke commit

Logging van iedere wijziging (commits)

BranchingBundelen van wijzigingen (commits)

Gefaseerd doorvoeren van gebundelde wijzigingen

Page 11: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Bestanden copieren via git

Testomgevinggit commit file1

git push origin master

Productie omgevinggit pull origin master

Page 12: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Hetzelfde maar nu met branches

Testomgeving (“master” branch)git commit file1

git push origin master

Acceptatie omgevinggit pull origin master

git checkout production

git merge master

Productie omgeving (“production” branch)git pull origin production

Page 13: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Tips voor gebruik van git

Gebruik “master” branch voor development, niet productie

Maak een aparte git user per developerOf iets met SSH public keys

Gebruik een goede gitignore fileExclude: var/*, app/etc/local.xml

Page 14: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Nog wat dingetjes

Page 15: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Testomgeving aanpassen (1/2)

Development settingsCaching uit

JS / CSS merging uit

Geen performance settings (APC, memcache, Redis)

PHP display_errors aan

/errors/local.xml > print errors (voorbeeld: local.xml.sample)

New Relic

Page 16: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Testomgeving aanpassen (2/2)

Geen productie settingsAnalytics uit (GoogleAnalytics, Piwik)

Zet demo melding aanConfiguration > Design > HTML Head > Display Demo Store Notice

Zet betaalmethodes om naar sandbox- of test-modus

Configureer extra IP restrictie.htaccess > AuthName / AuthType / AuthUserFile

Page 17: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Toegang voor ontwikkelaars

Optie 1Git

Optie 2FTP accounts vooraf aanmaken

Magento folder(s) als Linux filesystem mounten binnen FTP folder

Page 18: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

Automatisch van productie naar test

Test moet in sync blijven met productie

Script om automatisch test up to date te brengengit pull origin master

cp ~/settings/local.xml.test app/etc/local.xml

mysql -u root -p testdb < var/sql/production_latest.xml

mysql -u root -p testdb < ~/settings/local.sql

Page 19: Magento testomgeving

Presentatie “Magento testomgevingen” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo

tweet @yireo