release 2.3 KB

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