Skip to content

Commit

Permalink
Use Transporteo instead of migration tool
Browse files Browse the repository at this point in the history
  • Loading branch information
anaelChardan committed Sep 29, 2017
1 parent c9a3850 commit 0e38e72
Show file tree
Hide file tree
Showing 45 changed files with 229 additions and 236 deletions.
17 changes: 5 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#=== Akeneo PIM Migration tool helper ===
#=== Akeneo Transporteo helper ===

# Styles
YELLOW=$(shell echo "\033[00;33m")
Expand All @@ -10,7 +10,7 @@ CURRENT_DIR := $(shell pwd)
.PHONY: list
list:
@echo ""
@echo "Akeneo PIM Migration tool available targets:"
@echo "Transporteo available targets:"
@echo ""
@echo " $(YELLOW)commit$(RESTORE) > run pre commit stuff"
@echo " $(YELLOW)fix-style$(RESTORE) > run the PHP-CS-FIXER"
Expand All @@ -20,7 +20,6 @@ list:
@echo " $(YELLOW)phpunit$(RESTORE) > run All PHPUnit"
@echo " $(YELLOW)launch$(RESTORE) > Launch the tool"
@echo " $(YELLOW)dump-state-machine$(RESTORE) > Dump the State Machine"
@echo " $(YELLOW)clean-var$(RESTORE) > Clean the var folder (akeneo_project)"
@echo ""
@echo ""
@echo " $(YELLOW)composer$(RESTORE) > run composer"
Expand All @@ -38,12 +37,12 @@ fix-style:

.PHONY: launch
launch:
php MigrationTool.php akeneo-pim:migrate
php Transporteo.php akeneo-pim:migrate

.PHONY: dump-state-machine
dump-state-machine:
php MigrationTool.php state-machine:dump
dot -Tpng stateMachineMigrationTool.dot -o stateMachineMigrationTool.png
php Transporteo.php state-machine:dump
dot -Tpng stateMachineTransporteo.dot -o stateMachineTransporteo.png

.PHONY: test
test: | phpspec-run phpunit
Expand Down Expand Up @@ -75,9 +74,3 @@ update:
.PHONY: clean
clean:
rm -rf vendor

.PHONY: clean-var
clean-var:
docker-compose -f ./var/akeneo_project/docker-compose.yml down
rm -rf var/akeneo_project
rm var/composer.json var/parameters.yml var/pim_parameters.yml
4 changes: 2 additions & 2 deletions MigrationTool.php → Transporteo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
require __DIR__.'/vendor/autoload.php';

use Akeneo\PimMigration\Infrastructure\Common\ApplicationFactory;
use Akeneo\PimMigration\Infrastructure\UserInterface\Cli\MigrationTool;
use Akeneo\PimMigration\Infrastructure\UserInterface\Cli\Transporteo;
use Akeneo\PimMigration\Infrastructure\UserInterface\Cli\StateMachineDumper;

$application = ApplicationFactory::create();

$migrationCommand = new MigrationTool($application->getContainer());
$migrationCommand = new Transporteo($application->getContainer());
$dumpCommand = new StateMachineDumper($application->getContainer());

$application->add($migrationCommand);
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Command/MySqlExportTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public function __construct(string $tableName, string $path)

public static function getPimTableNameDumpPath(string $tableName): string
{
return sprintf('%stmp%smigration_tool_%s.sql', DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $tableName);
return sprintf('%stmp%stransporteo_%s.sql', DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $tableName);
}
}
2 changes: 1 addition & 1 deletion src/Domain/Command/MySqlImportTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(string $path)
public static function getLocalTableDumpPath(string $tableName): string
{
return sprintf(
'%s%s..%s..%s..%svar%smigration_tool_%s.sql',
'%s%s..%s..%s..%svar%stransporteo_%s.sql',
__DIR__,
DIRECTORY_SEPARATOR,
DIRECTORY_SEPARATOR,
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Common/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Application extends SymfonyApplication
/** @var Container */
private $container;

public function __construct($name = 'Akeneo PIM Migration Tool', $version = '1.0.0', Container $container)
public function __construct($name = 'Transporteo', $version = '1.0.0', Container $container)
{
$this->container = $container;

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Common/ApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function create(bool $autoExit = true, string $env = 'prod'): Appl
{
$container = ContainerBuilder::getContainer();

$application = new Application('Akeneo PIM Migration Tool', '1.0.0', $container);
$application = new Application('Transporteo', '1.0.0', $container);

$application->setAutoExit($autoExit);
$application->setDispatcher($container->get('event_dispatcher'));
Expand Down
28 changes: 14 additions & 14 deletions src/Infrastructure/Common/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function getContainer(): Container

$container->addCompilerPass(new RegisterListenersPass());

$worklowsDefinition = Yaml::parse(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'migration_tool_state_machine.yml'));
$worklowsDefinition = Yaml::parse(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'transporteo_state_machine.yml'));

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/config'));
$loader->load('symfony_framework.xml');
Expand All @@ -69,23 +69,23 @@ public static function getContainer(): Container

$container->registerForAutoconfiguration(EventSubscriberInterface::class)->addTag('kernel.event_subscriber');

$container->registerForAutoconfiguration(Console::class)->addTag('migration_tool.console');
$container->registerForAutoconfiguration(FileFetcher::class)->addTag('migration_tool.file_fetcher');
$container->registerForAutoconfiguration(DestinationPimDownloader::class)->addTag('migration_tool.destination_pim_downloader');
$container->registerForAutoconfiguration(DestinationPimSystemRequirementsInstaller::class)->addTag('migration_tool.destination_pim_system_requirements_installer');
$container->registerForAutoconfiguration(Console::class)->addTag('transporteo.console');
$container->registerForAutoconfiguration(FileFetcher::class)->addTag('transporteo.file_fetcher');
$container->registerForAutoconfiguration(DestinationPimDownloader::class)->addTag('transporteo.destination_pim_downloader');
$container->registerForAutoconfiguration(DestinationPimSystemRequirementsInstaller::class)->addTag('transporteo.destination_pim_system_requirements_installer');

$container->compile();

self::loadRegistry($container, StructureMigrator::class, 'migration_tool.structure_migrator', 'addStructureMigrator');
self::loadRegistry($container, SystemMigrator::class, 'migration_tool.system_migrator', 'addSystemMigrator');
self::loadRegistry($container, JobMigrator::class, 'migration_tool.job_migrator', 'addJobMigrator');
self::loadRegistry($container, GroupMigrator::class, 'migration_tool.group_migrator', 'addGroupMigrator');
self::loadRegistry($container, EnterpriseEditionDataMigrator::class, 'migration_tool.enterprise_edition_data_migrator', 'addEnterpriseEditionDataMigrator');
self::loadRegistry($container, StructureMigrator::class, 'transporteo.structure_migrator', 'addStructureMigrator');
self::loadRegistry($container, SystemMigrator::class, 'transporteo.system_migrator', 'addSystemMigrator');
self::loadRegistry($container, JobMigrator::class, 'transporteo.job_migrator', 'addJobMigrator');
self::loadRegistry($container, GroupMigrator::class, 'transporteo.group_migrator', 'addGroupMigrator');
self::loadRegistry($container, EnterpriseEditionDataMigrator::class, 'transporteo.enterprise_edition_data_migrator', 'addEnterpriseEditionDataMigrator');

self::loadRegistry($container, ChainedConsole::class, 'migration_tool.console', 'addConsole');
self::loadRegistry($container, FileFetcherRegistry::class, 'migration_tool.file_fetcher', 'addFileFetcher');
self::loadRegistry($container, DestinationPimDownloaderHelper::class, 'migration_tool.destination_pim_downloader', 'addDestinationPimDownloader');
self::loadRegistry($container, DestinationPimSystemRequirementsInstallerHelper::class, 'migration_tool.destination_pim_system_requirements_installer', 'addDestinationPimSystemRequirementsInstaller');
self::loadRegistry($container, ChainedConsole::class, 'transporteo.console', 'addConsole');
self::loadRegistry($container, FileFetcherRegistry::class, 'transporteo.file_fetcher', 'addFileFetcher');
self::loadRegistry($container, DestinationPimDownloaderHelper::class, 'transporteo.destination_pim_downloader', 'addDestinationPimDownloader');
self::loadRegistry($container, DestinationPimSystemRequirementsInstallerHelper::class, 'transporteo.destination_pim_system_requirements_installer', 'addDestinationPimSystemRequirementsInstaller');

return $container;
}
Expand Down
Loading

0 comments on commit 0e38e72

Please sign in to comment.