Damian Luszczymak - MM14NL

40
MAGENTO AND CONTINUOUS INTEGRATION

description

Magento and Continuous Integration Integration, what you can do? How you can use CI Systems with Magento and how to start. I show you one possible way to introduce this in small company’s or even for your private project without much money.

Transcript of Damian Luszczymak - MM14NL

Page 1: Damian Luszczymak - MM14NL

MAGENTO AND CONTINUOUS INTEGRATION

Page 2: Damian Luszczymak - MM14NL

Damian Luszczymak● Freelancer● Magento since 2008● Father of Magento Hackathon● Firegento Member● Search, Import / Export

Page 3: Damian Luszczymak - MM14NL
Page 4: Damian Luszczymak - MM14NL
Page 5: Damian Luszczymak - MM14NL
Page 6: Damian Luszczymak - MM14NL
Page 7: Damian Luszczymak - MM14NL
Page 8: Damian Luszczymak - MM14NL
Page 9: Damian Luszczymak - MM14NL

Battle Plan

Page 10: Damian Luszczymak - MM14NL
Page 11: Damian Luszczymak - MM14NL
Page 12: Damian Luszczymak - MM14NL
Page 13: Damian Luszczymak - MM14NL
Page 14: Damian Luszczymak - MM14NL
Page 15: Damian Luszczymak - MM14NL
Page 16: Damian Luszczymak - MM14NL
Page 17: Damian Luszczymak - MM14NL

Coding Guidelines

Programming style is a set of rules or guidelines used when writing the source code for a computer program. It is often claimed that following a particular programming style will help programmers to read and understand source code conforming to the style, and help to avoid introducing errors.

Page 18: Damian Luszczymak - MM14NL

! phpcs !

● PEAR● PSR-1● PSR-2● Zend● …..

https://github.com/madedotcom/phpcs-magento-rules

Page 19: Damian Luszczymak - MM14NL
Page 20: Damian Luszczymak - MM14NL
Page 21: Damian Luszczymak - MM14NL
Page 22: Damian Luszczymak - MM14NL
Page 23: Damian Luszczymak - MM14NL

Git HookCheck if php syntax is correct

.git/hooks/pre-commit

#!/usr/bin/php

<?php

// Grab all added, copied or modified files into $output array

exec('git diff --cached --name-status --diff-filter=ACM', $output);

foreach ($output as $file) {

$fileName = trim(substr($file, 1));

// We only want to check PHP files

if (pathinfo($fileName,PATHINFO_EXTENSION) == "php") {

$lint_output = array();

// Check syntax with PHP lint

exec("php -l " . escapeshellarg($fileName), $lint_output, $return);

if ($return == 0) {

continue;

} else {

echo implode("\n", $lint_output), "\n";

exit(1);

}

}

}

exit(0);

Page 24: Damian Luszczymak - MM14NL

Know your IDE

Page 25: Damian Luszczymak - MM14NL

http://magicento.com

Page 26: Damian Luszczymak - MM14NL

PHPUnit → EcomDev● EcomDev/EcomDev_PHPUnit/

This extension was created especially for resolving this problem and promoting test driven development practices in Magento developers community. It doesn't change core files or brake your Magento instalment database, because all the system objects are replaced during the run-time with the test ones and a separate database connection is used for tests.

Page 27: Damian Luszczymak - MM14NL

CI

● Jenkins / Hudson● Codeship.io● Drone.io● Cloudbees.com● Circelci.com

Page 28: Damian Luszczymak - MM14NL
Page 29: Damian Luszczymak - MM14NL
Page 30: Damian Luszczymak - MM14NL
Page 31: Damian Luszczymak - MM14NL
Page 32: Damian Luszczymak - MM14NL
Page 33: Damian Luszczymak - MM14NL

Your journey just started

● Continues Deployment● Build Notifications● Github vs. Bitbucket vs. Private server● Modman● Composer (no git submodules available :-( )

Page 34: Damian Luszczymak - MM14NL
Page 35: Damian Luszczymak - MM14NL
Page 36: Damian Luszczymak - MM14NL
Page 37: Damian Luszczymak - MM14NL
Page 38: Damian Luszczymak - MM14NL
Page 39: Damian Luszczymak - MM14NL

Twitter / IRC => @daim2k5

[email protected]

Page 40: Damian Luszczymak - MM14NL

Join Firegento ;-)