protected function execute(InputInterface $input, OutputInterface $output) { $detector = new GitFlowBranch($this->getContext()->getVCS(), GitFlowBranch::RELEASE); if ($detector->isInTheFlow()) { throw new Exception("Detected a git flow branch. Finish it first."); } // Generate and save the new version number $increment = $this->getContext()->getInformationCollector()->getValueFor('type'); $generator = new \Liip\RMT\Version\Generator\SemanticGenerator(); $newVersion = $generator->generateNextVersion($this->getContext()->getParam('current-version'), $increment); $this->getContext()->setNewVersion($newVersion); $action = new GitFlowStartReleaseAction(); $action->setContext($this->getContext()); $action->execute(); }
protected function execute(InputInterface $input, OutputInterface $output) { // Generate and save the new version number $increment = $this->getContext()->getInformationCollector()->getValueFor('type'); $generator = new \Liip\RMT\Version\Generator\SemanticGenerator(); $newVersion = $generator->generateNextVersion($this->getContext()->getParam('current-version'), $increment); $this->getContext()->setNewVersion($newVersion); $this->executeActionListIfExist('preReleaseActions'); $this->writeSmallTitle('Release process'); $this->getOutput()->indent(); $this->getOutput()->writeln("A new version named [<yellow>{$newVersion}</yellow>] is going to be released"); $this->getContext()->getVersionPersister()->save($newVersion); $this->getOutput()->writeln("Release: <green>Success</green>"); $this->getOutput()->unIndent(); $this->executeActionListIfExist('postReleaseActions'); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The option [type] must be one of: {patch, minor, major, build}, "full" given */ public function testIncrementWithInvalidType() { $generator = new \Liip\RMT\Version\Generator\SemanticGenerator(); $generator->generateNextVersion('1.0.0', 'full'); }