Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Developing locally with Drupal VM

Sarah Jean Thrasher edited this page May 5, 2016 · 12 revisions

Drupal GovCon 2016 Quickstart

Mac

Download and install vagrant

or

brew install ansible

Recommended Versions: Vagrant 1.8.1, VirtualBox 5.0.14, and Ansible 2.0.0

Get the code

  • Fork our repo: https://github.com/Drupal4Gov/Drupal-GovCon-2016

  • Check out a local copy of your fork.

    git clone git@github.com:[you]/Drupal-GovCon-2016.git

    cd Drupal-GovCon-2016

  • Add a remote for upstream:

    git remote add upstream git@github.com:Drupal4Gov/Drupal-GovCon-2016.git

  • Checkout the develop branch.

    git checkout develop

  • Update from upstream repo

    git pull upstream develop

Configure DrupalVM

See DrupalVM Quickstart

  • Go to the box directory to configure DrupalVM (our local dev environment tool)

    cd box

  • Copy example.config.yml to config.yml

    cp example.config.yml config.yml

  • Run ansible galaxy setup:

    sudo ansible-galaxy install -r provisioning/requirements.yml --force

  • Run vagrant up

  • Go inside box via vagrant ssh

Install build tools

cd /var/www/drupalgovcon

composer install

  • Install node for front end build (IMPORTANT, build will fail if skipped)

    /var/www/drupalgovcon/docroot/sites/all/themes/custom/govcon_2016/install-node.sh 4.3.2

    source ~/.bashrc && nvm use --delete-prefix 4.3.2

    npm install -g grunt-cli

  • Run ./task.sh setup:drupal:settings This will generate docroot/sites/default/settings/local.settings.php and docroot/sites/default/local.drushrc.php. Update these with your local database credentials and your local site URL. For DrupalVM the db credentials are drupal, drupal, drupal

Example local.settings.php

<?php

/**
 * For a single database configuration, the following is sufficient:
 **/
$databases = array (
  'default' =>
    array (
      'default' =>
        array (
          'database' => 'drupal',
          'username' => 'drupal',
          'password' => 'drupal',
          'host' => 'localhost',
          'port' => '3306',
          'driver' => 'mysql',
          'prefix' => '',
        ),
    ),
);

// Disable virus scanning on uploaded files.
$conf['clamav_enabled'] = 0;
$conf['clamav_enable_element_image_widget'] = 0;
$conf['clamav_enable_element_file_widget'] = 0;
$conf['cron_safe_threshold'] = 0;
$conf['error_level'] = 1;
$conf['stage_file_proxy_origin'] = '';

$conf['theme_debug'] = TRUE;
  • Run ./task.sh setup. This will build all project dependencies and install drupal.

After this initial setup, you should only need to run ./task.sh setup:build:all when composer.json is updated, and ./task.sh setup:drupal:install when you need to reinstall the site.

For a full list of available project tasks, run ./task.sh -l. See project-tasks.md for more information.

Windows

TODO (in the meantime: http://docs.drupalvm.com/en/latest/other/windows/ )

Linux

TODO

References

1 - DrupalVM Documentation

2 - DrupalVM Quick Start Guide

Clone this wiki locally