1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* Travis CI plugin for HiDev |
5
|
|
|
* |
6
|
|
|
* @link https://github.com/hiqdev/hidev-travis |
7
|
|
|
* @package hidev-travis |
8
|
|
|
* @license BSD-3-Clause |
9
|
|
|
* @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace hidev\travis\console; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Travis CI. |
16
|
|
|
*/ |
17
|
|
|
class TravisController extends \hidev\base\Controller |
18
|
|
|
{ |
19
|
|
|
public $defaultAction = 'run'; |
20
|
|
|
|
21
|
|
|
public function actionRun() |
22
|
|
|
{ |
23
|
|
|
$this->runActions(['before-install', 'install']); |
|
|
|
|
24
|
|
|
$res = $this->runActions(['before-script', 'script']); |
|
|
|
|
25
|
|
|
$this->runAction(static::isNotOk($res) ? 'after-failure' : 'after-success'); |
|
|
|
|
26
|
|
|
$this->runAction('after-script'); |
27
|
|
|
|
28
|
|
|
return $res; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function actionBeforeInstall() |
32
|
|
|
{ |
33
|
|
|
return $this->runRequests($this->getComponent()->before_install); |
|
|
|
|
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function actionInstall() |
37
|
|
|
{ |
38
|
|
|
return $this->runRequests($this->getComponent()->install); |
|
|
|
|
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function actionBeforeScript() |
42
|
|
|
{ |
43
|
|
|
return $this->runRequests($this->getComponent()->before_script); |
|
|
|
|
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function actionScript() |
47
|
|
|
{ |
48
|
|
|
return $this->runRequests($this->getComponent()->script); |
|
|
|
|
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function actionAfterSuccess() |
52
|
|
|
{ |
53
|
|
|
return $this->runRequests($this->getComponent()->after_success); |
|
|
|
|
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function actionAfterFailure() |
57
|
|
|
{ |
58
|
|
|
return $this->runRequests($this->getComponent()->after_failure); |
|
|
|
|
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function actionAfterScript() |
62
|
|
|
{ |
63
|
|
|
return $this->runRequests($this->getComponent()->after_script); |
|
|
|
|
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getComponent() |
67
|
|
|
{ |
68
|
|
|
return $this->take('travis'); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.