$idx->local("rm app/logs/*"); $idx->local("rm junit*xml"); } catch (\Exception $e) { } $idx->local("cd app/config && rm -rf parameters.yml"); $idx->local("cd app/config && ln -s parameters.dev.yml parameters.yml"); $idx->runTask('vendors:install'); try { $idx->local("./app/console doctrine:database:create --env=test"); $idx->local("./app/console doctrine:database:create --env=testprofile"); } catch (\Exception $e) { $idx->output->writeln('Database already exists'); } try { $idx->local("./app/console doctrine:schema:drop --force --env=test"); $idx->local("./app/console doctrine:schema:drop --force --env=testprofile"); } catch (\Exception $e) { $idx->output->writeln('Ready to create schema'); } $idx->local("./app/console doctrine:schema:create --env=test"); $idx->local("./app/console doctrine:schema:create --env=testprofile"); $idx->runTask('asset:install'); $idx->runTask('test:run'); })->add('vendors:install', function () use($idx) { $idx->local('composer install'); })->add('asset:install', function () use($idx) { $idx->local("app/console assets:install web --symlink"); $idx->local("app/console assetic:dump"); }); $idx->addLibrary('deploy', new Deploy()); $idx->run();
<?php use Idephix\Idephix; use Idephix\Extension\Deploy\Deploy; use Idephix\Extension\PHPUnit\PHPUnit; use Idephix\SSH\SshClient; $sshParams = array('user' => 'ideato'); $targets = array('prod' => array('hosts' => array('127.0.0.1', '33.33.33.10'), 'ssh_params' => $sshParams, 'deploy' => array('local_base_dir' => __DIR__, 'remote_base_dir' => "/var/www/my-project/", 'rsync_exclude_file' => 'rsync_exclude.txt', 'shared_folders' => array('app/logs', 'web/uploads'))), 'stage' => array('hosts' => array('192.168.169.170'), 'ssh_params' => $sshParams, 'deploy' => array('local_base_dir' => __DIR__, 'remote_base_dir' => "/var/www/my-project.ideato.it/", 'rsync_exclude_file' => 'rsync_exclude.txt', 'shared_folders' => array('app/logs', 'web/uploads'))), 'test' => array('hosts' => array('127.0.0.1'), 'ssh_params' => array('user' => 'kea'), 'deploy' => array('local_base_dir' => __DIR__, 'remote_base_dir' => "/tmp/my-project.test/", 'shared_folders' => array('app/logs', 'web/uploads')))); $idx = new Idephix($targets, new SshClient()); $idx->add('hello', function () { echo 'Output by custom idx file!'; })->add('idephix:test-params', function ($param1, $param2, $param3 = 'default') { echo "{$param1} {$param2} {$param3}"; }); $idx->addLibrary('deploy', new Deploy()); $idx->addLibrary('phpunit', new PHPUnit()); $idx->run();
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The library must be an object */ public function testAddLibraryNonObject() { $this->idx->addLibrary('name', 123); }