Giter VIP home page Giter VIP logo

drupal_git_approach_one's Introduction

Approach #1 to Drupal and Git

I have imagined a typical Drupal 7 project with

The idea is to be able to install this easily without cloning the database, and to incrementally update environments with a single command.

I have tried three approaches, each having two "versions" and each hosted on github so you can try them.

  • Version 1: has the theme enabled, and an older version of views (on purpose), and comments disabled.
  • Version 2: has the new version of views enabled, the patches applied, and a new view and content type, disabled overlay and enabled pathauto.

Approach #1 (in this repo)

This approach is what most teams I've worked with already do, and is described here.

For the first deployment:

git clone https://github.com/alberto56/drupal_git_approach_one.git
cd drupal_git_approach_one
# create your databae
echo 'create database demo1'|mysql -uroot -proot
drush si --db-url=mysql://root:root@localhost/demo1 -y
drush en demo_deploy -y
drush generate-content 40
drush uli

To re-deploy your site from scratch, replacing the current database with a new one:

drush si -y
drush en demo_deploy -y
drush generate-content 40

To update from version 1 to version 2, you can do the following:

git checkout -b version2
git pull origin version2
sites/all/modules/custom/demo_deploy/scripts/update.sh

If you look at update.sh, it contains everything required to update any environment. It is better to put this script under version control rather than in a continuous integration server, because we want to be able to version it. (For some projects the script may change over time.)

Although this approach has the advantage of being simple, we will look at some other approaches which have some advantages.

Approach #2

In this approach, we have the following structure:

- git root
-- Drupal root
--- ...
-- scripts
--- update.sh

For more details, and the advantages of this idea, see README.md at https://github.com/alberto56/drupal_git_approach_two.

Approach #3

This approach takes the structure of Approach #2 but introduces git submodules.

For more details, and the advantages of this idea, see README.md at https://github.com/alberto56/drupal_git_approach_three.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.