SlideShare a Scribd company logo
Intro to Drush
  July 13, 2012
David Watson

    Rensselaer Polytechnic Institute
       −   Web Developer
           Experimental Media and
           Performing Arts Center (EMPAC)
       −   Adjunct Professor
           Web Systems Development

    Drupal Consultant
       −   ~3 years in the community
       −   Specialized Generalist
Development Problems

    Speed of performing tasks
        −   Site Installation
        −   Module Management
        −   Site Administration
        −   Feature Management
        −   Creating Test Content

    Ability to script tasks from the shell
        −   Shell scripts
        −   Integration with other systems/IDEs
Solution? Drush!

    Drupal Shell

    Command line utility intended for *nix-based
    environments
       −   Limited Windows support via cygwin

    Exposes common Drupal tasks via the
    command line

    Allows other modules to provide commands
       −   Devel
       −   Features
Drush Installation

    Drush is not like most other projects!

    Collection of local scripts, not a module you
    install on a site

    Up-to-date installation info can be found on
    the drush project page
        −   drupal.org/project/drush
Site Installation (normal)

    Open browser

    Visit drupal.org

    Download Drupal

    Decompress

    Run install.php from browser

    Choose install profile

    Configure site/database
Drupal Download (drush)

    cd /path/to/destination/dir

    drush dl
        −    Downloads the latest Drupal version when
             called with no arguments
        −    Can also be used to download projects
Quick Note...

    Most other commands that operate on a site
    must be run from within that site's root
    directory

    Running the command within a subdirectory is
    also acceptable, though supplied paths are
    generally relative to the Drupal root, not the
    working directory
Site Installation (drush)

    drush si [install_profile]
        −   Installs Drupal from scratch, flushing the
            database first
        −   Optionally accepts the machine name of an
            install profile
        −   Can supply database information via --db-url
            flag if necessary
Adding a Module (normal)

    Open the browser

    Visit module page on drupal.org

    Download the correct module version

    Decompress the module

    Move it into the appropriate directory
Adding a Module (drush)

    drush dl [module_name]
       −    Downloads a module with the given project
            shortname (the last part of the URL when
            you visit the project page)
       −    The latest and most stable will be retrieved
            by default, use --select to be prompted to
            choose
       −    Modules are downloaded to
            sites/default/files, use
            --destination=path/to/dest to specify (relative
            to Drupal root)
What About Themes?

    Themes and other projects are downloaded
    the exact same way

    Naturally, themes appear in
    sites/default/themes
Module Management (normal)

    Visit the module page

    Scroll through a (usually very) long list

    Select the module and confirm

    Confirm dependencies
Module Management (drush)

    drush en <module_name>
       −   Enables the module

    drush dis <module_name>
       −   Disables the module

    drush pm-uninstall <module_name>
       −   Uninstalls a disabled module completely
Module Management (drush)

    drush up [module_names]
       −   Checks for module updates
       −   Automatically runs update.php
       −   Will even update Drupal core minor releases
           if out of date!

    drush pmi <module_name>
       −   Retrieve more information than you could
           possibly need about a module
Administrative Tasks

    drush sql-dump --result-file=path/to/dest.sql
        −   Generate a SQL dump of the entire site

    drush uli <username>
        −   Provides a one-time login link for a user

    drush upwd <username>
        −   Set the password for a user

    drush u[u]blk <username>
        −   (un)blocks a given user
Features Integration

    drush fl
    −   Lists all features and their status

    drush fd <feature_name>
    −   Takes the diff between features exports in
        code and database
    −   Requires diff module
Features Integration

    drush fr <feature_name>
        −   Reverts a feature to code

    drush fra
        −   Reverts all features at once
Features Integration

    drush fu <feature_name>
       −   Updates a feature's code from the current
           database information, re-exporting it in place

    drush fe <feature_name>
    [component_name, ...]
       −   Exports a series of components to a new or
           existing feature
       −   Adding to an existing feature is “drush fa”
           before drush 5.x
Devel Integration

    drush fnv <function>
       −   Display source of a function

    drush hook <hook_name>
       −   List all hook implementations for examination
       −   The hook name should be without the
           “hook_” prefix
Devel Integration

    drush genc <nodes> <comments>
       −   Generate a set number of nodes and
           comments
       −   --types=types specifies which content types
           to use

    Similar command exist for users, taxonomy,
    etc.
All UI? Never Again!

    drush si -y empac_cms

    drush dl feeds

    drush en -y feeds

    # UI – oops; broke something!

    drush fra

    # UI – hack hack hack

    drush fe empac_cms_events feeds:events

    bzr commit -m “Added Feeds Importer”
This is just the start!

    drush help [command]
       −   Provides detailed help for a given command
       −   Command list and summary given with no
           arguments

    Other advanced features exist as well

    Other modules may provide additional drush
    integration
Questions?
Get in Touch!

    d.o – davidwatson

    e – dmw@davidwatson.name

    t - @caughtexception

    in – linkedin.com/in/davidmwatson

More Related Content

What's hot

Drush for drupal website builder
Drush for drupal website builderDrush for drupal website builder
Drush for drupal website builderAdolfo Nasol
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAJesus Manuel Olivas
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 
Speed up Drupal development with Drush
Speed up Drupal development with DrushSpeed up Drupal development with Drush
Speed up Drupal development with Drushkbasarab
 
Integrating Files Into Drupal 7 Authoring Workflow
Integrating Files Into Drupal 7 Authoring WorkflowIntegrating Files Into Drupal 7 Authoring Workflow
Integrating Files Into Drupal 7 Authoring WorkflowMatt Mendonca
 
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニングYoshikazu Aoyama
 
Hadoop installation on windows
Hadoop installation on windows Hadoop installation on windows
Hadoop installation on windows habeebulla g
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationhabeebulla g
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Paul McKibben
 
Improving Domino Designer ICON UK
Improving Domino Designer ICON UKImproving Domino Designer ICON UK
Improving Domino Designer ICON UKKathy Brown
 
Drupal module development training delhi
Drupal module development training delhiDrupal module development training delhi
Drupal module development training delhiunitedwebsoft
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsMicky Metts
 
Drupal on your laptop
Drupal on your laptopDrupal on your laptop
Drupal on your laptopSam Moore
 
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, PuppetPuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, PuppetPuppet
 
Get Started With Drupal
Get Started With DrupalGet Started With Drupal
Get Started With DrupalKartik Singhal
 

What's hot (20)

Drush
DrushDrush
Drush
 
Drush for drupal website builder
Drush for drupal website builderDrush for drupal website builder
Drush for drupal website builder
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Speed up Drupal development with Drush
Speed up Drupal development with DrushSpeed up Drupal development with Drush
Speed up Drupal development with Drush
 
Integrating Files Into Drupal 7 Authoring Workflow
Integrating Files Into Drupal 7 Authoring WorkflowIntegrating Files Into Drupal 7 Authoring Workflow
Integrating Files Into Drupal 7 Authoring Workflow
 
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
 
Local Drupal MultiSite Set-up
Local Drupal MultiSite Set-upLocal Drupal MultiSite Set-up
Local Drupal MultiSite Set-up
 
Linux
LinuxLinux
Linux
 
Hadoop installation on windows
Hadoop installation on windows Hadoop installation on windows
Hadoop installation on windows
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
 
Dbmail
DbmailDbmail
Dbmail
 
Improving Domino Designer ICON UK
Improving Domino Designer ICON UKImproving Domino Designer ICON UK
Improving Domino Designer ICON UK
 
Linux
LinuxLinux
Linux
 
Drupal module development training delhi
Drupal module development training delhiDrupal module development training delhi
Drupal module development training delhi
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal Concepts
 
Drupal on your laptop
Drupal on your laptopDrupal on your laptop
Drupal on your laptop
 
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, PuppetPuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
 
Get Started With Drupal
Get Started With DrupalGet Started With Drupal
Get Started With Drupal
 

Viewers also liked

Features & Installation Profiles
Features & Installation ProfilesFeatures & Installation Profiles
Features & Installation ProfilesDavid Watson
 
CFU Business Plan
CFU Business PlanCFU Business Plan
CFU Business Planhbilletter
 
VNP Resume
VNP ResumeVNP Resume
VNP Resumesnpar
 
SoCal Newsletter September 2012
SoCal Newsletter September 2012 SoCal Newsletter September 2012
SoCal Newsletter September 2012 socalMRA
 
Undine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsUndine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsDavid Watson
 
April 2012 SoCal Newsletter
April 2012 SoCal NewsletterApril 2012 SoCal Newsletter
April 2012 SoCal NewslettersocalMRA
 

Viewers also liked (6)

Features & Installation Profiles
Features & Installation ProfilesFeatures & Installation Profiles
Features & Installation Profiles
 
CFU Business Plan
CFU Business PlanCFU Business Plan
CFU Business Plan
 
VNP Resume
VNP ResumeVNP Resume
VNP Resume
 
SoCal Newsletter September 2012
SoCal Newsletter September 2012 SoCal Newsletter September 2012
SoCal Newsletter September 2012
 
Undine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsUndine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development Environments
 
April 2012 SoCal Newsletter
April 2012 SoCal NewsletterApril 2012 SoCal Newsletter
April 2012 SoCal Newsletter
 

Similar to Intro to Drush

Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилPVasili
 
Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Mediacurrent
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrupal Camp Delhi
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentGerald Villorente
 
drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010Florian Latzel
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013Chris Hales
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentationperceptum
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonDrush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonChris Charlton
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupalDay
 
Hong Kong Drupal User Group - Introduction of Drush
Hong Kong Drupal User Group - Introduction of DrushHong Kong Drupal User Group - Introduction of Drush
Hong Kong Drupal User Group - Introduction of DrushFrancis Yan
 
Automating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyondAutomating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyondNuvole
 
Drush und Multisite: drush_multi
Drush und Multisite: drush_multiDrush und Multisite: drush_multi
Drush und Multisite: drush_multiFlorian Latzel
 
Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For TechiesRobert Carr
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Ben Shell
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and AegirIztok Smolic
 
Drush - More Beer, Less Effort
Drush - More Beer, Less EffortDrush - More Beer, Less Effort
Drush - More Beer, Less EffortRuben Teijeiro
 
Devel for Drupal 8
Devel for Drupal 8Devel for Drupal 8
Devel for Drupal 8Luca Lusso
 

Similar to Intro to Drush (20)

Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
 
Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - Sivaji
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
 
drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentation
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonDrush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Hong Kong Drupal User Group - Introduction of Drush
Hong Kong Drupal User Group - Introduction of DrushHong Kong Drupal User Group - Introduction of Drush
Hong Kong Drupal User Group - Introduction of Drush
 
Automating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyondAutomating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyond
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Drush und Multisite: drush_multi
Drush und Multisite: drush_multiDrush und Multisite: drush_multi
Drush und Multisite: drush_multi
 
Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For Techies
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Drush
DrushDrush
Drush
 
Drush - More Beer, Less Effort
Drush - More Beer, Less EffortDrush - More Beer, Less Effort
Drush - More Beer, Less Effort
 
Devel for Drupal 8
Devel for Drupal 8Devel for Drupal 8
Devel for Drupal 8
 

Recently uploaded

一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理
一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理
一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理beduwt
 
Poze practica elevi la S.C. IATSA S.A. 2021
Poze practica elevi la S.C. IATSA S.A. 2021Poze practica elevi la S.C. IATSA S.A. 2021
Poze practica elevi la S.C. IATSA S.A. 2021EneIuliana
 
PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021
PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021
PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021EneIuliana
 
Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...
Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...
Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...ikennaaghanya
 
