SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
Building a Drupal site with Git
Diagrams and Notes
Jan 2013

Provided by dumbass

Please note this is currently a documentation for discussion- it has
not been reviewed yet. Please leave any useful comments
This document should be used in conjunction with the excellent
tutorial on Drupal.org
Creating the Central Repository




                                             $ ssh username@mysite.com
  Server                                     $ cd ~
 with user   public_html                     $ git init --bare fooproject.git

fooproject

                           fooproject.git*




                                                  * This directory is not the working tree,
                                                  where you edit and commit code. Rather, it
                                                  is simply the central location for the git
                                                  objects and history.
Locally Cloning Drupal
                                                           TIP
                                                           Before you issue these commands
                                                           Ensure you are in the correct directory
                                                           where you want to install your local
                                                           Drupal installation by navigating to the
                                                           correct directory by using the usual

          git://drupalcode.org/project/drupal.git            $ cd path/to/my/directory




                                                    $ git clone
                                                    git://drupalcode.org/project/drupal.git
 Local                                              fooproject
                                                    $ cd fooproject
machine                                             $ git checkout 7.0
                 local_development_environment

                                                      This command clones a copy of the
                                      fooproject      latest Drupal code into a local folder
                                                      named fooproject
How your setup should look



                  public_html
Server


                                fooproject.git*




 Local
machine
                  local_development_environment


                                 fooproject
Updating Remotes



                                                                  Rename the original origin remote (the
                                                                  drupal.org Drupal project repository) to
                                                                  ‘drupal’



   Local
  machine              $ git remote rename origin drupal

                       $ git remote add origin path/to/your/central/git/repo




                                  (example: ssh://fooproject@fooproject.com/home/fooproject/fooproject.git)




TIP
To end your current remote session and
start working locally use
CTRL+D
Creating a Working Branch



                              $ git branch fooproject
                              $ git checkout fooproject

 Local
machine
          local_development_environment


                            fooproject (fooproject)




                  You now have a git branch called fooproject. You can use this fooproject branch
                  as a working branch to add contributed and custom modules and themes to
                  your site. Consider it the equivalent of the default Git ‘master’ branch for your
                  project.
Complete local installation of Drupal




 Local
machine
          At this point, you should complete the Drupal
          installation process to get a working local
          installation.
Pushing Code to the Central Repository and Completing Initial Deployment

 Local
                      local_development_environment
machine
                                     fooproject (fooproject)



                                                $ git push origin fooproject




                      public_html
 Server


                                     fooproject.git (fooproject)
Pushing Code to the Central Repository and Completing Initial Deployment


                                                       $ git clone --branch fooproject
                                                       ssh://fooproject@fooproject.com/home/users/foo
                                                       project/fooproject.git fooproject_dev

                         public_html
Server


                                       fooproject.git (fooproject)


                                       fooproject_dev




                               This fooproject_dev version could exist on another server. But is a sub –
                               directory in this example. Once you have completed your initial pull you will
                               see the Drupal file structure on the server
Complete dev installation of Drupal




Server   Now, you have a fooproject_dev directory that you can use as
         the root of a new virtual host. You can proceed through the
         normal Drupal installation process using this development
         copy of your site and a separate database for it. Repeat this
         process for the Staging and Production environments - we’ll
         assume that they live on the same server in directories
         fooproject_stg and fooproject_prod.
Pushing Code to the Central Repository and Completing Initial Deployment




                         public_html
  Server


                                       fooproject.git (fooproject)


                                       fooproject_dev


                                       fooproject_stg


                                       fooproject_prod
Staging and Production - Tag Based Deployment

 Local
machine        $ git tag prod_20110419 ## Creating a tag
               from the current commit. You can specify a
               commit here if you wish.




               $ git push origin prod_20110419




 Server

               $ git pull
               $ git checkout prod_20110419

Weitere ähnliche Inhalte

Was ist angesagt?

Jenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJulien Pivotto
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire dotCloud
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with DrupalRyan Cross
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
Drupal Deployment
Drupal DeploymentDrupal Deployment
Drupal Deploymentq0rban
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)Soshi Nemoto
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersJules Pierre-Louis
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayPuppet
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeTeerapat Khunpech
 
Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for JenkinsLarry Cai
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
CocoaPods introduction
CocoaPods introductionCocoaPods introduction
CocoaPods introductionJordi Giménez
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Puppet
 

Was ist angesagt? (20)

Jenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJenkins Shared Libraries Workshop
Jenkins Shared Libraries Workshop
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Ansible project-deploy
Ansible project-deployAnsible project-deploy
Ansible project-deploy
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with Drupal
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Git101
Git101Git101
Git101
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
Drupal Deployment
Drupal DeploymentDrupal Deployment
Drupal Deployment
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 May
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for Jenkins
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
CocoaPods introduction
CocoaPods introductionCocoaPods introduction
CocoaPods introduction
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
 
