Skip to Content

Drupal

Web Omelette: How to use Drush Make in your daily routine

Planet Drupal - 3 June 2014 - 12:15am

This is a guest post from Kate Marshalkina, a Russian Drupal developer who works for Licel LLC. Enjoy the read and check out some of her other work.

Drush Make is well-known as an advanced tool for Drupal distribution building. But it also can be very useful for those who have never dealt with distributions. One great example is applying patches like a boss.

In this article I’ll show you how I use Drush Make to automate some of my routine tasks and help me to discover great Drupal stuff.

Drush Make commands

Drush Make includes 2 commands which are already built in Drush itself:

  1. make — Turns a .makefile into a Drupal codebase.
  2. make-generate — Generates a .makefile from the current Drupal site.

Both commands are related to a .makefile — flat text file with Drush Make instructions. You can read more about .makefile syntax here.

But for now, let's go deeper and see Drush Make in action.

Rebuild your development environment

How often do you install a new and clean Drupal site for development, testing or demonstration purposes? Additionally to Drupal core, developers usually have a predefined list of favorite modules like Administration Menu, Views or something more special. With Drush Make you can automate this process greatly by combining all the projects you need into one file and lettting Drush Make build it for you.

Here is an example .makefile for a multilingual testing site:

; Drush Make API version. api = 2 ; Drupal core. core = 7.x ;Common modules. projects[admin_menu][subdir] = "contrib" projects[ctools][subdir] = "contrib" projects[token][subdir] = "contrib" projects[views][subdir] = "contrib" ; Development modules. projects[devel][subdir] = "development" ; Multilingual modules. projects[fallback_language_negotation][subdir] = "contrib" projects[variable][subdir] = "contrib" projects[i18n][subdir] = "contrib" projects[i18nviews][subdir] = "contrib" ; Load some translations. translations[] = de translations[] = ru

This file can be saved locally (in ~/.drush/make-files/d7_i18n.make for example) or hosted on a remote server like GitHub.

To use it, let’s run the make command to prepare our custom build on our server (in /var/www/drupal_test.local for example):

$ drush make d7_i18n.make /var/www/drupal_test.local

The first run can be quite long, but the next time Drush will take most of projects from its cache.

As a result, the latest Drupal core, contrib modules and translations from the .makefile will be downloaded and placed in appropriate folders. Now you can go to your site's URL and run the install.php or run the installation process directly with Drush:

$ drush si --db-url="mysql://user:password@localhost/databasename" --site-name="Drupal Multilingual"

Additionally, you can also generate a tarball from the .makefile with --tar option:

$ drush make d7_i18n.make drupal_multilingual --tar

Add to that a couple of features (based on Features module) and you’ll end up with your own distro.

Download dependencies

Have you ever noticed that some contrib modules provide .make or .make.example file? These usually contain a list of specific external libraries (like the jQuery Colorbox plugin for the Colorbox module). These file can be built inside existing Drupal codebases using the --no-core flag. As an example, let’s say you want to download the Chosen module:

$ drush dl chosen Project chosen (7.x-2.0-beta4) downloaded to sites/all/modules/contrib/chosen. $ drush make sites/all/modules/contrib/chosen/chosen.make.example --no-core chosen downloaded from https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip

In this case, the proper jQuery plugin was downloaded and unzipped into the proper directory inside the libraries/ folder. Isn’t that handy?

Module developers, please, add a .make.example file into your Drupal.org projects if you are using any external libraries. Instead of building custom Drush commands like chosen-plugin, we can use Drush Make. Just compare 117 lines to 7.

Generate makefile from existing site

You can easily share a custom Drupal build with Drush Make. First run generate-makefile command from Drupal root to generate a skeleton:

$ drush generate-makefile drupal_custom_build.make

The generated file drupal_custom_build.make will contain instructions for all enabled projects with specific versions. If a project has .git folder, Drush Make will automatically set appropriate properties:

projects[redirect][type] = "module" projects[redirect][download][type] = "git" projects[redirect][download][url] = "http://git.drupal.org/project/redirect.git" projects[redirect][download][branch] = "7.x-1.x" projects[redirect][download][revision] = "0b7b8dc2d58cb277874d87c91c45f0a361e148f7"

This file still needs a quick manual review. For example, you can add patch references. In my project, 2 patches are applied to the Redirect module:

projects[redirect][patch][] = "https://drupal.org/files/issues/redirect-global-905914-145.patch" projects[redirect][patch][] = "https://drupal.org/files/issues/redirect.circular-loops.1796596-146.patch"

The resulting .makefile may be very useful if you want to share your working environment with a colleague or to provide definitive info for troubleshooting.

Bonus! Explore Drupal world!

