16. 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.
17. 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...
36. Including Build Kit module set
;
; myproject.make
;
api = 2
core = 7.x
; Include Build Kit install profile makefile via URL
includes[] = http://drupalcode.org/project/buildkit.git/../drupal-org.make
; Modules ====================================================================
projects[views_bulk_operations][subdir] = contrib
projects[coffee][subdir] = contrib
37. Build Kit: A closer look
Demonstrating makefile inclusion and recursion.
38. Build Kit provides 2 make
‣ distro.make: Drupal core with possible core
patches and a link to download drupal-org.make
‣ drupal-org.make: a selection of common modules
from drupal.org
39. Build Kit: full content
$ git clone --branch 7.x-2.x http://git.drupal.org/project/buildkit.git
...
$ ls -al buildkit/
total 48
drwxr-xr-x 9 ademarco staff 306 Jun 14 15:45 .
drwxrwxr-x@ 20 ademarco staff 680 Jun 14 15:45 ..
drwxr-xr-x 13 ademarco staff 442 Jun 14 15:45 .git
-rw-r--r-- 1 ademarco staff 3868 Jun 14 15:45 README.txt
-rw-r--r-- 1 ademarco staff 583 Jun 14 15:45 buildkit.info
-rw-r--r-- 1 ademarco staff 151 Jun 14 15:45 buildkit.install
-rw-r--r-- 1 ademarco staff 6 Jun 14 15:45 buildkit.profile
-rw-r--r-- 1 ademarco staff 849 Jun 14 15:45 distro.make
-rw-r--r-- 1 ademarco staff 902 Jun 14 15:45 drupal-org.make
40. buildkit / distro.make
api = 2
core = 7.x
projects[drupal][type] = core
projects[drupal][version] = "7.14"
; Use vocabulary machine name for permissions
; http://drupal.org/node/995156
projects[drupal][patch][995156] = http://drupal.org/files/issues/995156-5_portab
projects[buildkit][type] = profile
projects[buildkit][download][type] = git
projects[buildkit][download][url] = http://git.drupal.org/project/buildkit.git
projects[buildkit][download][branch] = 7.x-2.x
41. 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
51. 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
76. 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
99. Feature Server and Drush
$ # Drush goodies
$ drush | grep fserver
fserver-distro Update packaging for a distribution.
fserver-package Update packaging for a project.
fserver-status Determine the packaging status of a project.
$ # Build releases for feature_news based on GIT tags and branches
$ drush fserver-package feature_news
$ # Check releases status
$ drush fserver-status
Method Project New tags
git Feature News 7.x-1.0
git Feature Pages 7.x-1.0
...
104. 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)
105.
106. 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
107. 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
108.
109. Test #2: Installation
‣ Triggered by successful completion of Test #1
‣ Run drush site-install:
drush -y site-install ... myproject
‣ Expect successful completion
110.
111. Test #3: Configuration
‣ Triggered by successful completion of Test #2
‣ Relies on simpletest
‣ Run drush test-run
‣ Expect successful completion
112.
113. Thank You.
More on Code-Driven Development
http://nuvole.org/blog
http://nuvole.org/trainings
Notas do Editor
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
[Each of them lives in separate domains and can be shipped in different forms]\n
\n
\n
\n
Clear upgrade path [easy to make assumptions on configuration state]\nClean installation procedure [produce a “vanilla” database]\n
Clear upgrade path [easy to make assumptions on configuration state]\nClean installation procedure [produce a “vanilla” database]\n
\n
Illustrate make file: core directive, drupal version and core patches.\nthis only downloads drupal core, where is our distribution?\n
\n
Illustrate make file: core directive, drupal version and core patches.\nthis only downloads drupal core, where is our distribution?\n
\n
\n
Illustrate make file: core directive, drupal version and core patches.\nthis only downloads drupal core, where is our distribution?\n
\n
\n
\n
\n
\n
Illustrate make file: core directive, drupal version and core patches.\nthis only downloads drupal core, where is our distribution?\n
\n
\n
Illustrate make file: core directive, drupal version and core patches.\nthis only downloads drupal core, where is our distribution?\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Clear upgrade path [easy to make assumptions on configuration state]\nClean installation procedure [produce a “vanilla” database]\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Clear upgrade path [easy to make assumptions on configuration state]\nClean installation procedure [produce a “vanilla” database]\n