SlideShare a Scribd company logo
1 of 16
AUTOMATIC DRUPAL DEPLOYMENT
WITH DRUSH MAKE
September 2015
KEY CONSULTING
• Drush make provides the possibility of automatic Drupal
project generation
• A functional site with specific versions and custom
modules could be generated only configuring a script
• This gives us high efficiency when we want to start a
new project, environment or restore an existing one
• Internet connection
• Drush: installed and configured
• A main script file created by us
• A folder with all necessary .make files,
custom modules and themes, patches
and other files
• DrushCmd.script
• main_script.sh
– Our main script to run all the process
• /project_name/custom_modules/*.tar.gz
– All compressed custom modules we want to add to the project
• /project_name/custom_themes/*.tar.gz
– All compressed custom themes we want to add to the project
• /project_name/files/*
– Files we want to add manually to the project (libraries, translation files …)
• /project_name/patches/*.patch
– All patches we want to apply during the process
• /project_name/DrushCmd.script
– Script provided to ease Drupal make deployment
• /project_name/*.make
– All make files to be executed that will be described further
• Main script will need to follow all the necessary steps:
– Prepare drush make with DrushCmd.script
– Call drush make installation command
– Copy or overwrite missing files
– Patch files
– Purge useless files and folders
– Do any needed action to have our site working
• Example: we could decide to generate a database
for the site
# Clean target folder
project/DrushCmd.script --alias-path=project --cible=@project.integration --rm-all
# Add make files to the project
project/DrushCmd.script --alias-path=project --cible=@project.integration --make-trans=project/project.integration.make
project/DrushCmd.script --alias-path=project --cible=@project.integration --make-
trans=project/project.core_contrib.make
project/DrushCmd.script --alias-path=project --cible=@project.integration --make-trans=project/project.custom.make
project/DrushCmd.script --alias-path=project --cible=@project.integration --make-trans=project/project.theme.make
# Run automatic process
cd application/contenus && drush make project.integration.make --no-cache -y --prepare-install
# Copy translation file
cp /root/project/files/drupal-7.22.fr.po profiles/minimal/translations/
# Patch lightbox2 module
patch -p1 sites/all/modules/lightbox2/js/lightbox.js < /root/project/patches/lightbox2-1.patch
# Remove useless files and folders
rm -v .gitignore
rm -v CHANGELOG.txt
rm -v COPYRIGHT.txt
rm -v INSTALL.txt
• It is a script provided to us which eases drush make process
• It allows different options to:
– remove all previous files
– transmission of make files to the integration server
– Drupal installation with module activation
– apply needed patches
– profile transmission to the integration server
– profile configuration
– post installation actions
• We could tecnically have only one .make file but it will be more
organized to have one make file for every section: core and
contrib modules, custom modules and themes
• The first make file needs to start with these lines, specifying Core
and api versions
– core = 7.x
– api = 2
• In this main .make file we can include other make files like this
• It is recommended to create a make file for these configurations
• It is possible to download core, libraries and modules directly from external URLs (or
internal if we prefer)
• Core:
– We just need to select the core version we want to install and the URL to
download it
• Libraries:
– As core version we can install Drupal libraries directly from internal or external
URLs
• Contrib modules:
– The same for contrib modules
• It is advisable to create a separated make file for
these modules
• Here, it is possible to include custom modules
or contrib modules which are not available
anymore
• It is possible to include modules from an
internal path instead of an external URL
• In addition we can have a separated make file to
include themes
• Custom themes can be included like custom
modules
• If there is a module and a theme with the same
name, we can use the directory_name
parameter to avoid conflicts
• After the Drupal installation we could wish
to replace or add some files.
– For example: language configurations or any
file needed for the project
• To achieve this we can add lines to copy
or overwrite files in the main script file
• It is also possible to patch files instead of
overwritting them. This could be necessary
in some case, for example: module or
theme conflicts, customize contrib
modules, hard-coded changes
• For this we can also patch directly Drupal
modules using make files
• It is also possible to remove useless files and folders in
the main script file:
– Example:
• Unnecessary Drupal core files
• Unnecessary Drupal module files
• And purge .make files which were transfered at the
beginning of the process:
• rm -v *.make
• Drush make:
– https://www.drupal.org/project/drush_make
• Drush:
– https://www.drupal.org/project/drush
• Patches:
– https://dev.acquia.com/blog/patching-drush-make

More Related Content

Recently uploaded

Recently uploaded (20)

Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Automatic Drupal deployment with drush make

  • 1.
  • 2. AUTOMATIC DRUPAL DEPLOYMENT WITH DRUSH MAKE September 2015 KEY CONSULTING
  • 3. • Drush make provides the possibility of automatic Drupal project generation • A functional site with specific versions and custom modules could be generated only configuring a script • This gives us high efficiency when we want to start a new project, environment or restore an existing one
  • 4. • Internet connection • Drush: installed and configured • A main script file created by us • A folder with all necessary .make files, custom modules and themes, patches and other files • DrushCmd.script
  • 5. • main_script.sh – Our main script to run all the process • /project_name/custom_modules/*.tar.gz – All compressed custom modules we want to add to the project • /project_name/custom_themes/*.tar.gz – All compressed custom themes we want to add to the project • /project_name/files/* – Files we want to add manually to the project (libraries, translation files …) • /project_name/patches/*.patch – All patches we want to apply during the process • /project_name/DrushCmd.script – Script provided to ease Drupal make deployment • /project_name/*.make – All make files to be executed that will be described further
  • 6. • Main script will need to follow all the necessary steps: – Prepare drush make with DrushCmd.script – Call drush make installation command – Copy or overwrite missing files – Patch files – Purge useless files and folders – Do any needed action to have our site working • Example: we could decide to generate a database for the site
  • 7. # Clean target folder project/DrushCmd.script --alias-path=project --cible=@project.integration --rm-all # Add make files to the project project/DrushCmd.script --alias-path=project --cible=@project.integration --make-trans=project/project.integration.make project/DrushCmd.script --alias-path=project --cible=@project.integration --make- trans=project/project.core_contrib.make project/DrushCmd.script --alias-path=project --cible=@project.integration --make-trans=project/project.custom.make project/DrushCmd.script --alias-path=project --cible=@project.integration --make-trans=project/project.theme.make # Run automatic process cd application/contenus && drush make project.integration.make --no-cache -y --prepare-install # Copy translation file cp /root/project/files/drupal-7.22.fr.po profiles/minimal/translations/ # Patch lightbox2 module patch -p1 sites/all/modules/lightbox2/js/lightbox.js < /root/project/patches/lightbox2-1.patch # Remove useless files and folders rm -v .gitignore rm -v CHANGELOG.txt rm -v COPYRIGHT.txt rm -v INSTALL.txt
  • 8. • It is a script provided to us which eases drush make process • It allows different options to: – remove all previous files – transmission of make files to the integration server – Drupal installation with module activation – apply needed patches – profile transmission to the integration server – profile configuration – post installation actions
  • 9. • We could tecnically have only one .make file but it will be more organized to have one make file for every section: core and contrib modules, custom modules and themes • The first make file needs to start with these lines, specifying Core and api versions – core = 7.x – api = 2 • In this main .make file we can include other make files like this
  • 10. • It is recommended to create a make file for these configurations • It is possible to download core, libraries and modules directly from external URLs (or internal if we prefer) • Core: – We just need to select the core version we want to install and the URL to download it • Libraries: – As core version we can install Drupal libraries directly from internal or external URLs • Contrib modules: – The same for contrib modules
  • 11. • It is advisable to create a separated make file for these modules • Here, it is possible to include custom modules or contrib modules which are not available anymore • It is possible to include modules from an internal path instead of an external URL
  • 12. • In addition we can have a separated make file to include themes • Custom themes can be included like custom modules • If there is a module and a theme with the same name, we can use the directory_name parameter to avoid conflicts
  • 13. • After the Drupal installation we could wish to replace or add some files. – For example: language configurations or any file needed for the project • To achieve this we can add lines to copy or overwrite files in the main script file
  • 14. • It is also possible to patch files instead of overwritting them. This could be necessary in some case, for example: module or theme conflicts, customize contrib modules, hard-coded changes • For this we can also patch directly Drupal modules using make files
  • 15. • It is also possible to remove useless files and folders in the main script file: – Example: • Unnecessary Drupal core files • Unnecessary Drupal module files • And purge .make files which were transfered at the beginning of the process: • rm -v *.make
  • 16. • Drush make: – https://www.drupal.org/project/drush_make • Drush: – https://www.drupal.org/project/drush • Patches: – https://dev.acquia.com/blog/patching-drush-make