I have an alternative to hostmaster that I built for DevShop. I've built a separate install profile called devmaster.

I can specify an alternative makefile for drush hostmaster-install, but the installation profile itself is hard coded.

In 2.x this is an available option, but it only affects the drupal install profile that is run, and it is not documented.

In the comments are two patches (one for 2.x and one for 1.x) that document this in the drush options display and in the Config list that is output to the user, and uses the profile name for the hostmaster root path.

These patches do not change @hostmaster or @platform_hostmaster, since those seem to be hardcoded in a number of other places.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh’s picture

Patch for 1.x attached.

Jon Pugh’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
FileSize
2.64 KB

Attached is a patch for 2.x.

Apparently "profile" is made an option in 2.x, but it does not affect the install directory. Regardless of the --profile option, the root is always set to "hostmaster".

This patch adds the profile option to the root folder path, adds a line to the outputted list of options, and adds profile as a documented option in provision_drush_command()

Jon Pugh’s picture

Title: Add "profile" option to "drush hostmaster-install" » Document "profile" option for "drush hostmaster-install" and use for drupal path.

Updated body and updating title,

ergonlogic’s picture

This won't likely hit 1.x, but it looks useful for 2.x. I've been considering doing something similar for Valkyrie. Once we finish splitting hosting back out to its own project (another 2.x goal), this'll be even simpler.

Have you tested it with hostmaster-migrate? I suspect it'll work fine, but we should ensure there's no other hardcoding over there.

ergonlogic’s picture

Hmm, we also block building new sites on the hostmaster profile. Should we perhaps do the same here?

ergonlogic’s picture

Issue summary: View changes

being more descriptive

ergonlogic’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Issue summary: View changes

New features need to be implemented in Aegir 3.x, then we can consider back-porting to Aegir 2.x.

Jon Pugh’s picture

Status: Active » Needs work

I'll re-roll this in 3.x and 2.x tomorrow.

With this patch I can get rid of devshop's clone of `hostmaster-install`, which would be really nice.

Jon Pugh’s picture

Status: Needs work » Needs review
FileSize
2.5 KB

Attaching patch for 3.x.

Cherry-pick applies cleanly to 2.x as well.

Jon Pugh’s picture

Oops, forgot the drush command hook.

Jon Pugh’s picture

I'm documenting and altering `hosting_get_profiles` to include the check for banned profiles, this reduces the need to check for them everytime the function is used.

I've added banned profiles as a variable so we can change the list for other install profiles.

Pushed to branch `7.x-3.x-1995506`, patch also attached.

The function now looks like this:


/**
 * Return a list of available install profiles.
 *
 * @param null $platform_nid
 *   Only load install profiles available on this platform.
 *
 * @param string $field
 *   The field to use for the value of the return array.
 *
 * @return array
 *   The list of available install profiles, ready to use as #options in a form.
 */
function hosting_get_profiles($platform_nid = NULL, $field = 'title') {
  $profiles = array();
  if (!is_null($platform_nid)) {
    $instances = hosting_package_instances_load(array(
      'i.rid' => $platform_nid,
      'p.package_type' => 'profile',
      'n.status' => 1,
    ));
  }
  else {
    $instances = hosting_package_instances_load(array(
      'p.package_type' => 'profile',
      'n.status' => 1,
      'r.type' => 'platform',
    ));
  }

  // Prepare list of available profiles, preventing the use of blocked ones.
  foreach ($instances as $iid => $instance) {
    if (!in_array($instance->short_name, variable_get('hosting_blocked_profiles', array('hostslave', 'hostmaster')))) {
      $profiles[$instance->package_id] = $instance->$field;
    }
  }
  return $profiles;
}
Jon Pugh’s picture

Title: Document "profile" option for "drush hostmaster-install" and use for drupal path. » Implement "--profile" option for "drush hostmaster-install".
Assigned: Unassigned » Jon Pugh

  • Jon Pugh committed 49093d8 on 6.x-2.x-1995506-profile-option
    Fixes #1995506: allow profile to be an option.
    

  • helmo committed bc3dd44 on authored by Jon Pugh
    Issue #1995506 by Jon Pugh: Added Implement "--profile" option for "...
helmo’s picture

Status: Needs review » Fixed

I've merged the 7.x-3.x-1995506 into the hosting project.

And committed the patch from #8 into provision.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.