Exemplo n.º 1
0
 private function copyDirectory()
 {
     $repoDir = Repositories::getRepoDir();
     $mainRepoRootDir = $repoDir . Repositories::getMain()['directory'];
     // "." is required to copy hidden files too
     exec("cp -r {$mainRepoRootDir}/{$this->prefix}. {$repoDir}{$this->repository['directory']}");
 }
 public function run()
 {
     $path = Repositories::getRepoDir() . $this->repository['directory'];
     if (!is_dir($path)) {
         print 'Cloning: ' . $this->repository['url'] . "\n";
         exec("git clone {$this->repository['url']} {$path} -q");
     }
 }
Exemplo n.º 3
0
 private function handleSplitRepository()
 {
     $path = Repositories::getRepoDir() . $this->repository['directory'];
     if (is_dir($path)) {
         chdir($path);
         print 'Updating: ' . $this->repository['url'] . "\n";
         exec("git pull -q");
     }
 }
Exemplo n.º 4
0
 public function run()
 {
     $path = Repositories::getRepoDir() . $this->repository['directory'];
     if (is_dir($path)) {
         chdir($path);
         print 'Tagging version ' . $this->taggedVersion . ' for repository: ' . $this->repository['url'] . "\n";
         exec("git tag {$this->taggedVersion} -am \"{$this->getTagMessage()}\"");
     }
 }
Exemplo n.º 5
0
 private function ensureMasterBranchForMainRepo()
 {
     $repo = Repositories::getMain();
     $path = Repositories::getRepoDir() . $repo['directory'];
     if (is_dir($path)) {
         chdir($path);
         exec('git checkout master');
     }
 }
Exemplo n.º 6
0
 public function run()
 {
     $path = Repositories::getRepoDir() . $this->repository['directory'];
     if (is_dir($path)) {
         chdir($path);
         print 'Pushing module: ' . $this->repository['url'] . "\n";
         exec('git push -q');
         exec('git push --tags -q');
     }
 }
Exemplo n.º 7
0
 public function run()
 {
     $path = Repositories::getRepoDir() . $this->repository['directory'];
     if (is_dir($path)) {
         chdir($path);
         print 'Deleting tag ' . $this->taggedVersion . ' for repository: ' . $this->repository['url'] . "\n";
         if ($this->repository['directory'] === 'cms') {
             exec('git checkout master -q');
         }
         exec("git tag -d {$this->taggedVersion}");
         exec("git push origin :refs/tags/{$this->taggedVersion}");
     }
 }
Exemplo n.º 8
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @return int
  * @throws \Exception
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->checkoutRepositoriesDir();
     /** @var PushRepositoryThread[] $workers */
     $workers = [];
     $i = 0;
     foreach (Repositories::getModules() as $prefix => $info) {
         $workers[$i] = new PushRepositoryThread($info);
         $workers[$i]->start();
         ++$i;
     }
     foreach (range(0, $i - 1) as $worker) {
         $workers[$worker]->join();
     }
     return 0;
 }
 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @return int|null
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->checkoutRepositoriesDir();
     $version = $input->getArgument('version');
     $message = $input->getArgument('message');
     /** @var TagVersionThread[] $workers */
     $workers = [];
     $i = 0;
     foreach (Repositories::getModules() as $prefix => $info) {
         $workers[$i] = new TagVersionThread($info, $version, $message);
         $workers[$i]->start();
         ++$i;
     }
     foreach (range(0, $i - 1) as $worker) {
         $workers[$worker]->join();
     }
     return 0;
 }
Exemplo n.º 10
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @return int|null
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->checkoutRepositoriesDir();
     $version = $input->getArgument('version');
     $repositories = Repositories::getModules();
     $repositories['main'] = Repositories::getMain();
     /** @var DeleteTagThread[] $workers */
     $workers = [];
     $i = 0;
     foreach ($repositories as $prefix => $info) {
         $workers[$i] = new DeleteTagThread($info, $version);
         $workers[$i]->start();
         ++$i;
     }
     foreach (range(0, $i - 1) as $worker) {
         $workers[$worker]->join();
     }
     return 0;
 }
Exemplo n.º 11
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @return int
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $this->checkoutRepositoriesDir();
     } catch (\Exception $e) {
         mkdir(Repositories::getRepoDir());
     }
     $repositories = Repositories::getModules();
     $repositories['main'] = Repositories::getMain();
     /** @var InitializeRepositoryThread[] $workers */
     $workers = [];
     $i = 0;
     foreach ($repositories as $prefix => $info) {
         $workers[$i] = new InitializeRepositoryThread($info);
         $workers[$i]->start();
         ++$i;
     }
     foreach (range(0, $i - 1) as $worker) {
         $workers[$worker]->join();
     }
     return 0;
 }
Exemplo n.º 12
0
 /**
  * @throws \Exception
  */
 protected function checkoutRepositoriesDir()
 {
     if (!is_dir(Repositories::getRepoDir())) {
         throw new \Exception('Repositories directory doesn\'t exist. Please run acp3:subtree-init command first!');
     }
 }