Source of file AddTempUpgradeBranch.php
Size: 1,472 Bytes - Last Modified: 2020-07-03T12:08:09+00:00
/var/www/docs.ssmods.com/process/src/src/Tasks/IndividualTasks/AddTempUpgradeBranch.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php namespace Sunnysideup\UpgradeToSilverstripe4\Tasks\IndividualTasks; use Sunnysideup\UpgradeToSilverstripe4\Tasks\Helpers\Git; use Sunnysideup\UpgradeToSilverstripe4\Tasks\Task; /** * Adds a new branch to your repository that is going to be used for upgrading it. */ class AddTempUpgradeBranch extends Task { protected $taskStep = 's10'; public function getTitle() { return 'Add Upgrade Branch'; } public function getDescription() { return ' Adds a new branch ' . $this->mu()->getNameOfTempBranch() . ' based on ' . $this->mu()->getNameOfUpgradeStarterBranch() . ' (both names can be customised) to your repository (' . ($this->mu()->getVendorName() ?: 'Vendor Name') . '/' . ($this->mu()->getPackageName() ?: 'Package Name') . ') that is going to be used for upgrading it. If it already exists then it will first be DELETED!'; } public function runActualTask($params = []) { Git::inst($this->mu()) ->deleteBranch( $this->mu()->getGitRootDir(), $this->mu()->getNameOfTempBranch() ) ->createNewBranch( $this->mu()->getGitRootDir(), $this->mu()->getNameOfTempBranch(), $this->mu()->getNameOfUpgradeStarterBranch() ); } protected function hasCommitAndPush() { return true; } } |