SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Drupal Version Control & File System Basics
Julia Kulla-Mader
Triangle Drupal User’s Group
March 17, 2010
http://www.juliakm.com
@juliakm
What is version control?

• A way of managing changes to documents, programs, or other data stored as
  computer files. (Wikipedia)
What are some version control systems?
Why use version control?

• Real world scenarios
Why am I getting a white screen of death?

• Version control lets you see what the most recent code change was on your
  site.
Can I get rid of that white screen of death?

• Version control lets you roll back to a previous version.
My client decided that they prefer a way earlier
version of my module

• Version control lets you roll back a specific file to any point in time (when it
  was under version control).
I really want to use this new module but I'm afraid
it's going to destroy my site.

• Using version control, you can maintain multiple versions of your code. For
  example, you can create a sandbox (“trunk”) just for testing out experimental
  modules.
My co-worker and I are editing the same page.
What if we overwrite one another?

• Version control lets you merge changes when conflicts arise.
Why the heck did I make this change last year?

• Version control lets you record log messages over time so that you can
  communicate with your old self.
Who was the last person to touch this module?

• Version control lets to see the last person who edited a file.
I want to quickly deploy my code on a new server.

• Version control makes it easy to quickly grab a repository and put in on your
  local computer or a new server.
I'm sick of copying files from my computer to the
server.

• Using “hooks” you can set up you server to automatically reflect a new
  change to your site made on your local computer.
What Does Version Control Look Like In Practice?

• Example: Association for the Advancement of Sustainability in Higher
  Education


• Version Control System: Subversion
How is AASHE’s repository set up?

• Trunk: the latest, least stable version of our code


• Branch: the working version of code, very similar to live code


• Tags: each new version of the site is tagged
What does this look like when we are coding?

• If we are testing out new modules or major upgrades, we work in trunk first.
   • Commits to trunk show up at dev.aashe.org


• If we are fixing bugs or updating code, we work in the current branch first.
   • Commits to the current branch show up at stage.aashe.org


• We never touch the releases, we just create a new one when the branch code
  is tested.
   • We have a release script for making a new release.
What does the release script do?

• Creates the next tag.
  svn copy file://$path/www/branches/branch-3.0/ file://$path/www/releases/release-$release -m "$commit"




• Creates an export of the branch repository.
  svn export --force file://$path/www/releases/release-$release /var/www/aashe.org/releases/release-$release




• Creates a symlink from the public folder to the new release.
  rm /var/www/aashe.org/public
  ln -s /var/www/aashe.org/releases/release-$release /var/www/aashe.org/public




• Creates symlinks to the file directories (explanation to follow)
What are some version control hurdles specific to
Drupal?
Updating Modules

• We use drush to update Drupal modules locally, then commit to the staging
  site (unless it’s Views or CCK, then trunk)


  • drush is a command line shell and Unix scripting interface for Drupal, a
    veritable Swiss Army knife designed to make life easier for those of us who
    spend some of our working hours hacking away at the command prompt.


drush up mymodulename
Updating Core

• We download the version of Drupal we are using from Drupal.org and the
  latest version, unzip them, and create a patch file using the diff command


  wget http://ftp.drupal.org/files/projects/drupal-6.16.tar.gz
  tar -xzf drupal-6.16.tar.gz
  wget http://ftp.drupal.org/files/projects/drupal-6.15.tar.gz
  tar -xzf drupal-6.15.tar.gz
  diff -Naur drupal-6.15 drupal-6.16 > drupal-current-to-drupal-latest.patch


• Next, we test to see if there are any conflicts by doing a dry run from the root
  Drupal directory
 patch -p1 --dry-run < drupal-current-to-drupal-latest.patch




• Last, we apply the patch file for real from the root directory
 patch -p1 < drupal-current-to-drupal-latest.patch
Preventing Files From Being Accidentally Deleted
or Versioned

• We store our files at the same level as our public directory and create a
  symlink to it




• Our release script rebuilds these symlinks each time there is a new release
 ln -s /var/www/aashe.org/files /var/www/aashe.org/public/files
 ln -s /var/www/aashe.org/documents /var/www/aashe.org/public/documents
Next Steps

• Pick your favorite version control system


• Research your version control system of choice


• If you don’t want to mess with the command-line, look for a GUI tool like
  TortiseSVN, Versions, SvnX, or a code editor like Eclipse, Textmate


• Decide on your repository structure


• Start writing versioned code
Next Up: Mastering the Drupal Database

• Hello Allen

Contenu connexe

