Turnip is OpenSourcery's Drupal starting kit. Using a Drush Make workflow, only custom modules, features and themes are committed to the repository, which allows for teams to quickly get up to speed and collaborate on the important parts of the project at hand. It includes a starting framework for using Behat for behavior driven development. Each site is built as an installation profile.
-
Either copy all files into a new repository or clone this repository, keeping an upstream origin named
turnip
:git clone -o turnip [email protected]:opensourcery/turnip.git foo_project cd foo_project git checkout -b master
-
Initialize git (if files were copied), and add a remote:
git remote add origin git@github:foo/bar.git
Make sure your remote points to a repository that is set up.
-
Run
bin/make-install-profile
to instantiate an installation profile. For examplebin/make-install-profile my_profile my_theme "Short name" "Long name"
All changes can then quickly be added via
git add -A
. -
Customize
my_profile/my_profile.make
-
Run
bin/install
for local development -
To avoid having to redeclare your default origin each time you pull or push, run your first push as:
git push -u origin master
-
If this site has a production url, you can manually add it to
bin/.config
on the linePRODUCTIONURL="http://"
-
Custom modules or features should go in
my_project/modules/custom
ormy_project/modules/features
. Any contrib modules put into the .make files will be placed into the appropriate directories automatically.
There are several bundled make files:
my_profile.make
- This gets renamed to the installation profile's machine name and should contain modules than relate specifically to your project.base.make
- common modules and librariesimages.make
- Media module and other image-related modulespanels.make
- Panels modules related dependencies
If using dev versions of modules, specific commit hashes are preferable in the make files, rather than the more general dev branch.
By building the site out as an installation profile, funcitonality can easily be tracked in commit logs.
The Profiler library is used for creating placeholder nodes, users and taxonomy terms, as well as setting variables that don't make sense to commit to feature modules.
The bin/install
script will enable a set of developer modules. This
can be customzed by setting the TURNIP_DEVELOPER_MODULES
environment
variable. For instance, in .bashrc
or similar:
export TURNIP_DEVELOPER_MODULES="devel views_ui styleguide"
If you want to pull the most recent turnip changes, you can run:
git fetch turnip
git merge --no-commit turnip/7.x
This adds all the turnip changes to your local repo, but allows you to review them before committing them. Be warned this is likely to cause a lot of conflicts and you will have to figure out what changes from upstream you wish to override any local changes and vice versa.
For highly customized server requirements, or just to have a stable and consistent environment to develop on, Turnip ships with a default Vagrant configuration that will launch a Drupal site in a box.
- Make sure Vagrant and Virtualbox are installed.
- Run
bin/install
- At this point, http://localhost:8888 should be serving Drupal.
- Stop the server with
bin/stop
, and then restart withbin/run
- Customize the server in
manifests/webserver.pp
. An Apache Solr example is included if that is required for search. - Values or settings in
Vagrantfile
can be overridden by adding aVagrantfile.local
, should individual environments require this. A common example is for forwarding port 80 to a different port than the one defined.
If you need to install a module that's not part of Turnip, add the module to the my_profile.make file (e.g. projects[bad_judgement][version] = 1.0-rc39
).
For more information on drush make, please refer to http://www.slideshare.net/rupl/drush-make-install-drupal-like-a-pro