jisse reitsma - mm14nl

19

Click here to load reader

Upload: dutchento

Post on 10-May-2015

292 views

Category:

Software


0 download

DESCRIPTION

Usage of GIT and FTP accounts When you have a live Magento shop, you should have a testing site as well. But how do you setup a copy of your site? And how to give third party developers access to your environment? This talk covers moving Magento sites, usage of Git and FTP-accounts, but also best practices when actively copying changes from test to production.

TRANSCRIPT

Page 1: Jisse Reitsma - MM14NL

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

Magento testomgeving

Page 2: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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

Voor wie?

Magento shop eigenaren

Magento bouwers

Page 4: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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

OTAP

Ontwikkeling

Test

Acceptatie

Productie

Page 6: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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

Werken met git

Page 9: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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

Nog wat dingetjes

Page 15: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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: Jisse Reitsma - MM14NL

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

tweet @yireo