Skip to content

Instantly share code, notes, and snippets.

@dergachev
Last active December 19, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dergachev/5877262 to your computer and use it in GitHub Desktop.
Save dergachev/5877262 to your computer and use it in GitHub Desktop.

vagrant-drupal repo structure

We're exploring alternative layouts for the vagrant-drupal repo structure.

Idea 1: project sub-repo

Assuming we want to keep Vagrantfile and Berksfile in git, and assuming that we have an existing Drupal project repo, the layout will be as follows:

- project
  - site
  - db
  - scripts
  - .git
- Berksfile
- Vagrantfile
- .git

The copy command will look as follows:

cp -R /vagrant/project /var/shared/sites/cooked.drupal

In this case there needs to be another attribute pointing to Drupal root in deployment directory (or equivalently in the [project] folder).

This is problematic because Vagrantfile and Berksfile cannot be added to the project repo without creating a new repo merging the two .gits, or adding one to another as a git submodule.

Idea 2: Berksfile and Vagrantfile are added to project root.

The project structure is as follows:

- site
  - index.php
- db
- scripts
- Vagrantfile
- Berksfile
- .git

The copy command would be as follows

cp -R /vagrant /var/shared/sites/cooked.drupal

This requires exposing a chef attribute for VHOST_ROOT, which is where apache would serve from. In this case, it would be '/var/shared/sites/cooked.drupal/site'.

Keep in mind that we don't want to hardcode /vagrant anywhere in the cookbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment