Simplify local development with Drude

Simplify local development with Drude

default avatar
Thought byDavid Hernandez
May 04, 2016
Drude Development

*Drude has been renamed Docksal. See this update blog post.

As one of the largest Drupal agencies in the world FFW is no stranger to problems of scale. With large numbers of technical staff, clients, and concurrent projects, workflow management is vitally important to our work. And to deliver projects on time, while managing resources with agility, consistency and simplicity in the tools we choose plays a huge part.

When there are no standards for the tools a team uses (OS, editor, server, php version, etc.) dealing with the toolset adds unnecessary overhead that can eat away development time. You'll quickly find that setting up projects, on-boarding developers, troubleshooting, and even training all become more difficult as you deal with larger projects, larger teams, and more complex requirements.

To help solve these problems FFW created Drude.

What is Drude?

Drude (Drupal Development Environment) is a management tool for defining and managing development environments. It brings together common development tools, minimizes configuration, and ensures environment consistancy everywhere in your continuous integration worlflow. It automatically configures each project's environment to ensure team members are using the same tools, and versions, regardless of the individual requirements for each project. Most importantly, it makes the entire process easy.

With Drude you get fully containerized environments with Docker, cross-platform support (MacOS, Windows, and Linux,) built-in tools like drush, Drupal Console, composer, and PHP Code Sniffer, plug and play services like Apache Solr, Varnish, and Memcache, and even built-in testing support using Behat and Selenium. Drude will even automatically configure virtual hosts for you, so no more editing host files and server configurations.

With all of this you also get a management tool, which is the heart of Drude. dsh is a command line tool for controlling all aspects of your project's environment. You can use it to stop and start containers, interact with the host virtual machine, use drush and console to execute commands directly against your Drupal sites, and manage the installation and updating of projects.

Let's see how this works

Download the Drude shell command

​sudo curl -L https://raw.githubusercontent.com/blinkreaction/drude/master/bin/dsh -o /usr/local/bin/dsh
sudo chmod +x /usr/local/bin/dsh

You can now use the dsh command.  Use it to install prerequisites, which includes Docker, Vagrant, and VirtualBox.

dsh install prerequisites
dsh install boot2docker

These are all one-time steps for setting up Drude. Now that's done, you only need to set up individual projects.

Setting up a project.

Clone the Drupal 8 test project.

git clone https://github.com/blinkreaction/drude-d8-testing.git
cd drude-d8-testing

Use the init command to initialize local settings and install the Drupal site via Drush.

dsh init

Starting containers...
Creating druded8testing_db_1
Creating druded8testing_cli_1
Creating druded8testing_web_1
...
Installing site...
Installation complete.
User name: admin User password: 5r58daY2vZ [ok]
Congratulations, you installed Drupal!
[status]
real 1m18.139s
user 0m0.300s
sys 0m0.174s
...
Open http://drupal8.drude in your browser to verify the setup.

The init script automates provisioning, which can be modified per project. It can initialize settings for provisioned services, import databases, install sites, compile Sass, revert features, enable or disable modules, run Behat tests, and many other things.

Now, simply point your browser to http://drupal8.drude

Drude Screen

That’s it! Any time a team member wants to participate in a project all they have to do is download the project repo and run the init command. And with the environments containerized, they can be deployed anywhere.

Why publicize all this?

Clearly, we've put in a lot of work building a great tool. One that we could easily keep to ourselves. Well, at FFW we are huge supporters of open-source. As one of the main supporters of the Drupal Console project, CIBox, and a major supporter of Drupal, we believe that benefiting the community as a whole benefits us exponentially in return. We encourage anyone to use this tool, provide feedback, and even contribute to the project.