SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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...Artefactual Systems - AtoM
 
Managing your Drupal project with Composer
Managing your Drupal project with ComposerManaging your Drupal project with Composer
Managing your Drupal project with ComposerMatt Glaman
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep diveSalma Ghareeb
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016David Brattoli
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous IntegrationGeff Henderson Chang
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release WorkflowTuenti
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13Steven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUGOpen shift intro for Philly PUG
Open shift intro for Philly PUGSteven Pousty
 
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 streamsFrank van der Linden
 
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
 
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 needsSaltStack
 
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 culturePeter Mounce
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversionMangesh Bhujbal
 
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 VagrantArtefactual Systems - AtoM
 
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 SphinxGo Chiba
 
All of the thing about Postman
All of the thing about PostmanAll of the thing about Postman
All of the thing about PostmanAlihossein shahabi
 

Mais procurados (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
 

Destaque

Presentation7
Presentation7Presentation7
Presentation7ealeno
 
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 2010Emma Jane Hogbin Westby
 
Communications 2 0
Communications 2 0Communications 2 0
Communications 2 0e-Strategy
 
Flatstanleyprjct
FlatstanleyprjctFlatstanleyprjct
Flatstanleyprjctcarlynn
 
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
 
Nc tech4 good_presentation_2014_up
Nc tech4 good_presentation_2014_upNc tech4 good_presentation_2014_up
Nc tech4 good_presentation_2014_upJulia Kulla-Mader
 
Effectively Engaging Stakeholders in Drupal Projects
Effectively Engaging Stakeholders in Drupal ProjectsEffectively Engaging Stakeholders in Drupal Projects
Effectively Engaging Stakeholders in Drupal ProjectsJulia 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 mujerIgnacio Garcia
 
Contratos De Compra Y Venta Internacional
Contratos  De Compra Y Venta InternacionalContratos  De Compra Y Venta Internacional
Contratos De Compra Y Venta Internacionalesjuemlinaresvizcarra
 

Destaque (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
 

Semelhante a Drupal Version Control Basics

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: InformationMassimo Menichinelli
 
Digital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationDigital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationMassimo Menichinelli
 
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 FactoryMassimo Menichinelli
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best PracticesMaidul Islam
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
Subversion
SubversionSubversion
Subversionrchakra
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP DevelopersLorna 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 ManagementPhilip Johnson
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego LeagueJeffrey T. Pollock
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 
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 SOLabPablo Arriazu
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching modelPavlo Hodysh
 
Subversion
SubversionSubversion
Subversionthebdot1
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best PracticesAshraf Fouad
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right wayChristian Varela
 

Semelhante a Drupal Version Control 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
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
 

Último

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Último (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Drupal Version Control 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