You are here

function acsf_init_drush_command in Acquia Cloud Site Factory Connector 8

Implements hook_drush_command().

File

acsf_init/acsf_init.drush.inc, line 41
Provides drush commands to set up a site for Acquia Site Factory.

Code

function acsf_init_drush_command() {
  return [
    'acsf-init' => [
      'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
      'callback' => 'drush_acsf_init',
      'description' => dt('Installs/updates the non-standard Drupal components for this repository to be compatible with Acquia Site Factory. This command will update in place, so there is no harm in running it multiple times.'),
      'options' => [
        'skip-default-settings' => dt('Do not edit the default settings.php file. Use this option when the edited default settings.php is causing issues in a local environment.'),
      ],
    ],
    'acsf-init-verify' => [
      'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
      'callback' => 'drush_acsf_init_verify',
      'description' => dt('Verifies that acsf-init was successfully run in the current version.'),
      'options' => [
        'skip-default-settings' => dt('Skip verifying the default settings.php file.'),
      ],
    ],
    'acsf-connect-factory' => [
      'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
      'callback' => 'drush_acsf_connect_factory',
      'description' => dt('Connect a site to a factory by setting up the right variables in the database.'),
      'aliases' => [
        'acsf-cf',
      ],
      'options' => [
        'site-admin-mail' => [
          'description' => dt('The email address of the Site Factory admin / Gardens admin user. This is typically the "Site Factory admin" user on the factory. These email addresses have to match in order for the initial OpenID connection to bind these accounts.'),
          'required' => TRUE,
          'example-value' => 'user3@example.com',
        ],
        'site-owner-name' => [
          'description' => dt('The name of the site owner.'),
          'required' => TRUE,
          'example-value' => 'John Smith',
        ],
        'site-owner-mail' => [
          'description' => dt('The email address of the site owner.'),
          'required' => TRUE,
          'example-value' => 'john.smith@example.com',
        ],
        'site-owner-roles' => [
          'description' => dt('A list of comma-separated roles (machine names) that should be granted to the site owner (optional).'),
          'example-value' => 'editor, site manager',
        ],
      ],
      'examples' => [
        'drush acsf-connect-factory --site-admin-mail="user3@example.com" --site-owner-name="John Smith" --site-owner-mail="john.smith@example.com"' => dt('Connect the site to the factory and sets the owner to John Smith.'),
      ],
    ],
    'acsf-uninstall' => [
      'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
      'callback' => 'drush_acsf_uninstall',
      'description' => dt('Uninstalls components for this Drupal repository to be compatible with Acquia Site Factory.'),
    ],
  ];
}