Skip to content
Snippets Groups Projects

Draft: 3426231: Draft of changes to support Drupal based AMA install process.

Closed Bryan Jiencke requested to merge issue/acquia_migrate-3426231:3426231-port-ama-install into 1.9.x
10 files
+ 624
9
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -12,6 +12,7 @@ use Drupal\acquia_migrate\Batch\MigrationBatchCoordinator;
use Drupal\acquia_migrate\Batch\MigrationBatchManager;
use Drupal\acquia_migrate\Controller\HttpApi;
use Drupal\acquia_migrate\EventSubscriber\ServerTimingHeaderForResponseSubscriber;
use Drupal\acquia_migrate\Installer;
use Drupal\acquia_migrate\Migration;
use Drupal\acquia_migrate\MigrationRepository;
use Drupal\acquia_migrate\Recommendations;
@@ -185,6 +186,13 @@ final class AcquiaMigrateCommands extends DrushCommands {
*/
protected $coordinator;
/**
* The acquia_migrate installer.
*
* @var \Drupal\acquia_migrate\Installer
*/
protected $acquiaMigrateInstaller;
/**
* AcquiaMigrateCommands constructor.
*
@@ -202,8 +210,10 @@ final class AcquiaMigrateCommands extends DrushCommands {
* The migration batch manager.
* @param \Drupal\acquia_migrate\Batch\MigrationBatchCoordinator $coordinator
* The migration batch coordinator.
* @param \Drupal\acquia_migrate\Installer $acquia_migrate_installer
* The acquia_migrate installer.
*/
public function __construct(MigrationRepository $migration_repository, KeyValueFactoryInterface $key_value, ModuleExtensionList $module_extension_list, Recommendations $recommendations, MigratePluginManagerInterface $source_plugin_manager, MigrationBatchManager $migration_batch_manager, MigrationBatchCoordinator $coordinator) {
public function __construct(MigrationRepository $migration_repository, KeyValueFactoryInterface $key_value, ModuleExtensionList $module_extension_list, Recommendations $recommendations, MigratePluginManagerInterface $source_plugin_manager, MigrationBatchManager $migration_batch_manager, MigrationBatchCoordinator $coordinator, Installer $acquia_migrate_installer) {
parent::__construct();
$this->migrationRepository = $migration_repository;
$this->keyValue = $key_value;
@@ -212,6 +222,44 @@ final class AcquiaMigrateCommands extends DrushCommands {
$this->sourcePluginManager = $source_plugin_manager;
$this->migrationBatchManager = $migration_batch_manager;
$this->coordinator = $coordinator;
$this->acquiaMigrateInstaller = $acquia_migrate_installer;
}
/**
* Installs acquia_migrate on an existing Drupal site.
*
* @command ama:install
* @filter-output
*
* @option path-recommendations The path to the recommendations file to use.
* @option include-unvetted Include unvetted recommendations.
* @option include-lenient Include recommendations that require mglaman/composer-drupal-lenient.
*
* @default $options []
*
* @usage ama:install
* Installs AMA on the new instance.
*
* @validate-module-enabled acquia_migrate
*
* @field-labels
* module: Module
* vetted: Vetted
* stable: Stable
* version: Version
* has_migrations: Has Migrations
* alters_migrations: Alters Migrations
* risk: Risk
* installed: Installed
* installation_time: Installation time
* @default-fields module,vetted,stable,has_migrations,alters_migrations,risk,installed,installation_time
*/
public function install($options = [
'include-unvetted' => self::OPT,
'include-lenient' => self::OPT,
'path-recommendations' => self::OPT,
]) {
$this->acquiaMigrateInstaller->install($options['include-unvetted'], $options['include-lenient'], $options['path-recommendations']);
}
/**
Loading