SlideShare a Scribd company logo
1 of 23
Drush
Productivity FTW!
Problems
• Lack of productivity in workflow
o OTAP
• Repeating tasks
o Deployments
o Creating module assets
• Nothing was automated
o what can be automated
Solutions
• Every developer optimizes
o It's our nature 
• Bash scripts
• IDE improvements
• OS shortcuts
Introducing Miss Athena
• Greek goddess
• of Intelligence
• of War
• and hand labour
Athena Bash
 
Drush Commands
$ drush svn add
$ drush svn delete
$ drush svn cleanup
$ drush deploy dev
$ drush deploy stg
$ drush deploy db
$ drush deploy all
$ drush module add
$ drush make nas.make
Drush Commands
$ drush svn add
Does this but with less typing: 
& svn status |grep '?' |awk '{print $2}'| xargs svn add
Drush Commands
$ drush svn add
/**
 * Handles svn add
 *
 * @param array $settings
 */
function _repository_svn_add($settings) {
  $cmd = "svn status |grep '?' |awk '{print $2}'| xargs svn add";
  $settings['show_output'] == TRUE ? system($cmd) : exec($cmd);
  drush_print("Athena says: Added your files to svn, just commit honey.n");
}
Drush Commands
$ drush svn delete
Does this but with less typing: 
$ svn status | grep '^!' | sed 's/! *//' | xargs -I% svn rm %
Drush Commands
$ drush deploy dev
Deploy to development
• Commit code
• SSH development
• Update the project with subversion up
Drush Commands
$ drush deploy stg
Deploy to staging
• Do everything to update development
• Use deployer tool link (or SSH staging)
• Update the project with subversion up
Drush Commands
$ drush deploy db
Deploy to database to staging
• Take dump from development
• Backup current staging database
• Import database on staging
Drush Commands
$ drush deploy all
Deploy to all to staging
• Does database flow
• Does code flow
Drush Commands
/**
 * Implementation of hook_drush_command().
 **/
function deployment_drush_command() {
  $items = array();
  $items['deploy'] = array(
    'description' => "Deploy code and/or database to development/staging.",
    'arguments' => array(
      'dev', 'stg', 'db', 'all'
    ),
    'examples' => array(
      'deploy dev',
      'deploy stg',
      'deploy db',
      'deploy all',
    ),
    'aliases' => array(),
    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
  );
  return $items;
}
Drush Commands
/**
 * drush command callback. This is where the action takes place.
 */
function drush_deployment_deploy($type = '') {
  $settings = _athena_load_settings('global');
  $project = _athena_load_settings('project');
  switch (strtolower($type)) {
    case 'dev':
      _deployment_deploy_dev($settings, $project, TRUE);
      break;
    default:
      drush_print("Athena says: Honey, what exactly do I need to deploy? n");
      break;
  }
}
Drush Commands
/**
 * Handles deploy_dev
 *
 * @param array $settings
 * @param array $project
 * @param bool $exit
 */
function _deployment_deploy_dev($settings, $project, $exit = TRUE) {
  $cmd = "ssh ". $settings['username'] ."@development "cd /data/". $project['name'] . "/static; svn up;";
  $cmd .= $exit == TRUE ? "exit;"" : """;
  $settings['show_output'] == TRUE ? system($cmd) : exec($cmd);
  drush_print("Athena says: Deployed your code to development honey.n");
}
Drush Commands
$ drush module add %module_name
• Create .info file with content
• Create .module file with at least a hook_menu
• Create folders
o /includes
o /js
o /css
o /theme
• (Open all files in your IDE)
Drush Commands
$ drush make nas.make
; pressflow
projects[pressflow][type] = "core"
projects[pressflow][download][type] = "get"
projects[pressflow][download][url] = "http://files.pressflow.org/pressflow-6-current.tar.gz"
; install profile
projects[nas_site][type] = profile
projects[nas_site][download][type] = svn
projects[nas_site][download][url] = http://svn/svn/drupal_modules/nas_profiles/branches/DRUPAL-6--
1/nas_site
Drush Commands
$ drush make nas.make
; features
projects[feature_site][type] = module
projects[feature_site][subdir] = features
projects[feature_site][download][type] = svn
projects[feature_site][download][url] = http://svn/svn/drupal_modules/feature_site/branches/DRUPAL-6--1
projects[feature_block][type] = module
projects[feature_block][subdir] = features
projects[feature_block][download][type] = svn
projects[feature_block][download][url] = http://svn/svn/drupal_modules/feature_block/branches/DRUPAL-6--1
projects[feature_webform][type] = module
projects[feature_webform][subdir] = features
projects[feature_webform][download][type] = svn
projects[feature_webform][download][url] = http://svn/svn/drupal_modules/feature_webform/branches/DRUPAL-6--1
projects[feature_multilingual][type] = module
projects[feature_multilingual][subdir] = features
projects[feature_multilingual][download][type] = svn
projects[feature_multilingual][download][url] = http://svn/svn/drupal_modules/feature_multilingual/branches/DRUPAL-6--1
Drush Wishlist
$ drush dl en %project -y
• drush dl %project
• drush en %project (after download)
Drush Wishlist
$ drush force-uninstall %project -y
• drush dis %project
• drush uninstall %project
Drush Wishlist
$ drush force-uninstall %project -y
• drush dis %project
• drush uninstall %project
Thank you
• kristof.van.roy@nascom.be
• http://www.twitter.com/kristofvanroy

