12. The best way to download code
Introducing Drush Make
13.
14. Drush Make
Drush make is a Drush command that
can create a ready-to-use Drupal site,
pulling sources from various
locations. In practical terms, this
means that it is possible to distribute
a complicated Drupal distribution as a
single text file.
15. Drush Make
‣ A single .info file to describe
modules, dependencies and
patches
‣ A one-line command to download
contributed and custom code:
libraries, modules, themes, etc...
34. Your project: 2 make files
‣ distro.make: Drupal core with possible core
patches and a link to download myproject.make
‣ myproject.make: includes BuildKit’s
drupal-org.make plus project-specific modules and
themes
42. Profiles: just like modules
‣ An .info file to specify installation
dependencies
‣ An .install file to perform
installation tasks and upgrades
‣ Fully customizable via .profile files
‣ Can include makefiles and other
stuff
57. What is a feature?
‣ A collection of Drupal elements
which taken together satisfy a
certain use-case.
‣ A modular piece of functionality for
a Drupal site.
‣ A way to export configuration into
PHP code, in the form of a module.
‣ http://drupal.org/project/features
74. Meet Continuous Integration (CI)
Use Hudson/Jenkins to automatically test:
1. Makefile
2. Installation
3. Configuration
75.
76. Building a CI Job
‣ Create a job for testing your site
‣ Triggered:
‣ Manually
‣ Scheduled
‣ By events (git push or other jobs)
‣ A job can consist of ant scripts or simple shell
commands (including drush)
77.
78. Test #1: Makefile
‣ Clone your code from git
‣ Run drush make
‣ Test that the profile is downloaded
‣ Test that modules are placed in the expected
folders
79. Test #1: Shell commands
‣ drush -y --pipe make distro.make
‣ test -d profiles/myproject
‣ test -d profiles/myproject/modules/contrib
‣ test -d profiles/myproject/modules/custom
‣ test -d profiles/myproject/modules/features
80.
81. Test #2: Installation
‣ Triggered by successful completion of Test #1
‣ Run drush site-install:
drush -y site-install ... myproject
‣ Expect successful completion
82.
83. Test #3: Configuration
‣ Triggered by successful completion of Test #2
‣ Relies on simpletest
‣ Run drush test-run
‣ Expect successful completion
84.
85. Thank You.
More on Code-Driven Development
http://nuvole.org/blog
http://nuvole.org/trainings