Tendances

Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
Lenz Grimmer
 

Tendances (20)

AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Managing your Drupal project with Composer
Managing your Drupal project with ComposerManaging your Drupal project with Composer
Managing your Drupal project with Composer
 
Mini Training Flyway
Mini Training FlywayMini Training Flyway
Mini Training Flyway
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
Open shift intro for Philly PUG
Open shift intro for Philly PUGOpen shift intro for Philly PUG
Open shift intro for Philly PUG
 
NCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streamsNCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streams
 
MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
MySQL 5.5 Replication Enhancements – An Overview (FOSDEM 2011)
 
Configuration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needsConfiguration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needs
 
JUST EAT: Tools we use to enable our culture
JUST EAT: Tools we use to enable our cultureJUST EAT: Tools we use to enable our culture
JUST EAT: Tools we use to enable our culture
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
SDN TEST Suite
SDN TEST SuiteSDN TEST Suite
SDN TEST Suite
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14
 
Creating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantCreating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with Vagrant
 
Instruction to build Apache CloudStack docs with Sphinx
Instruction to build Apache CloudStack docs with SphinxInstruction to build Apache CloudStack docs with Sphinx
Instruction to build Apache CloudStack docs with Sphinx
 
All of the thing about Postman
All of the thing about PostmanAll of the thing about Postman
All of the thing about Postman
 

En vedette

Presentation7
Presentation7Presentation7
Presentation7
ealeno
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Emma Jane Hogbin Westby
 
Flatstanleyprjct
FlatstanleyprjctFlatstanleyprjct
Flatstanleyprjct
carlynn
 
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Julia Kulla-Mader
 
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
Julia Kulla-Mader
 
China corea y japon rol de la mujer
China corea y japon rol de la mujerChina corea y japon rol de la mujer
China corea y japon rol de la mujer
Ignacio Garcia
 
Contratos De Compra Y Venta Internacional
Contratos  De Compra Y Venta InternacionalContratos  De Compra Y Venta Internacional
Contratos De Compra Y Venta Internacional
esjuemlinaresvizcarra
 

En vedette (14)

Presentation7
Presentation7Presentation7
Presentation7
 
Git Makes Me Angry Inside
Git Makes Me Angry InsideGit Makes Me Angry Inside
Git Makes Me Angry Inside
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
 
Monitoring Processes
Monitoring ProcessesMonitoring Processes
Monitoring Processes
 
Communications 2 0
Communications 2 0Communications 2 0
Communications 2 0
 
Flatstanleyprjct
FlatstanleyprjctFlatstanleyprjct
Flatstanleyprjct
 
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
 
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
 
Nc tech4 good_presentation_2014_up
Nc tech4 good_presentation_2014_upNc tech4 good_presentation_2014_up
Nc tech4 good_presentation_2014_up
 
Effectively Engaging Stakeholders in Drupal Projects
Effectively Engaging Stakeholders in Drupal ProjectsEffectively Engaging Stakeholders in Drupal Projects
Effectively Engaging Stakeholders in Drupal Projects
 
Building a Drupal Forum
Building a Drupal ForumBuilding a Drupal Forum
Building a Drupal Forum
 
Drupalcon report
Drupalcon reportDrupalcon report
Drupalcon report
 
China corea y japon rol de la mujer
China corea y japon rol de la mujerChina corea y japon rol de la mujer
China corea y japon rol de la mujer
 
Contratos De Compra Y Venta Internacional
Contratos  De Compra Y Venta InternacionalContratos  De Compra Y Venta Internacional
Contratos De Compra Y Venta Internacional
 

Similaire à Drupal Version Control & File System Basics

Digital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationDigital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 Information
Massimo Menichinelli
 
Subversion
SubversionSubversion
Subversion
rchakra
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP Developers
Lorna Mitchell
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
Philip Johnson
 
Subversion
SubversionSubversion
Subversion
thebdot1
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
Ashraf Fouad
 
Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
UTKARSHBHARDWAJ71
 

Similaire à Drupal Version Control & File System Basics (20)

Digital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: InformationDigital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: Information
 
Digital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationDigital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 Information
 
Digital Fabrication Studio.02 _Information @ Aalto Media Factory
Digital Fabrication Studio.02 _Information @ Aalto Media FactoryDigital Fabrication Studio.02 _Information @ Aalto Media Factory
Digital Fabrication Studio.02 _Information @ Aalto Media Factory
 
SVN Information
SVN Information  SVN Information
SVN Information
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion
SubversionSubversion
Subversion
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP Developers
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Subversion
SubversionSubversion
Subversion
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
 
Subversion
SubversionSubversion
Subversion
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Drupal Version Control & File System Basics

  • 1. Drupal Version Control & File System Basics Julia Kulla-Mader Triangle Drupal User’s Group March 17, 2010 http://www.juliakm.com @juliakm
  • 2. What is version control? • A way of managing changes to documents, programs, or other data stored as computer files. (Wikipedia)
  • 3. What are some version control systems?
  • 4. Why use version control? • Real world scenarios
  • 5. Why am I getting a white screen of death? • Version control lets you see what the most recent code change was on your site.
  • 6. Can I get rid of that white screen of death? • Version control lets you roll back to a previous version.
  • 7. My client decided that they prefer a way earlier version of my module • Version control lets you roll back a specific file to any point in time (when it was under version control).
  • 8. I really want to use this new module but I'm afraid it's going to destroy my site. • Using version control, you can maintain multiple versions of your code. For example, you can create a sandbox (“trunk”) just for testing out experimental modules.
  • 9. My co-worker and I are editing the same page. What if we overwrite one another? • Version control lets you merge changes when conflicts arise.
  • 10. Why the heck did I make this change last year? • Version control lets you record log messages over time so that you can communicate with your old self.
  • 11. Who was the last person to touch this module? • Version control lets to see the last person who edited a file.
  • 12. I want to quickly deploy my code on a new server. • Version control makes it easy to quickly grab a repository and put in on your local computer or a new server.
  • 13. I'm sick of copying files from my computer to the server. • Using “hooks” you can set up you server to automatically reflect a new change to your site made on your local computer.
  • 14. What Does Version Control Look Like In Practice? • Example: Association for the Advancement of Sustainability in Higher Education • Version Control System: Subversion
  • 15. How is AASHE’s repository set up? • Trunk: the latest, least stable version of our code • Branch: the working version of code, very similar to live code • Tags: each new version of the site is tagged
  • 16. What does this look like when we are coding? • If we are testing out new modules or major upgrades, we work in trunk first. • Commits to trunk show up at dev.aashe.org • If we are fixing bugs or updating code, we work in the current branch first. • Commits to the current branch show up at stage.aashe.org • We never touch the releases, we just create a new one when the branch code is tested. • We have a release script for making a new release.
  • 17. What does the release script do? • Creates the next tag. svn copy file://$path/www/branches/branch-3.0/ file://$path/www/releases/release-$release -m "$commit" • Creates an export of the branch repository. svn export --force file://$path/www/releases/release-$release /var/www/aashe.org/releases/release-$release • Creates a symlink from the public folder to the new release. rm /var/www/aashe.org/public ln -s /var/www/aashe.org/releases/release-$release /var/www/aashe.org/public • Creates symlinks to the file directories (explanation to follow)
  • 18. What are some version control hurdles specific to Drupal?
  • 19. Updating Modules • We use drush to update Drupal modules locally, then commit to the staging site (unless it’s Views or CCK, then trunk) • drush is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt. drush up mymodulename
  • 20. Updating Core • We download the version of Drupal we are using from Drupal.org and the latest version, unzip them, and create a patch file using the diff command wget http://ftp.drupal.org/files/projects/drupal-6.16.tar.gz tar -xzf drupal-6.16.tar.gz wget http://ftp.drupal.org/files/projects/drupal-6.15.tar.gz tar -xzf drupal-6.15.tar.gz diff -Naur drupal-6.15 drupal-6.16 > drupal-current-to-drupal-latest.patch • Next, we test to see if there are any conflicts by doing a dry run from the root Drupal directory patch -p1 --dry-run < drupal-current-to-drupal-latest.patch • Last, we apply the patch file for real from the root directory patch -p1 < drupal-current-to-drupal-latest.patch
  • 21. Preventing Files From Being Accidentally Deleted or Versioned • We store our files at the same level as our public directory and create a symlink to it • Our release script rebuilds these symlinks each time there is a new release ln -s /var/www/aashe.org/files /var/www/aashe.org/public/files ln -s /var/www/aashe.org/documents /var/www/aashe.org/public/documents
  • 22. Next Steps • Pick your favorite version control system • Research your version control system of choice • If you don’t want to mess with the command-line, look for a GUI tool like TortiseSVN, Versions, SvnX, or a code editor like Eclipse, Textmate • Decide on your repository structure • Start writing versioned code
  • 23. Next Up: Mastering the Drupal Database • Hello Allen