More Related Content

What's hot

You Don't Need Lodash
You Don't Need Lodash You Don't Need Lodash
You Don't Need Lodash UpsideTravel
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pmRyosuke IWANAGA
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Puppet
 
Perl on Amazon Elastic MapReduce
Perl on Amazon Elastic MapReducePerl on Amazon Elastic MapReduce
Perl on Amazon Elastic MapReducePedro Figueiredo
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetWalter Heck
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Workhorse Computing
 
Hacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from PerlHacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from Perltypester
 
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet
 
This is not your father's monitoring.
This is not your father's monitoring.This is not your father's monitoring.
This is not your father's monitoring.Mathias Herberts
 
Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108Mathias Herberts
 
Lightweight wrapper for Hive on Amazon EMR
Lightweight wrapper for Hive on Amazon EMRLightweight wrapper for Hive on Amazon EMR
Lightweight wrapper for Hive on Amazon EMRShinji Tanaka
 
Docker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersDocker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersJosh Braegger
 
Moose - YAPC::NA 2012
Moose - YAPC::NA 2012Moose - YAPC::NA 2012
Moose - YAPC::NA 2012xSawyer
 
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...Drupaltour
 
Manage and Deploy your sites with Drush
Manage and Deploy your sites with DrushManage and Deploy your sites with Drush
Manage and Deploy your sites with DrushAmazee Labs
 
jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Featuresdmethvin
 

What's hot (20)

You Don't Need Lodash
You Don't Need Lodash You Don't Need Lodash
You Don't Need Lodash
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...
 
My life as a beekeeper
My life as a beekeeperMy life as a beekeeper
My life as a beekeeper
 
Perl on Amazon Elastic MapReduce
Perl on Amazon Elastic MapReducePerl on Amazon Elastic MapReduce
Perl on Amazon Elastic MapReduce
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
 
Hacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from PerlHacking Mac OSX Cocoa API from Perl
Hacking Mac OSX Cocoa API from Perl
 
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
 
This is not your father's monitoring.
This is not your father's monitoring.This is not your father's monitoring.
This is not your father's monitoring.
 
Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108
 
dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
 
Lightweight wrapper for Hive on Amazon EMR
Lightweight wrapper for Hive on Amazon EMRLightweight wrapper for Hive on Amazon EMR
Lightweight wrapper for Hive on Amazon EMR
 
Docker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersDocker & CoreOS at Utah Gophers
Docker & CoreOS at Utah Gophers
 
Moose - YAPC::NA 2012
Moose - YAPC::NA 2012Moose - YAPC::NA 2012
Moose - YAPC::NA 2012
 
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
 
Manage and Deploy your sites with Drush
Manage and Deploy your sites with DrushManage and Deploy your sites with Drush
Manage and Deploy your sites with Drush
 
jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Features
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 

Similar to Drush Productivity FTW - DUG @ Krimson

Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.Alex S
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Alex S
 
Drush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrupalCampDN
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data ObjectsWez Furlong
 
Creating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QACreating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QAarchwisp
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebMikel Torres Ugarte
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with CapistranoLaunchAny
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
 
Improving Dev Assistant
Improving Dev AssistantImproving Dev Assistant
Improving Dev AssistantDave Cross
 
Drupal - dbtng 25th Anniversary Edition
Drupal - dbtng 25th Anniversary EditionDrupal - dbtng 25th Anniversary Edition
Drupal - dbtng 25th Anniversary Editionddiers
 
Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mateCodemotion
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 

Similar to Drush Productivity FTW - DUG @ Krimson (20)

Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014
 
Drush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrush - use full power - Alexander Schedrov
Drush - use full power - Alexander Schedrov
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data Objects
 
Creating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QACreating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QA
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
EC2
EC2EC2
EC2
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
DBI
DBIDBI
DBI
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Improving Dev Assistant
Improving Dev AssistantImproving Dev Assistant
Improving Dev Assistant
 
Drupal - dbtng 25th Anniversary Edition
Drupal - dbtng 25th Anniversary EditionDrupal - dbtng 25th Anniversary Edition
Drupal - dbtng 25th Anniversary Edition
 
Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mate
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 

