The best way to download Introducing Drush Make
Drush MakeDrush make is a Drush command thatcan create a ready-to-use Drupal site,pulling sources from variouslocations. In practical terms, thismeans that it is possible to distributea complicated Drupal distribution as asingle text ﬁle.
Drush Make‣ A single .info ﬁle to describe modules, dependencies and patches‣ A one-line command to download contributed and custom code: libraries, modules, themes, etc...
Applying patches; distro.make; Usage:; $ drush make distro.make [directory];api = 2core = 7.xprojects[drupal][type] = coreprojects[drupal][version] = "7.7"; Make system directories configurable to allow tests in profiles/[name]/modules; http://drupal.org/node/911354projects[drupal][patch] = http://drupal.org/files/issues/911354.43.patch; Missing drupal_alter() for text formats and filters; http://drupal.org/node/903730projects[drupal][patch] = http://drupal.org/files/issues/drupal.filter-al...
Applying patches$ drush make distro.make myprojectdrupal-7.7 downloaded.drupal patched with 911354.43.patch.drupal patched with drupal.filter-alter.82.patch.drupal patched with 995156-5_portable_taxonomy_permissions.patch.Generated PATCHES.txt file for drupal
Including an external makeﬁle; distro.make;; $ drush make buildkit.make [directory];api = 2core = 7.x; Include Build Kit distro makefile via URLincludes = http://drupalcode.org/project/buildkit.git/../7.x-2.x:/distro.make
Including Build Kit module set;; myproject.make;api = 2core = 7.x; Include Build Kit install profile makefile via URLincludes = http://drupalcode.org/project/buildkit.git/../drupal-org.make; Modules ====================================================================projects[views_bulk_operations][subdir] = contribprojects[coffee][subdir] = contrib
Build Kit: A closer lookDemonstrating makeﬁle inclusion and recursion.
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
Build Kit: full content$ git clone --branch 7.x-2.x http://git.drupal.org/project/buildkit.git...$ ls -al buildkit/total 48drwxr-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
buildkit / distro.makeapi = 2core = 7.xprojects[drupal][type] = coreprojects[drupal][version] = "7.14"; Use vocabulary machine name for permissions; http://drupal.org/node/995156projects[drupal][patch] = http://drupal.org/files/issues/995156-5_portabprojects[buildkit][type] = profileprojects[buildkit][download][type] = gitprojects[buildkit][download][url] = http://git.drupal.org/project/buildkit.gitprojects[buildkit][download][branch] = 7.x-2.x
Your project: 2 make ﬁles‣ 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-speciﬁc modules and themes
Proﬁles: just likemodules ‣ An .info ﬁle to specify installation dependencies ‣ An .install ﬁle to perform installation tasks and upgrades ‣ Fully customizable via .proﬁle ﬁles ‣ Can include makeﬁles and other stuff
Generating a new installation proﬁle $ drush bake starter-profile/distro.make myproject
Generating a new installation proﬁle$ # Create new installation profile starting from starter-profile template$ drush bake starter-profile/distro.make myproject...$ tree myproject-profilemyproject-profile!"" README.txt!"" distro.make!"" drushrc.php!"" myproject.info!"" myproject.install!"" myproject.make%"" myproject.profile
Generated distro.make$ cat myproject-profile/distro.makeapi = 2core = 7.xprojects[drupal][type] = coreprojects[drupal][version] = "7.12"; Make system directories configurable to allow tests in profiles/[name]/modules; http://drupal.org/node/911354projects[drupal][patch] = http://drupal.org/files/issues/911354.43.patch...projects[myproject][type] = profileprojects[myproject][download][type] = gitprojects[myproject][download][url] = git.nuvole.org:/var/git/myproject-profile.gi
Full bootstrap$ # Push profile folder to Nuvole server following internal conventions$ git nuvole myproject-profile$ # Build the project$ drush make myproject-profile/distro.make myprojectdrupal-7.12 downloaded. [ok]drupal patched with 911354.43.patch. [ok]drupal patched with drupal.filter-alter.82.patch. [ok]drupal patched with 995156-5_portable_taxonomy_permissions.patch. [ok]Generated PATCHES.txt file for drupal [ok]myproject cloned from git.nuvole.org:/var/git/myproject-profile.git.[ok]Found makefile: myproject.make [ok]libraries-7.x-1.0 downloaded. [ok]rubik-7.x-4.0-beta7 downloaded. [ok]twist cloned from git.nuvole.org:/var/git/twist.git. [ok]feature_core cloned from git.nuvole.org:/var/git/feature_core.git. [ok]Found makefile: feature_core.make [ok]...
Bootstrap your project in 3 steps$ drush bake starter-profile/distro.make myproject$ git nuvole myproject-profile$ drush make myproject-profile/distro.make myproject
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 conﬁguration into PHP code, in the form of a module.‣ http://drupal.org/project/features
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-statusMethod Project New tagsgit Feature News 7.x-1.0git Feature Pages 7.x-1.0...
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)
Test #1: Makeﬁle‣ Clone your code from git‣ Run drush make‣ Test that the proﬁle is downloaded‣ Test that modules are placed in the expected folders
Test #1: Shell commands‣ drush -y --pipe make distro.make‣ test -d proﬁles/myproject‣ test -d proﬁles/myproject/modules/contrib‣ test -d proﬁles/myproject/modules/custom‣ test -d proﬁles/myproject/modules/features
Test #2: Installation‣ Triggered by successful completion of Test #1‣ Run drush site-install: drush -y site-install ... myproject‣ Expect successful completion
Test #3: Conﬁguration‣ Triggered by successful completion of Test #2‣ Relies on simpletest‣ Run drush test-run‣ Expect successful completion
Thank You.More on Code-Driven Development http://nuvole.org/blog http://nuvole.org/trainings