Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Creating a Dev Environment Quickly (on WebEnabled)

Parent Feed: 

Sometimes I work with clients who don't have the internal capacity to set up a developer environment for me...but they still want to be able to track what I'm working on in a semi-private space. In fact I had one such project a couple of weeks ago. My go-to service for this is WebEnabled. It's a paid service (and I don't get paid to promote their service), but you could definitely replicate the concept in other environments. I use a similar process when I'm working with the Acquia Developer Desktop on my windows machine.

This process isn't ideal for working with teams. And it's not my typical setup. But I think it helps to get people thinking about how they can use version control even on very tiny projects.

  1. Install the base environment (Drupal+LAMP stack) with the basic D7 core package from the WebEnabled app library. This gives me Drush and the basic file structure for Drupal. I won't end up using much of the basic environment, but it's an easy starting point.
  2. Use Drush to add the module Backup and Migrate. In WebEnabled this can be done through their Web-based admin tool, or on the command line (through an SSH connection).
  3. With Backup and Migrate, create hourly schedule with 3 days of keeping backups. (Test the backups!)
  4. Add version control through the WebEnabled interface (you can choose SVN or Git, I use Git).
  5. If the client has provided a snapshot of their Drupal file system, I copy the relevant folders (especially sites/all, and profiles) into my dev environment.
  6. Perform an *environment* backup of WebEnabled in case the next step fails. This is not the same as the Backup and Migrate *database* backup.
  7. Import the database snapshot from the client. Depending on how it's been provided, this might happen through phpMyAdmin (WebEnabled sets this up as part of the originial provisioning of the environment), or through Drupal if it's a Backup and Migrate snapshot.
  8. Use WebEnabled to reset the user/1 drupal password.

The development environment is now set up and ready for me to use.

For this particular project I was *only* working on a simple theme. No extra modules. Nothing fancy. So I used my git repo on WebEnabled to store all my theme folder.

In my local work environment (not WebEnabled), I completed the following steps:

  1. Clone the git repo from WebEnabled. (It's empty right now.)
  2. Add the starter kit from my base theme of choice. (Or, in this case, my client's base theme of choice.)
  3. Tidy up the starter kit to match my theme name.
  4. Add "major" images (e.g. background images, logo) to give a quick win for decorating my new theme to match the design files.
  5. (all along I've been committing my little changes locally to git) upload my new theme to the central git repository that WebEnabled provides, by using the command git push.

Next, I log into the WebEnabled dev environment via SSH, and complete the following steps:

  1. Navigate to the appropriate theme folder (e.g. sites/all/themes).
  2. Clone the WebEnabled git repository for this project as a new theme folder.
  3. Use Drush to enable the new theme.

Now the real work begins! Most of the tasks I'll do in my local developer environment. When I'm ready to share a batch of changes, I'll complete the following steps:

  1. "git push" the files to the central repository on WebEnabled.
  2. Log into the WE server and "git pull" the updated files from the central repo into the semi-private development server's theme folder.
  3. Use Drush to clear all the caches (drush cc all).

That's it!

What are your favourite tools and services for quickly sharing your work? I'm especially interested in hearing from other small teams who may not have a lot of infrastructure support.

Author: 
RSS Tags: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web