Drush Productivity FTW - DUG @ Krimson

  • 2. Problems • Lack of productivity in workflow o OTAP • Repeating tasks o Deployments o Creating module assets • Nothing was automated o what can be automated
  • 3. Solutions • Every developer optimizes o It's our nature  • Bash scripts • IDE improvements • OS shortcuts
  • 4. Introducing Miss Athena • Greek goddess • of Intelligence • of War • and hand labour
  • 6. Drush Commands $ drush svn add $ drush svn delete $ drush svn cleanup $ drush deploy dev $ drush deploy stg $ drush deploy db $ drush deploy all $ drush module add $ drush make nas.make
  • 7. Drush Commands $ drush svn add Does this but with less typing:  & svn status |grep '?' |awk '{print $2}'| xargs svn add
  • 8. Drush Commands $ drush svn add /**  * Handles svn add  *  * @param array $settings  */ function _repository_svn_add($settings) {   $cmd = "svn status |grep '?' |awk '{print $2}'| xargs svn add";   $settings['show_output'] == TRUE ? system($cmd) : exec($cmd);   drush_print("Athena says: Added your files to svn, just commit honey.n"); }
  • 9. Drush Commands $ drush svn delete Does this but with less typing:  $ svn status | grep '^!' | sed 's/! *//' | xargs -I% svn rm %
  • 10. Drush Commands $ drush deploy dev Deploy to development • Commit code • SSH development • Update the project with subversion up
  • 11. Drush Commands $ drush deploy stg Deploy to staging • Do everything to update development • Use deployer tool link (or SSH staging) • Update the project with subversion up
  • 12. Drush Commands $ drush deploy db Deploy to database to staging • Take dump from development • Backup current staging database • Import database on staging
  • 13. Drush Commands $ drush deploy all Deploy to all to staging • Does database flow • Does code flow
  • 14. Drush Commands /**  * Implementation of hook_drush_command().  **/ function deployment_drush_command() {   $items = array();   $items['deploy'] = array(     'description' => "Deploy code and/or database to development/staging.",     'arguments' => array(       'dev', 'stg', 'db', 'all'     ),     'examples' => array(       'deploy dev',       'deploy stg',       'deploy db',       'deploy all',     ),     'aliases' => array(),     'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,   );   return $items; }
  • 15. Drush Commands /**  * drush command callback. This is where the action takes place.  */ function drush_deployment_deploy($type = '') {   $settings = _athena_load_settings('global');   $project = _athena_load_settings('project');   switch (strtolower($type)) {     case 'dev':       _deployment_deploy_dev($settings, $project, TRUE);       break;     default:       drush_print("Athena says: Honey, what exactly do I need to deploy? n");       break;   } }
  • 16. Drush Commands /**  * Handles deploy_dev  *  * @param array $settings  * @param array $project  * @param bool $exit  */ function _deployment_deploy_dev($settings, $project, $exit = TRUE) {   $cmd = "ssh ". $settings['username'] ."@development "cd /data/". $project['name'] . "/static; svn up;";   $cmd .= $exit == TRUE ? "exit;"" : """;   $settings['show_output'] == TRUE ? system($cmd) : exec($cmd);   drush_print("Athena says: Deployed your code to development honey.n"); }
  • 17. Drush Commands $ drush module add %module_name • Create .info file with content • Create .module file with at least a hook_menu • Create folders o /includes o /js o /css o /theme • (Open all files in your IDE)
  • 18. Drush Commands $ drush make nas.make ; pressflow projects[pressflow][type] = "core" projects[pressflow][download][type] = "get" projects[pressflow][download][url] = "http://files.pressflow.org/pressflow-6-current.tar.gz" ; install profile projects[nas_site][type] = profile projects[nas_site][download][type] = svn projects[nas_site][download][url] = http://svn/svn/drupal_modules/nas_profiles/branches/DRUPAL-6-- 1/nas_site
  • 19. Drush Commands $ drush make nas.make ; features projects[feature_site][type] = module projects[feature_site][subdir] = features projects[feature_site][download][type] = svn projects[feature_site][download][url] = http://svn/svn/drupal_modules/feature_site/branches/DRUPAL-6--1 projects[feature_block][type] = module projects[feature_block][subdir] = features projects[feature_block][download][type] = svn projects[feature_block][download][url] = http://svn/svn/drupal_modules/feature_block/branches/DRUPAL-6--1 projects[feature_webform][type] = module projects[feature_webform][subdir] = features projects[feature_webform][download][type] = svn projects[feature_webform][download][url] = http://svn/svn/drupal_modules/feature_webform/branches/DRUPAL-6--1 projects[feature_multilingual][type] = module projects[feature_multilingual][subdir] = features projects[feature_multilingual][download][type] = svn projects[feature_multilingual][download][url] = http://svn/svn/drupal_modules/feature_multilingual/branches/DRUPAL-6--1
  • 20. Drush Wishlist $ drush dl en %project -y • drush dl %project • drush en %project (after download)
  • 21. Drush Wishlist $ drush force-uninstall %project -y • drush dis %project • drush uninstall %project
  • 22. Drush Wishlist $ drush force-uninstall %project -y • drush dis %project • drush uninstall %project
  • 23. Thank you • kristof.van.roy@nascom.be • http://www.twitter.com/kristofvanroy