public function exec($groups = '') {
    $_groups = !empty($groups) ? explode(',', $groups) : array();

    // Print a message that the build is starting.
    $names = implode('+', array_keys($this->loadedEnvs));
    drush_print();
    drush_print($this->formatHeading(dt("--- CONFIGURING @name ENVIRONMENT ---", array('@name' => strtoupper($names))), ''));

    foreach ($this->exec as $type => $options) {
      if (!empty($options) && (empty($_groups) || in_array($type, $_groups))) {
        // Print a nice heading.
        $heading = $this->formatHeading($type);
        drush_print();
        drush_print("{$heading}");

        switch ($type) {
          case 'modules';
            $this->execModules($options);
            break;

          case 'variables':
            $this->execVariables($options);
            break;

          case 'permissions':
            $this->execPermissions($options);
            break;

          case 'commands':
            $this->execCommands($options);
            break;

          default:
            drush_set_error('INVALID_ENV_GROUP', dt("I'm not sure what to do with '!group'.", ['!group' => $type]));
            break;
        }
      }
    }

    drush_print();
    if (drush_get_error()) {
      drush_set_error('DENVER_ENV_SETUP_FAILED', dt("The environment may not have been configured the way you wanted.  Check the logs for more details."));
      drush_print(dt("Use the --groups option to run only certain sections of an environment definition."));
    }
    else {
      return drush_log(dt("Environment setup complete!"), 'success');
    }
  }