Finally, the Drush Make file itself is a good read for discovering new cool contrib projects. Check out well-tested Commerce Kickstart or OpenScholar .makefiles with plenty of interesting projects inside.

I hope this article will help you use Drush more widely, to automate some of your tasks or to even build your first distribution!

About the Author

Kate is a passionate web developer from Russia who fell in love with Drupal in 2011.

She cares about multilingual stuff, usability and performance.

 

Connect with Kate:
Twitter | drupal.org | Google +

var switchTo5x = true;stLight.options({"publisher":"dr-8de6c3c4-3462-9715-caaf-ce2c161a50c"});
Categories: Drupal

CivicActions: Connect with CivicActions at DrupalCon Austin

Planet Drupal - 2 June 2014 - 11:13pm

All week, members of the CivicActions team will be in Austin, Texas for DrupalCon 2014. If you plan on attending, you can find us at booth 608 in the Exhibit Hall.

In addition to our sponsorship and participation, we've put together a great resource called the Civic Lounge, in partnership with our friends at Drupal Squad, NuCivic and Albatross Digital.

The Civic Lounge offers all kinds of ways to co connect with fellow civic-minded Drupalistas, including:

So, come find us at the booth, join the party and connect with your Civic-Drupal community. We can't wait to see you there!

Topics
Categories: Drupal

Drupal core announcements: No Drupal core release on Wednesday, June 4

Planet Drupal - 2 June 2014 - 8:57pm

The monthly Drupal core bug fix release window is scheduled for this Wednesday. However, the last release was a month ago and this is DrupalCon week, so there won't be a bug fix release this month. Enjoy DrupalCon (those of you who are there)!

Upcoming release windows include:

  • Wednesday, June 18 (security release window)
  • Wednesday, July 2 (bug fix release window)

For more information on Drupal core release windows, see the documentation on release timing and security releases, and the discussion that led to this policy being implemented.

Categories: Drupal

X-Team: DrupalCamp Singapore 2014

Planet Drupal - 2 June 2014 - 8:50pm
Drupal definitely has one of the biggest and largest communities in the world. I can still remember one of Dries Buytaert’s tweets showing the rapid growth of Drupal by showing a photo of a few attendees at the first DrupalCon, compared with the most recent which was packed. (On a side note: It’s exciting to...
Categories: Drupal

ThinkDrop Consulting: Bats of a Feather: HubDrop, DevShop, & Aegir at DrupalCon Austin

Planet Drupal - 2 June 2014 - 7:48pm

I'm on the plane headed to my 4th DrupalCon, and this one is looking like a good time.  

So much is happening this year. Drupal 8 is getting closer and closer to release, more and more Drupal businesses and services are being launched, and we continue to develop our Drupal products.

While my session on DevShop wasn't accepted, I am personally involved in a lot of BoF sessions this year.

Drupal.org & GitHub, Living in Harmony: HubDrop.io

On Tuesday, I'll be discussing the future of Drupal.org and GitHub integration via HubDrop.io, our git-mirror-as-a-service.  If you are interested in moving your module development to GitHub, but want to keep the code going to drupal.org to keep integrated with it's release system, than HubDrop is for you.  

We will chat about what HubDrop is, what it will be in the future, and we'll fan the long-running flamewar over whether drupal code hosting should just move to GitHub.

Room 10A (Ashday), 3rd floor.  Tuesday - 5:00 to 6:00

The Great Multisite Debate

This BoF session was spawned by what I thought was a simple question posted on Twitter:

Hey @getpantheon and @acquia_support: True or False? You're #drupal multisite-ish offerings support site specific modules/themes/etc.

— Jon Pugh (@jonpugh) May 16, 2014

After a flurry of replies, Jakub Suchy from Acquia suggested to continue the conversation as a DrupalCon BoF.

Apparently I touched on a controversial subject!  

Multisite is a powerful (some would say dangerously so) feature of Drupal that let's you host many sites pointed at a single codebase on a server, and the Drupal hosting as a service companies out there are starting to offer multisite and multisite-like services.  

Aegir is built on the concept of multisite, but it's not a requirement to use it.  

During a temporary lapse in judgement, I offered to moderate this throwdown, so wish me luck.

Expect to see representatives from the Aegir project, Pantheon, Acquia, and more.  It's bound to be a spirited debate!

Room 8A - JustDigital | 3rd floor.  Thursday · 10:45-11:45

Aegir Hosting Project

Now that I've been invited to become a maintainer of the Aegir project, Christopher Gervais (the aegir lead) has invited me to join him at the Birds of a Feather session.

Come see what's new in Aegir 3, chat with other aegir users, and talk about what might be in store for the future.

Room 8B - Unicon | 3rd floor. Thursday · 02:15-03:15

Future of DevShop, Aegir, & Open Cloud Software

As an alternative to my session on DevShop, I've scheduled a BoF on the future of DevShop.  I'd like to have a conversation about what people are interested and where things could go from here.  

As the year progresses I plan on releasing more tools for Aegir & DevShop for cloud management. 

If you haven't heard of DevShop yet, go read my session proposal: DevShop: Drupal DevOps in a Box
https://austin2014.drupal.org/session/devshop-drupal-devops-box

Bats of a Feather

So the BoFs are certainly where it is at this year.  I hope to see you there.  Please don't be afraid to get in touch if you'd like to meetup beyond the BoFs!

http://twitter.com/jonpugh

http://thinkdrop.net/contact

 

 

 

 

Tags: Planet DrupalDrupalCon
Categories: Drupal

Exaltation of Larks: Using HSTS for Better Security — and a Better Developer Experience

Planet Drupal - 2 June 2014 - 3:45pm

You’ve probably come across this situation before. When visiting a certain site, you see a browser warning that the website is using mixed content — both HTTP and HTTPS together.

Avoiding mixed content is nothing new to some web developers, but read on if you’re looking for a quick fix to prevent both mixed content warnings and CSRF attacks, which are the underlying reason why browsers have those warnings in the first place.

Introducing HSTS

read more

Categories: Drupal

Cameron Eagans: Introducing estmt.me

Planet Drupal - 2 June 2014 - 3:10pm

For somebody working in a development agency, estimation is a critical part of the job. Different companies handle this process differently, and the method can be anything from a wild guess ("That'll cost around $n") to a very methodic approach.

Categories: Drupal

Mogdesign: 3 quick reasons why supporting #d8rules is important for Drupal future

Planet Drupal - 2 June 2014 - 2:05pm
1) Turning point in embracing crowdfunding
Categories: Drupal

