-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRoboFile.php
61 lines (54 loc) · 1.91 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
use Symfony\Component\Finder\Finder;
class RoboFile extends \Robo\Tasks
{
use \LarsMalach\Robo\Task\Deployment\loadTasks;
public function deploy($instanceKey, array $opt = ['tag|t' => null, 'branch|b' => null])
{
$this->stopOnFail();
$this->deplInit($instanceKey, 'RoboServers.yaml' /* you can use yaml or json files */, $opt);
$this->collectionBuilder()
->addTask($this->deplGitClone())
->addTask($this->deplComposerInstall())
->addTask($this->deplBowerInstall())
->addTask($this->deplDeployFiles())
->addTask($this->deplRemoveLocalTemporaryDirectory())
->addTask($this->deplCreateMaintenanceFlag())
->addTask($this->deplRelease())
->addTask($this->deplMagentoCacheClear())
->addTask($this->deplRemoveMaintenanceFlag())
->addTask($this->deplRemoveOldReleases())
->run();
}
public function pharBuild()
{
$files = Finder::create()
->ignoreVCS(true)
->files()
->name('*.php')
->name('GeneratedWrapper.tmpl')
->path('src')
->path('vendor')
->notPath('docs')
->notPath('/vendor\/.*\/tests\//')
->in(__DIR__);
$pharTask = $this->taskPackPhar('robo.phar')
->compress()
->addFile('robo', 'vendor/consolidation/robo/robo')
->executable('vendor/consolidation/robo/robo');
$pharTask->addFiles($files);
$chmodTask = $this->taskFilesystemStack()
->chmod('robo.phar', 0777);
return $this->collectionBuilder()
->addTask($pharTask)
->addTask($chmodTask)
->run();
}
public function pharInstall()
{
return $this->taskExec('cp')
->arg('robo.phar')
->arg('/usr/local/bin/robo')
->run();
}
}