P: 949-230-3594 / [email protected]
Powerful Drupal Administration
Using Drush
O C T 2 5 , 2 0 1 1
EXIT
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
2ABOUTME
AUTHOR• Drupal & Flex book (2007)• Drupal Themes on Lynda.com
CONTRIBUTOR• Donate and contribute Drupal code• Level 7 on CertifiedToRock.com • Drupal since 2005
COMMUNITY LEADER• Organizer, Speaker, Volunteer• Teaching since 2007
SENIOR CONSULTANT• Stauffer.com (based in L.A.)• PHP/Drupal• Web Architecture & Development
P: 949-230-3594 / [email protected]
EXIT
3PART#1
Site AliasesPart 1 Part 2 Part 3
STAUFFER NEW MEDIA DEVELOPMENT
P: 949-230-3594 / [email protected]
EXIT
4BESTPRACTICE
DEVELOPMENT“Dev”
DEV STAGE PROD
STAGING“Stage”
PRODUCTION“Prod” or “Live”
STAUFFER NEW MEDIA DEVELOPMENT
P: 949-230-3594 / [email protected]
EXIT
5BESTERPRACTICER
TESTING“QA”
QA STAGE PROD
STAGING“Stage”
PRODUCTION“Prod” or “Live”
STAUFFER NEW MEDIA DEVELOPMENT
P: 949-230-3594 / [email protected]
DEVELOPMENT“Dev”
DEV
EXIT
6ELPROBLEMO
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
Big Problem: Wasted time and energyProblem: Communication confusion
Problem: Unfriendly interface
> drush long-command --url=example.com --not-fun --complex --hard-to-read=TRUE --wish-this-was-easier --FML
My “Dev” or your “Dev”?
Wait! You have your own “Dev”?
drupal
example.com
example.local
dev.example.com
stage.example.com
old.example.com
beta.example.com
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
7
P: 949-230-3594 / [email protected]
We nickname projects.We nickname clients.We nickname environments.
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
8
P: 949-230-3594 / [email protected]
We nickname our sites
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
9
P: 949-230-3594 / [email protected]
Drush Site AliasesAllow nicknames to be recognized for Drupal sites and their settings.
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
10
P: 949-230-3594 / [email protected]
$ drush @dev status
... is the same as...
$ drush --root=/path/to/drupal --uri=dev.example.com status
EXIT
11IMMEDIATEGAIN
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
Convenience*Standards*SpeedShareArchive
*some assembly required
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
12DEFAULTALIASES
P: 949-230-3594 / [email protected]
@self
default
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
13MYALIASES
P: 949-230-3594 / [email protected]
@selfdefault@project_1@project_1.dev@project_1.qa@project_1.stage@project_1.prod
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
15CONFIGSETTINGS
P: 949-230-3594 / [email protected]
Start with...uri = site domaindb-url = database connection string root = path to Drupalremote-host = remote IP or hostname
Then move onto...path-aliases (%dump_dir, %files, %custom)parent
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
16NEWALIASES
P: 949-230-3594 / [email protected]
drush sa @self --full --with-optional
P: 949-230-3594 / [email protected]
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
17
P: 949-230-3594 / [email protected]
1./etc/drush2. In the drush folder3. Inside an ‘aliases’ folder within the drush folder4.$HOME/.drush
5. Inside the Drupal ‘sites’ folder
Alias file name saved as:1.ALIASNAME.alias.drushrc.php2.aliases.drushrc.php3.GROUPNAME.aliases.drushrc.php
ALIASDETECTION
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
18ADVANCEDUSES
P: 949-230-3594 / [email protected]
// Easy database syncing!drush sync @qa @stage
// Easy file syncing!drush rsync @stage @prod
STAUFFER NEW MEDIA DEVELOPMENT
EXIT
19DOCUMENTATION
P: 949-230-3594 / [email protected]
drush help sa
drush docs-aliases
Basic help
Detailed docs & example code
www.drush.org
P: 949-230-3594 / [email protected]
THANKYOUATTEND FUTURE MEETUPS FOR PARTS 2&3
EXIT
STAUFFER NEW MEDIA DEVELOPMENT NowHiring
Recommended