release 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. require 'paths.php';
  3. require 'laravel/core.php';
  4. require 'vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
  5. use Symfony\Component\ClassLoader\UniversalClassLoader;
  6. $loader = new UniversalClassLoader;
  7. $loader->register();
  8. $loader->registerNamespace('Symfony', __DIR__.'/vendor');
  9. use Symfony\Component\Console\Application;
  10. use Symfony\Component\Console\Command\Command;
  11. use Symfony\Component\Console\Input\InputArgument;
  12. use Symfony\Component\Console\Input\InputInterface;
  13. use Symfony\Component\Console\Output\OutputInterface;
  14. $console = new Application;
  15. class TestingReleaser extends Command {
  16. /**
  17. * Configure the console command.
  18. *
  19. * @return void
  20. */
  21. protected function configure()
  22. {
  23. $this->setName('testing:release')->setDescription('Release to testing');
  24. }
  25. /**
  26. * Merge the develop branch into testing.
  27. *
  28. * return void
  29. */
  30. public function execute(InputInterface $input, OutputInterface $output)
  31. {
  32. passthru('git merge develop');
  33. File::rmdir(__DIR__.'/tests');
  34. @unlink(__DIR__.'/phpunit.php');
  35. @unlink(__DIR__.'/phpunit.xml');
  36. passthru('git commit -am "<auto> removed unit tests from repository."');
  37. }
  38. }
  39. class DevelopHotfixer extends Command {
  40. /**
  41. * Configure the console command.
  42. *
  43. * @return void
  44. */
  45. public function configure()
  46. {
  47. $this->setName('develop:hotfix')->setDescription('Bring hotfixes into develop');
  48. }
  49. /**
  50. * Merge the testing and master branch hotfixes into the develop branch.
  51. *
  52. * @return void
  53. */
  54. public function execute(InputInterface $input, OutputInterface $output)
  55. {
  56. File::cpdir(__DIR__.'/tests', __DIR__.'/tests_bkp');
  57. File::copy(__DIR__.'/phpunit.php', __DIR__.'/phpunit_bkp.php');
  58. File::copy(__DIR__.'/phpunit.xml', __DIR__.'/phpunit_bkp.xml');
  59. passthru('git merge testing');
  60. File::rmdir(__DIR__.'/tests');
  61. @unlink(__DIR__.'/phpunit.php');
  62. @unlink(__DIR__.'/phpunit.xml');
  63. File::cpdir(__DIR__.'/tests_bkp', __DIR__.'/tests');
  64. File::copy(__DIR__.'/phpunit_bkp.php', __DIR__.'/phpunit.php');
  65. File::copy(__DIR__.'/phpunit_bkp.xml', __DIR__.'/phpunit.xml');
  66. File::rmdir(__DIR__.'/tests_bkp');
  67. @unlink(__DIR__.'/phpunit_bkp.php');
  68. @unlink(__DIR__.'/phpunit_bkp.xml');
  69. }
  70. }
  71. $console->add(new TestingReleaser);
  72. $console->add(new DevelopHotfixer);
  73. $console->run();