Skip to content

gregsgit/drupal_git_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

drupal_git_tools

Tools to maintain a drupal install managed by git

Suppose this repo is checked out in ~/drupal_git_tools ... Suppose top level site folder is ~/public_html ...

Updating core

  • backup drupal database (e.g. via web using 'Backup and Migrate' module).

  • mkdir ~/drupal-core-updates ; cd ~/drupal-core-updates

  • wget ... ; tar xzf *.tar.gz -- leaves drupal-x.nn folder

  • cd ~/public_html

  • git checkout -b core-updates

  • cd ~/drupal_git_tools

  • ./update-core ~/drupal-core-updates/drupal-x.nn ~/public_html

  • edit ~/public_html/sites/default, settings.php, set $update_free_access to TRUE.

  • visit http://website.html/update.php

  • cd ~/public_html

  • git status -- sanity check

  • git commit -a -m 'updated core to x.nn'

  • git checkout master

  • git merge core-updates

  • git push

    • note that if your post-receive hook does a checkout, that may mess up your permissions.
  • git branch -d core-updates

  • chmod -R 755 ~/public_html

Updating a module

  • backup drupal database (e.g. via web using 'Backup and Migrate' module).

  • mkdir ~/drupal-module-updates ; cd ~/drupal-module-updates

  • wget ... ; tar xzf *.tar.gz

  • cd ~/public_html

  • git checkout -b module-updates

  • cd ~/drupal_git_tools

  • ./update-module ~/drupal-module-updates/module-name ~/public_html

  • edit ~/public_html/sites/default, settings.php, set $update_free_access to TRUE.

  • visit http://website.html/update.php

  • cd ~/public_html

  • git status -- sanity check

  • git commit -a -m 'updated module'

  • git checkout master

  • git merge module-updates

  • git push

    • note that if your post-receive hook does a checkout, that may mess up your permissions.
  • git branch -d module-updates

  • chmod -R 755 ~/public_html

Adding untracked files

For a drupal site, it might be that files are uploaded via the drupal file manager. Sometimes you want to collect all the untracked files and add/stage them.

  • cd ~/public_html
  • ~/drupal_git_tools/gen-adds > ../adds.out
  • remove lines from adds.out for files you do not want to add
  • . ../adds.out
  • git commit -m 'added new files'
  • git pull ; git push ; etc.

creating a staging version of the website (not a script)

There's no script for this - just some notes:

  • get backup .sql.gz file using backup-and-migrate module
  • cp -rp public_html staging
  • in cpanel, create new empty sql database, 'staging'
    • add user for main db to new 'staging' db
      • with all privileges
  • in cpanel, start phpmyadmin tool
    • go to new staging db, click Import
    • upload .sql.gz file from backup
    • do it
  • in staging/sites/default/settings.php, change db name to 'staging'

About

Tools to maintain a drupal install managed by git

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages