123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- require 'paths.php';
- require 'laravel/core.php';
- require 'vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
- use Symfony\Component\ClassLoader\UniversalClassLoader;
- $loader = new UniversalClassLoader;
- $loader->register();
- $loader->registerNamespace('Symfony', __DIR__.'/vendor');
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- $console = new Application;
- class TestingReleaser extends Command {
- /**
- * Configure the console command.
- *
- * @return void
- */
- protected function configure()
- {
- $this->setName('testing:release')->setDescription('Release to testing');
- }
- /**
- * Merge the develop branch into testing.
- *
- * return void
- */
- public function execute(InputInterface $input, OutputInterface $output)
- {
- passthru('git checkout testing');
- passthru('git merge develop');
- File::rmdir(__DIR__.'/tests');
- @unlink(__DIR__.'/phpunit.php');
- @unlink(__DIR__.'/phpunit.xml');
- passthru('git commit -am "<auto> removed unit tests from repository."');
- }
- }
- class DevelopHotfixer extends Command {
- /**
- * Configure the console command.
- *
- * @return void
- */
- public function configure()
- {
- $this->setName('develop:hotfix')->setDescription('Bring hotfixes into develop');
- }
- /**
- * Merge the testing and master branch hotfixes into the develop branch.
- *
- * @return void
- */
- public function execute(InputInterface $input, OutputInterface $output)
- {
- File::cpdir(__DIR__.'/tests', __DIR__.'/tests_bkp');
- File::copy(__DIR__.'/phpunit.php', __DIR__.'/phpunit_bkp.php');
- File::copy(__DIR__.'/phpunit.xml', __DIR__.'/phpunit_bkp.xml');
- passthru('git merge testing');
- File::rmdir(__DIR__.'/tests');
- @unlink(__DIR__.'/phpunit.php');
- @unlink(__DIR__.'/phpunit.xml');
- File::cpdir(__DIR__.'/tests_bkp', __DIR__.'/tests');
- File::copy(__DIR__.'/phpunit_bkp.php', __DIR__.'/phpunit.php');
- File::copy(__DIR__.'/phpunit_bkp.xml', __DIR__.'/phpunit.xml');
- File::rmdir(__DIR__.'/tests_bkp');
- @unlink(__DIR__.'/phpunit_bkp.php');
- @unlink(__DIR__.'/phpunit_bkp.xml');
- }
- }
- $console->add(new TestingReleaser);
- $console->add(new DevelopHotfixer);
- $console->run();
|