Template for starting a new Drupal 7 project where you have custom modules tracked in git. The aim is to conveniently track your code without having to mix Drupal core or contrib modules in the same repository.
-
Install composer. Run
composer --version
to verify that it works. On Mac OS Xbrew install composer
is usually the most convenient way to make sure it's available. -
Clone this repo
-
Edit
drupal.make
to include the required modules. -
Run
bin/setup
. This will create thedrupal
andsite
directory. -
Run
bin/runserver
and visit http://localhost:8010. You should now see the Drupal installation wizard. Fill in the information it requires and you should see your brand new empty site. -
Configure your site and create content.
-
Profit!
This section explains the layout of this Drupal 7 project.
- bin/
- composer.json
- drupal/
- drupal.make
- etc/
- Makefile
- modules/
- scripts/
- site/
- site/base_url
- themes/
- vendor/
Try this:
$ mkdir -p modules/foo
$ echo "name = Foo" >modules/foo/foo.info
$ echo "core = 7.x" >>modules/foo/foo.info
$ touch modules/foo/foo.module
$ bin/site-drush pm-enable foo
-
Edit
drupal.make
to include the source for the required module -
Remove the
drupal
directory and runbin/setup
again. -
Run
bin/site-drush pm-enable <module>
. -
Test it
-
Run
git commit drupal.make
.
This procedure ensures that drupal.make
accurately describes the required
software. If you just want to play with the latest versions of a module you
can also install it by running bin/site-drush pm-enable
directly, but in that
case the module would disappear when the drupal
directory is rebuilt.
Serve the site using PHP's builtin web server.
This is an zero-fuzz alternative to configuring Apache to serve the drupal
directory.
Ctrl-C to abort. Run it as:
$ bin/runserver
Once the site is configured an alternative is the drush server which can be started with:
$ bin/site-drush rs
Run drush
picking up the correct site and with knowledge about the correct site URL.
For instance:
$ bin/site-drush pml
to see what modules are installed.