Captain america painting competition -- 14
Captain america painting competition -- 14Captain america painting competition -- 14
Captain america painting competition -- 14Su Yan-Jen
 
PHOTO PRESENTATION Z.pdf ...............
PHOTO PRESENTATION Z.pdf ...............PHOTO PRESENTATION Z.pdf ...............
PHOTO PRESENTATION Z.pdf ...............kahnanews24
 
thGAP - BAbyss in Moderno!! Transgenic Human Germline Alternatives Project
thGAP - BAbyss in Moderno!!  Transgenic Human Germline Alternatives ProjectthGAP - BAbyss in Moderno!!  Transgenic Human Germline Alternatives Project
thGAP - BAbyss in Moderno!! Transgenic Human Germline Alternatives ProjectMarc Dusseiller Dusjagr
 
Anyone Can Draw Zentangles Interactive Book.pdf
Anyone Can Draw Zentangles Interactive Book.pdfAnyone Can Draw Zentangles Interactive Book.pdf
Anyone Can Draw Zentangles Interactive Book.pdfKitleyDeFelice
 
evaluation final maxima.pptxiuiugiyuguy8g
evaluation final maxima.pptxiuiugiyuguy8gevaluation final maxima.pptxiuiugiyuguy8g
evaluation final maxima.pptxiuiugiyuguy8gLeonBraley
 
Barbara Stewart Scholarship Entries Spring 2024
Barbara Stewart Scholarship Entries Spring 2024Barbara Stewart Scholarship Entries Spring 2024
Barbara Stewart Scholarship Entries Spring 2024ccsfphoto
 
My New Youtube Channel Please Subscribe.
My New Youtube Channel Please Subscribe.My New Youtube Channel Please Subscribe.
My New Youtube Channel Please Subscribe.mohammedsarif2009
 
一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理
一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理
一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理beduwt
 
Tig N' Seek SB Test ________________________________
Tig N' Seek SB Test ________________________________Tig N' Seek SB Test ________________________________
Tig N' Seek SB Test ________________________________Nora Meek
 
Winning Shots from Siena International Photography Awards 2015
Winning Shots from Siena International Photography Awards 2015Winning Shots from Siena International Photography Awards 2015
Winning Shots from Siena International Photography Awards 2015rajeshkumar821445
 
Anyone Can Draw Zentangles Interactive Book
Anyone Can Draw Zentangles Interactive BookAnyone Can Draw Zentangles Interactive Book
Anyone Can Draw Zentangles Interactive Bookrajpal6695
 
Tackling Poverty in Nigeria, by growing Art-based SMEs
Tackling Poverty in Nigeria, by growing Art-based SMEsTackling Poverty in Nigeria, by growing Art-based SMEs
Tackling Poverty in Nigeria, by growing Art-based SMEsikennaaghanya
 
prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...
prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...
prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...LeonBraley
 
Family Group Pottery Sessions in Abu Dhabi
Family Group Pottery Sessions in Abu DhabiFamily Group Pottery Sessions in Abu Dhabi
Family Group Pottery Sessions in Abu DhabiAbu Dhabi Pottery
 
Portfolio slide deck example number one.pdf
Portfolio slide deck example number one.pdfPortfolio slide deck example number one.pdf
Portfolio slide deck example number one.pdfkayleeachang
 

Recently uploaded (20)

一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理
一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理
一比一原版UC Berkeley毕业证加利福尼亚大学|伯克利分校毕业证成绩单如何办理
 
Sundabet | Slot gacor dan terpercaya mudah menang
Sundabet | Slot gacor dan terpercaya mudah menangSundabet | Slot gacor dan terpercaya mudah menang
Sundabet | Slot gacor dan terpercaya mudah menang
 
Poze practica elevi la S.C. IATSA S.A. 2021
Poze practica elevi la S.C. IATSA S.A. 2021Poze practica elevi la S.C. IATSA S.A. 2021
Poze practica elevi la S.C. IATSA S.A. 2021
 
PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021
PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021
PRACTICA ELEVI LA S.C. NIDEC S.A. -- 2021
 
Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...
Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...
Digital/Computer Paintings as a Modern- day Igbo Artists’ vehicle for creatin...
 
Captain america painting competition -- 14
Captain america painting competition -- 14Captain america painting competition -- 14
Captain america painting competition -- 14
 
PHOTO PRESENTATION Z.pdf ...............
PHOTO PRESENTATION Z.pdf ...............PHOTO PRESENTATION Z.pdf ...............
PHOTO PRESENTATION Z.pdf ...............
 
thGAP - BAbyss in Moderno!! Transgenic Human Germline Alternatives Project
thGAP - BAbyss in Moderno!!  Transgenic Human Germline Alternatives ProjectthGAP - BAbyss in Moderno!!  Transgenic Human Germline Alternatives Project
thGAP - BAbyss in Moderno!! Transgenic Human Germline Alternatives Project
 
Anyone Can Draw Zentangles Interactive Book.pdf
Anyone Can Draw Zentangles Interactive Book.pdfAnyone Can Draw Zentangles Interactive Book.pdf
Anyone Can Draw Zentangles Interactive Book.pdf
 
evaluation final maxima.pptxiuiugiyuguy8g
evaluation final maxima.pptxiuiugiyuguy8gevaluation final maxima.pptxiuiugiyuguy8g
evaluation final maxima.pptxiuiugiyuguy8g
 
Barbara Stewart Scholarship Entries Spring 2024
Barbara Stewart Scholarship Entries Spring 2024Barbara Stewart Scholarship Entries Spring 2024
Barbara Stewart Scholarship Entries Spring 2024
 
My New Youtube Channel Please Subscribe.
My New Youtube Channel Please Subscribe.My New Youtube Channel Please Subscribe.
My New Youtube Channel Please Subscribe.
 
一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理
一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理
一比一原版UPenn毕业证宾夕法尼亚大学毕业证成绩单如何办理
 
Tig N' Seek SB Test ________________________________
Tig N' Seek SB Test ________________________________Tig N' Seek SB Test ________________________________
Tig N' Seek SB Test ________________________________
 
Winning Shots from Siena International Photography Awards 2015
Winning Shots from Siena International Photography Awards 2015Winning Shots from Siena International Photography Awards 2015
Winning Shots from Siena International Photography Awards 2015
 
Anyone Can Draw Zentangles Interactive Book
Anyone Can Draw Zentangles Interactive BookAnyone Can Draw Zentangles Interactive Book
Anyone Can Draw Zentangles Interactive Book
 
Tackling Poverty in Nigeria, by growing Art-based SMEs
Tackling Poverty in Nigeria, by growing Art-based SMEsTackling Poverty in Nigeria, by growing Art-based SMEs
Tackling Poverty in Nigeria, by growing Art-based SMEs
 
prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...
prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...
prodtion diary final ultima maxima.pptxadcaasfadfSDFAsdfasdfasdfasdfadfadfasd...
 
Family Group Pottery Sessions in Abu Dhabi
Family Group Pottery Sessions in Abu DhabiFamily Group Pottery Sessions in Abu Dhabi
Family Group Pottery Sessions in Abu Dhabi
 
Portfolio slide deck example number one.pdf
Portfolio slide deck example number one.pdfPortfolio slide deck example number one.pdf
Portfolio slide deck example number one.pdf
 

