Drush Presentation by Srijan

Embed Size (px)

Citation preview

  • 8/8/2019 Drush Presentation by Srijan

    1/18

    Srijan Technologies Pvt. Ltd.

    Drush:Drush:The ubercool Drupal moduleThe ubercool Drupal module

    By :-Aradhana (@arraysaq)Shashank (@shashtra)

    http://twitter.com/arraysaqhttp://twitter.com/shashtrahttp://twitter.com/shashtrahttp://twitter.com/arraysaq
  • 8/8/2019 Drush Presentation by Srijan

    2/18

    Srijan Technologies Pvt. Ltd.

    Drush is a command line shell and Unix scriptinginterface for Drupal, a veritable Swiss Army knife

    designed to make life easier for those of us who spendsome of our working hours hacking away at thecommand prompt.

    --Drush Project Page

  • 8/8/2019 Drush Presentation by Srijan

    3/18

    Srijan Technologies Pvt. Ltd.

    Drush InstallationDrush Installation(On Ubuntu)(On Ubuntu)

  • 8/8/2019 Drush Presentation by Srijan

    4/18Srijan Technologies Pvt. Ltd.

    The InstallThe Install

    The Easy Way

    sudo apt-get installdrush

    The not-so-easy way(but not that hardtoo!)

    untar the packagefrom drupal.org

    put it in home folder

    and create symlink inusr/bin

  • 8/8/2019 Drush Presentation by Srijan

    5/18Srijan Technologies Pvt. Ltd.

    But why do I need to use Drush ?(yes!! its a valid question)

  • 8/8/2019 Drush Presentation by Srijan

    6/18Srijan Technologies Pvt. Ltd.

    Drush TDrush Time Saverime Saver

    Typical Way to Drupal :

    Go to site page, look for required version and download.Install and add necessary modules and themes etc.

    Drush Way to Drupal :

    drush dl drupal (it installs Drupal directly)

    drush dl module1 module2 theme1 theme2 module3

    For a specific drupal/module version, use:drush dl drupal-6.x-1.0-beta3

  • 8/8/2019 Drush Presentation by Srijan

    7/18Srijan Technologies Pvt. Ltd.

    Useful Drush commandsUseful Drush commands

    enable/disable/uninstall

    status help cron dl info

    cache watchdog show update update, updatecode, updatedb search status search-reindex search-index

  • 8/8/2019 Drush Presentation by Srijan

    8/18

    Srijan Technologies Pvt. Ltd.

    Not only this, but more..Not only this, but more..

    (coz Drush is extensible)

    Integrates with most commonly used modules and lets you dothe configurations.

    Example Backup and Migrate module:

    bam backup to backup the site's db bam restore to restore the site db

    bam backups to get the list of all backups stored.

  • 8/8/2019 Drush Presentation by Srijan

    9/18

    Srijan Technologies Pvt. Ltd.

    Some other modules that integrate withDrush ;)

    Devel

    Node Export

    Apache Solr

    Provision

    XML Sitemap Views Bulk Operations

    Recommender API

    And many more http://drupal.org/projects_with_drush

    http://drupal.org/project/modules?filters=tid:4654&solrsort=sis_project_release_usage%20deschttp://drupal.org/project/modules?filters=tid:4654&solrsort=sis_project_release_usage%20desc
  • 8/8/2019 Drush Presentation by Srijan

    10/18

    Srijan Technologies Pvt. Ltd.

    It does not just let us work with modules but

    build the whole projects too. And that too very

    rapidly.

    One of the most loved features ofDrush is

    Drush Make.

  • 8/8/2019 Drush Presentation by Srijan

    11/18

    Srijan Technologies Pvt. Ltd.

    Drush MakeDrush Make

    Drush make is an extension to drush that can create a

    ready-to-use drupal site, pulling sources from various

    locations. --Drush Project Page

  • 8/8/2019 Drush Presentation by Srijan

    12/18

    Srijan Technologies Pvt. Ltd.

    .Make file.Make file

    .make file Adheres to .info standards and is a flat text

    file.

    drush make example.make example

  • 8/8/2019 Drush Presentation by Srijan

    13/18

    Srijan Technologies Pvt. Ltd.

    How does the example.make file looks likeHow does the example.make file looks like

    core = 6.x

    projects[] = drupal

    projects[] = viewsprojects[cck] = 2.6

    projects[ctools][version] = 1.3

    projects[data][type] = module

    projects[data][download][type] = cvs

    projects[data][download][module] = contributions/modules/data

    projects[data][download][revision] = DRUPAL-6--1projects[tao][type] = theme

    projects[tao][download][type] = git

    projects[tao][download][url] = git://github.com/developmentseed/tao.git

    projects[admin_menu][subdir] = custom

  • 8/8/2019 Drush Presentation by Srijan

    14/18

    Srijan Technologies Pvt. Ltd.

    .Make file demo.Make file demo

    Ad-libbing of people when you are being shown

    live example.

  • 8/8/2019 Drush Presentation by Srijan

    15/18

    Srijan Technologies Pvt. Ltd.

    Installation ProfileInstallation Profile

    Installation Profiles traditionally have been a piece of PHP

    code that tells Drupal what to do when the site is installed.

    When one used to download that install profile, they would

    just get that file.

    Drupal.org, using Drush Make as a backend, now allows

    modules and themes to come with profiles, all in the same

    file.

  • 8/8/2019 Drush Presentation by Srijan

    16/18

    Srijan Technologies Pvt. Ltd.

    .Make file for search installation profile.Make file for search installation profile

    core = "6.x"

    api = 2

    projects[] = "drupal"

    projects[] = "acquia_connector"

    projects[apachesolr][download][type] = "cvs"

    projects[apachesolr][download][module] = "contributions/modules/apachesolr"

    projects[apachesolr][download][revision] = "DRUPAL-6--2"

    projects[acquia_search][type] = "module"

    projects[acquia_search][download][type] = "svn"

    projects[acquia_search][download][url] = "https://svn.acquia.com/drupal/branches/1.x-6.x/modules/acquia/acquia_search/"

    libraries[SolrPhpClient][download][type] = "get"

    libraries[SolrPhpClient][download][url] = "http://solr-php-client.googlecode.com/files/SolrPhpClient.r22.2009-11-09.tgz"

    libraries[SolrPhpClient][destination] = "modules/apachesolr"

    I D h th f t f h D l bI D h th f t f h D l b

  • 8/8/2019 Drush Presentation by Srijan

    17/18

    Srijan Technologies Pvt. Ltd.

    Is Drush the future of how Drupal can beIs Drush the future of how Drupal can beused?used?

    Most certainly

    But we would need to standardize some practices.

    Sync and re-sync is another area that we might want toexplore.

    Questions to ourselves.

    Can we incorporate such a practice?

    What about the Windows people? (NO you cant outcastthem!!)

  • 8/8/2019 Drush Presentation by Srijan

    18/18

    Srijan Technologies Pvt. Ltd.

    Thank You