release 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 checkout testing');
  33. passthru('git merge develop');
  34. File::rmdir(__DIR__.'/tests');
  35. @unlink(__DIR__.'/phpunit.php');
  36. @unlink(__DIR__.'/phpunit.xml');
  37. passthru('git commit -am "<auto> removed unit tests from repository."');
  38. }
  39. }
  40. class DevelopHotfixer extends Command {
  41. /**
  42. * Configure the console command.
  43. *
  44. * @return void
  45. */
  46. public function configure()
  47. {
  48. $this->setName('develop:hotfix')->setDescription('Bring hotfixes into develop');
  49. }
  50. /**
  51. * Merge the testing and master branch hotfixes into the develop branch.
  52. *
  53. * @return void
  54. */
  55. public function execute(InputInterface $input, OutputInterface $output)
  56. {
  57. File::cpdir(__DIR__.'/tests', __DIR__.'/tests_bkp');
  58. File::copy(__DIR__.'/phpunit.php', __DIR__.'/phpunit_bkp.php');
  59. File::copy(__DIR__.'/phpunit.xml', __DIR__.'/phpunit_bkp.xml');
  60. passthru('git merge testing');
  61. File::rmdir(__DIR__.'/tests');
  62. @unlink(__DIR__.'/phpunit.php');
  63. @unlink(__DIR__.'/phpunit.xml');
  64. File::cpdir(__DIR__.'/tests_bkp', __DIR__.'/tests');
  65. File::copy(__DIR__.'/phpunit_bkp.php', __DIR__.'/phpunit.php');
  66. File::copy(__DIR__.'/phpunit_bkp.xml', __DIR__.'/phpunit.xml');
  67. File::rmdir(__DIR__.'/tests_bkp');
  68. @unlink(__DIR__.'/phpunit_bkp.php');
  69. @unlink(__DIR__.'/phpunit_bkp.xml');
  70. }
  71. }
  72. $console->add(new TestingReleaser);
  73. $console->add(new DevelopHotfixer);
  74. $console->run();