A boilerplate to be used with Drupal Installation profiles.
Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
files
profile
releases
scripts
README.md

README.md

Drupal installation profile boiler plate

A boiler plate to be used with Drupal Installation profiles.

Introduction

This is a boiler plate for working with Drupal Distributions (also known as Installation profiles). It’s prepared to follow the methodology explained in the next blogpost:

[Drupal projects architecture](http://davidhernandez.info/blog/drupal-projects-architecture “Drupal projects architecture | David Hernandez)

Components

Configuration

Copy the configuration files of your site into this folder. The deployment script only covers the default settings.php file, if your site needs other configuration files, you will have to update the deploy.sh script.

  • settings.php: This file will be copied into the active release, to use the live database.
  • vhost.conf: A sample Apache Virtual host you can use to point to the site. It points to a folder that will be created with each deploy: profile-boilerplate/active

Files folder

There are you folders in this folder:

  • public: is the public files folder. The deploy script will link this folder to sites/default/files. If your site uses another folder, you will need to update the deploy.sh script.
  • private: if your site uses a private files folder, will be located in this folder. By default is commented on the deploy script, you will need to uncomment it. You will also have to specify the location of the private files folder in Drupal (by default, sites/default/files/private).

Scripts

This folder contains the scripts to work with the boiler plate. Currently only contains the deployment script:

  • deploy.sh: Creates a new release of the project and enables it.

Releases

Here is where each release of the site will be created. Only one will be active.

Profile

This is a skeleton you can use to develop your own custom installation profile. It contains the basic files you need and the most common folder structure.

You can find next a description of each component:

Modules

In this folder is where we store most of our custom code and Drupal specific configuration exported to features. It contains three subfolders:

  • custom: Our custom code.
  • features: Our modules with the configuration, created with the Features module.
  • hacked: The contrib modules that we have modified will be copied into this folder.

Themes

This folder contains the themes we use on our site. It contains only one folder:

  • custom: The custom themes we have developed for our site.

Libraries

The libraries required by the contrib or custom modules. Usually will be empty and the drush make will download them here.

Scripts

This scripts folder contains the scripts we use in our daily work with the profile. Currently contains the next scripts:

  • create_features.sh: Creates (or recreates) the features following a layered approach based on features components.
  • build.sh: Generates a new site on the specified location.
  • contrib_download.sh: Downloads all the contrib modules and applies all the required patches without the need of doing a site rebuild.
  • project_update.sh: Does an update of the site (downloads contrib, updates the custom code using git, execute DB updates and reverts the features). The normal way should do a new rebuild, but when we work locally, this will be faster.

Make files

The make files are Drush make files. We use them to list the dependencies, versions and patches that our project needs. We divide them in three files:

  • drupal-org.make: Contains all the contributed modules, the versions and the required patches.
  • drupal-org-core.make: Contains the information of the Drupal core version and the patches required.
  • profile.make: Contains the git repository of our profile and this will already contain all of our custom code and configuration.

Profile files

The profile files are the files that Drupal requires for a profile. There are two required and one optional, but this methodology, needs the three of them:

  • profile.info: As any other Drupal info file, contains the description of the project: name, description, version...
  • profile.profile: Is the main file container for our profile custom code. Usually has the code for altering the installation settings and / or steps. We try not to use it.
  • profile.install: (optional) In this file is where we execute our updates. Even if is not really required, in this approach is used widely.

Credits and thanks

  • Most of the methodology of this project has been inspired in the sessions of Ramon Vilar @rvilar from Ymbra.
  • The build.sh script is a modified version of the script used on Commerce Kickstart.
  • The create_features.sh script is based on Ximo1984’s script.
  • The deploy.sh script is based on the Drupal Deployment script of jotacor. This knowledge would have been impossible to get without the help of the Drupal Community and specially, the spanish community of the Asociación Española de Drupal and the spanish Drupal IRC channel #drupal-es

Sponsorships