Using Cocoapods
Using CocoapodsUsing Cocoapods
Using Cocoapods
 

Ähnlich wie Building a Drupal site with Git

Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next levelAlessandro Franceschi
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about gitSothearin Ren
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Ben Shell
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAJesus Manuel Olivas
 
Composer tools and frameworks for Drupal
Composer tools and frameworks for DrupalComposer tools and frameworks for Drupal
Composer tools and frameworks for DrupalPromet Source
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptPromet Source
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
 
Exploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaExploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaSalvador Molina (Slv_)
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalPantheon
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?nuppla
 
Do + ldo for developers(full)
Do + ldo for developers(full)Do + ldo for developers(full)
Do + ldo for developers(full)Andrii Podanenko
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupalDay
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 WorkshopJoy Seng
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Managing development environments with Docksal
Managing development environments with DocksalManaging development environments with Docksal
Managing development environments with DocksalVladimir Zdravkovic
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 

Ähnlich wie Building a Drupal site with Git (20)

Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next level
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Composer tools and frameworks for Drupal
Composer tools and frameworks for DrupalComposer tools and frameworks for Drupal
Composer tools and frameworks for Drupal
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.ppt
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
 
Exploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaExploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molina
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
Do + ldo for developers(full)
Do + ldo for developers(full)Do + ldo for developers(full)
Do + ldo for developers(full)
 
Inside DocBlox
Inside DocBloxInside DocBlox
Inside DocBlox
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
 
Git training
Git trainingGit training
Git training
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Managing development environments with Docksal
Managing development environments with DocksalManaging development environments with Docksal
Managing development environments with Docksal
 
Welcome aboard the team
Welcome aboard the teamWelcome aboard the team
Welcome aboard the team
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 

Building a Drupal site with Git

  • 1. Building a Drupal site with Git Diagrams and Notes Jan 2013 Provided by dumbass Please note this is currently a documentation for discussion- it has not been reviewed yet. Please leave any useful comments This document should be used in conjunction with the excellent tutorial on Drupal.org
  • 2. Creating the Central Repository $ ssh username@mysite.com Server $ cd ~ with user public_html $ git init --bare fooproject.git fooproject fooproject.git* * This directory is not the working tree, where you edit and commit code. Rather, it is simply the central location for the git objects and history.
  • 3. Locally Cloning Drupal TIP Before you issue these commands Ensure you are in the correct directory where you want to install your local Drupal installation by navigating to the correct directory by using the usual git://drupalcode.org/project/drupal.git $ cd path/to/my/directory $ git clone git://drupalcode.org/project/drupal.git Local fooproject $ cd fooproject machine $ git checkout 7.0 local_development_environment This command clones a copy of the fooproject latest Drupal code into a local folder named fooproject
  • 4. How your setup should look public_html Server fooproject.git* Local machine local_development_environment fooproject
  • 5. Updating Remotes Rename the original origin remote (the drupal.org Drupal project repository) to ‘drupal’ Local machine $ git remote rename origin drupal $ git remote add origin path/to/your/central/git/repo (example: ssh://fooproject@fooproject.com/home/fooproject/fooproject.git) TIP To end your current remote session and start working locally use CTRL+D
  • 6. Creating a Working Branch $ git branch fooproject $ git checkout fooproject Local machine local_development_environment fooproject (fooproject) You now have a git branch called fooproject. You can use this fooproject branch as a working branch to add contributed and custom modules and themes to your site. Consider it the equivalent of the default Git ‘master’ branch for your project.
  • 7. Complete local installation of Drupal Local machine At this point, you should complete the Drupal installation process to get a working local installation.
  • 8. Pushing Code to the Central Repository and Completing Initial Deployment Local local_development_environment machine fooproject (fooproject) $ git push origin fooproject public_html Server fooproject.git (fooproject)
  • 9. Pushing Code to the Central Repository and Completing Initial Deployment $ git clone --branch fooproject ssh://fooproject@fooproject.com/home/users/foo project/fooproject.git fooproject_dev public_html Server fooproject.git (fooproject) fooproject_dev This fooproject_dev version could exist on another server. But is a sub – directory in this example. Once you have completed your initial pull you will see the Drupal file structure on the server
  • 10. Complete dev installation of Drupal Server Now, you have a fooproject_dev directory that you can use as the root of a new virtual host. You can proceed through the normal Drupal installation process using this development copy of your site and a separate database for it. Repeat this process for the Staging and Production environments - we’ll assume that they live on the same server in directories fooproject_stg and fooproject_prod.
  • 11. Pushing Code to the Central Repository and Completing Initial Deployment public_html Server fooproject.git (fooproject) fooproject_dev fooproject_stg fooproject_prod
  • 12. Staging and Production - Tag Based Deployment Local machine $ git tag prod_20110419 ## Creating a tag from the current commit. You can specify a commit here if you wish. $ git push origin prod_20110419 Server $ git pull $ git checkout prod_20110419