Skip to content

Commit

Permalink
improved phar publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed May 21, 2016
1 parent 8e223b2 commit 847ed33
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
37 changes: 13 additions & 24 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,10 @@ class RoboFile extends \Robo\Tasks
/**
* Run the Robo unit tests.
*/
public function test($args = "", $options =
[
'coverage-html' => false,
'coverage' => false
])
public function test($args = "")
{
$taskCodecept = $this->taskCodecept()
return $this->taskCodecept()
->args($args);

if ($options['coverage']) {
$taskCodecept->coverageXml('../../build/logs/clover.xml');
}
if ($options['coverage-html']) {
$taskCodecept->coverageHtml('../../build/logs/coverage');
}

return $taskCodecept;
}

/**
Expand Down Expand Up @@ -294,18 +281,20 @@ public function pharInstall()
*/
public function pharPublish()
{
$current_branch = exec('git rev-parse --abbrev-ref HEAD');
$this->taskGitStack()
->checkout('site')
->merge('master')->run();
$this->pharBuild();
$this->_copy('CHANGELOG.md', 'docs/changelog.md');
$this->pharBuild()->run();

$this->_rename('robo.phar', 'robo-release.phar');
$this->taskGitStack()->checkout('gh-pages')->run();
$this->taskFilesystemStack()
->remove('robo.phar')
->rename('robo-release.phar', 'robo.phar')
->run();
$this->taskGitStack()
->add('robo.phar -f')
->add('robo.phar')
->commit('robo.phar published')
->push('origin', 'gh-pages')
->checkout('master')
->run();
$this->_exec('mkdocs gh-deploy');
$this->taskGitStack()->checkout($current_branch)->run();
}

/**
Expand Down
Binary file modified robo.phar
Binary file not shown.
4 changes: 4 additions & 0 deletions src/LoadAllTasks.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace Robo;

use Robo\Collection\Collection;

trait LoadAllTasks
{
use TaskAccessor;
Expand Down Expand Up @@ -43,6 +45,8 @@ trait LoadAllTasks
* instead of:
*
* $this->getContainer()->get('collection');
*
* @return Collection
*/
protected function collection()
{
Expand Down

0 comments on commit 847ed33

Please sign in to comment.