DrupalCon Austin News: DrupalCon North America Kicks Off in Austin

Planet Drupal - 2 June 2014 - 11:20am

DrupalCon Austin 2014 kicks off today in Austin, Texas, at the Austin Convention Center. More than 3,300 people are expected to attend the event, which offers educational and networking opportunities for the mix of developers, designers, IT managers, agencies and Fortune 500 companies that make up the Drupal community.

Categories: Drupal

Blink Reaction: What Symfony Components are Going into Drupal 8?

Planet Drupal - 2 June 2014 - 9:28am

In the first post of this series, we looked at why Symfony is being included in Drupal 8, and what that means for longtime Drupal developers. Now that we've considered the implications, just what is getting incorporated into Drupal?

Drupal is not using Symfony as a full stack framework. Rather, it is taking advantage of specific components. This post is essentially a list of these components with a link and a brief description for each.

Categories: Drupal

Appnovation Technologies: 3 Reasons Why E-commerce Sites Should Use Drupal Commerce

Planet Drupal - 2 June 2014 - 7:35am
Drupal Commerce is a very simple, yet powerful, framework that can cater to all business needs; it is the best platform for facilitating e-commerce on your website. Here are three reasons why e-commerce sites should use Drupal Commerce. var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});
Categories: Drupal

DrupalCon Austin News: O’Reilly Media Book Signings at DrupalCon

Planet Drupal - 2 June 2014 - 7:32am

Meet some well-known Drupal authors and get a free, signed copy of their Drupal books courtesy of O’Reilly Media, a DrupalCon Media Partner.

Wednesday, 12:30-1:00
Title: High Performance Drupal
Authors: Jeff Sheltren & Narayan Newton

Wednesday, 3:15-3:45
Title: Drupal for Designers & Drupal Development Tricks for Designers
Author: Dani Nordin

Categories: Drupal

Acquia: Installing Drupal 8 on Acquia Cloud

Planet Drupal - 2 June 2014 - 7:28am

Want to use the most awesome version of Drupal on the most awesome Drupal hosting? ;) This guide is for you!

Let's Get Started!

First, head to http://www.acquia.com/acquia-cloud-free to set up your new site. This process takes a few minutes, but worry not; you can bide your time watching helpful tutorial videos! Once your site is provisioned, you'll be taken to the Acquia Cloud workflow page.

Categories: Drupal

Banckle.Helpdesk

New Drupal Modules - 1 June 2014 - 11:11pm

Banckle.Helpdesk for Drupal module provide personalized customer support services with web based ticketing management system.

Banckle.Helpdesk Features

Helpdesk Automation - Invisible to Customers Leverage the benefits of help desk automation, without your customers having to go through any changes. Send responses from the Banckle.Helpdesk web app, get delivered as simple and personalized emails to your customers..

Categories: Drupal
Syndicate content


Google+
about seo