{"id":414,"date":"2013-05-06T17:50:55","date_gmt":"2013-05-07T01:50:55","guid":{"rendered":"https:\/\/maxbronsema.com\/blog\/?p=414"},"modified":"2013-05-06T17:50:55","modified_gmt":"2013-05-07T01:50:55","slug":"5-drush-make-tips-and-tricks","status":"publish","type":"post","link":"https:\/\/maxbronsema.com\/blog\/2013\/05\/06\/5-drush-make-tips-and-tricks\/","title":{"rendered":"5 Drush Make tips and tricks"},"content":{"rendered":"<p>Drush make is a fantastic tool that lets us basically have a build file for each site or multi-site base instance. I pair the make file with a custom installation profile and <a href=\"http:\/\/www.aegirproject.org\/\">Aegir<\/a> but on its own it is a powerful tool. Drush 5 supports a few upgrades for make so it is worth upgrading if appropriate from Drush 4.<\/p>\n<h3>5 Tips and Tricks<\/h3>\n<h4>1. Use <a href=\"http:\/\/drushmake.me\/\">http:\/\/drushmake.me\/<\/a> to generate a decent base make file for new projects.<\/h4>\n<p>This is also a handy way to see popular modules and libraries that have somehow been beneath your radar.<\/p>\n<h4>2. Patch your modules with Drush.<\/h4>\n<p>The syntax is fairly straightforward. You can also chain patches by applying one and then applying the next.<\/p>\n<p><code>projects[<em>project name<\/em>][patch][] = \"url to patch\"<\/code><\/p>\n<p>For example, to patch the CAS module for using SSL\/TLSv1 you would do the following: projects[cas][patch][] = &#8220;http:\/\/drupal.org\/files\/enforce_tlsv1_0.patch&#8221;<\/p>\n<h4>3. Download your custom modules via git.<\/h4>\n<p>To do this you need to tell Drush make to use git and then you simply provide the public repository URL.<br \/>\n<code><br \/>\nprojects[wwuzen_gsa][download][type] = \"git\"<br \/>\nprojects[wwuzen_gsa][download][url] = \"https:\/\/bitbucket.org\/wwuweb\/wwu-google-search-appliance.git\"<br \/>\nprojects[wwuzen_gsa][type] = \"module\"<\/code><\/p>\n<p>Unlike normal make projects you download you do not need to provide a version, but you do need to state that it is a git project and provide the URL. Whatever you put in the [] after the word projects is what the directory will be created as.<\/p>\n<h4>4. Move sub-directories within libraries to their proper location.<\/h4>\n<p>Often, external libraries do not extract from a tar or zip with the file your Drupal module is looking for. It might be buried inside of a sub-directory. With Drush 5 we can move them upon the build.This is an example from the CAS library.<\/p>\n<p><code>libraries[CAS][download][subtree] = CAS-1.3.2\/<\/code><\/p>\n<p>With the subtree identified, Drush make will dowload and extract the library like normal, and then move the contents of the sub-directory CAS-1.3.2 into the main directory CAS. It might take a few attempts to figure out whether you need a \/ in front of the directory or not but the end result is a library extracted properly.<\/p>\n<h4>5. Move libraries upon install anywhere you would like.<\/h4>\n<p>The feeds module loves to have the Simple Pie XML parser library inside of it&#8217;s own module directory. What a pain. However, Drush make can move it for us.<br \/>\n<code><br \/>\nlibraries[simplepie][destination] = \"sites\/all\/modules\/feeds\/libraries\"<\/code><\/p>\n<p>Just plop in the destination you would like to have the library moved to and the script makes it so. (<em>Pun intended<\/em>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Drush make is a fantastic tool that lets us basically have a build file for each site or multi-site base instance. I pair the make file with a custom installation profile and Aegir but on its own it is a powerful tool. Drush 5 supports a few upgrades for make so it is worth upgrading &hellip; <a href=\"https:\/\/maxbronsema.com\/blog\/2013\/05\/06\/5-drush-make-tips-and-tricks\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">5 Drush Make tips and tricks<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,2],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-drupal","category-web-development"],"_links":{"self":[{"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":11,"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/posts\/414\/revisions\/425"}],"wp:attachment":[{"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maxbronsema.com\/blog\/wp-json\/wp\/v2\/tags?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}