Intro to Drush

  • 1. Intro to Drush July 13, 2012
  • 2. David Watson  Rensselaer Polytechnic Institute − Web Developer Experimental Media and Performing Arts Center (EMPAC) − Adjunct Professor Web Systems Development  Drupal Consultant − ~3 years in the community − Specialized Generalist
  • 3. Development Problems  Speed of performing tasks − Site Installation − Module Management − Site Administration − Feature Management − Creating Test Content  Ability to script tasks from the shell − Shell scripts − Integration with other systems/IDEs
  • 4. Solution? Drush!  Drupal Shell  Command line utility intended for *nix-based environments − Limited Windows support via cygwin  Exposes common Drupal tasks via the command line  Allows other modules to provide commands − Devel − Features
  • 5. Drush Installation  Drush is not like most other projects!  Collection of local scripts, not a module you install on a site  Up-to-date installation info can be found on the drush project page − drupal.org/project/drush
  • 6. Site Installation (normal)  Open browser  Visit drupal.org  Download Drupal  Decompress  Run install.php from browser  Choose install profile  Configure site/database
  • 7. Drupal Download (drush)  cd /path/to/destination/dir  drush dl − Downloads the latest Drupal version when called with no arguments − Can also be used to download projects
  • 8. Quick Note...  Most other commands that operate on a site must be run from within that site's root directory  Running the command within a subdirectory is also acceptable, though supplied paths are generally relative to the Drupal root, not the working directory
  • 9. Site Installation (drush)  drush si [install_profile] − Installs Drupal from scratch, flushing the database first − Optionally accepts the machine name of an install profile − Can supply database information via --db-url flag if necessary
  • 10. Adding a Module (normal)  Open the browser  Visit module page on drupal.org  Download the correct module version  Decompress the module  Move it into the appropriate directory
  • 11. Adding a Module (drush)  drush dl [module_name] − Downloads a module with the given project shortname (the last part of the URL when you visit the project page) − The latest and most stable will be retrieved by default, use --select to be prompted to choose − Modules are downloaded to sites/default/files, use --destination=path/to/dest to specify (relative to Drupal root)
  • 12. What About Themes?  Themes and other projects are downloaded the exact same way  Naturally, themes appear in sites/default/themes
  • 13. Module Management (normal)  Visit the module page  Scroll through a (usually very) long list  Select the module and confirm  Confirm dependencies
  • 14. Module Management (drush)  drush en <module_name> − Enables the module  drush dis <module_name> − Disables the module  drush pm-uninstall <module_name> − Uninstalls a disabled module completely
  • 15. Module Management (drush)  drush up [module_names] − Checks for module updates − Automatically runs update.php − Will even update Drupal core minor releases if out of date!  drush pmi <module_name> − Retrieve more information than you could possibly need about a module
  • 16. Administrative Tasks  drush sql-dump --result-file=path/to/dest.sql − Generate a SQL dump of the entire site  drush uli <username> − Provides a one-time login link for a user  drush upwd <username> − Set the password for a user  drush u[u]blk <username> − (un)blocks a given user
  • 17. Features Integration  drush fl − Lists all features and their status  drush fd <feature_name> − Takes the diff between features exports in code and database − Requires diff module
  • 18. Features Integration  drush fr <feature_name> − Reverts a feature to code  drush fra − Reverts all features at once
  • 19. Features Integration  drush fu <feature_name> − Updates a feature's code from the current database information, re-exporting it in place  drush fe <feature_name> [component_name, ...] − Exports a series of components to a new or existing feature − Adding to an existing feature is “drush fa” before drush 5.x
  • 20. Devel Integration  drush fnv <function> − Display source of a function  drush hook <hook_name> − List all hook implementations for examination − The hook name should be without the “hook_” prefix
  • 21. Devel Integration  drush genc <nodes> <comments> − Generate a set number of nodes and comments − --types=types specifies which content types to use  Similar command exist for users, taxonomy, etc.
  • 22. All UI? Never Again!  drush si -y empac_cms  drush dl feeds  drush en -y feeds  # UI – oops; broke something!  drush fra  # UI – hack hack hack  drush fe empac_cms_events feeds:events  bzr commit -m “Added Feeds Importer”
  • 23. This is just the start!  drush help [command] − Provides detailed help for a given command − Command list and summary given with no arguments  Other advanced features exist as well  Other modules may provide additional drush integration
  • 25. Get in Touch!  d.o – davidwatson  e – dmw@davidwatson.name  t - @caughtexception  in – linkedin.com/in/davidmwatson