1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Laravel\Forge\Deployment; |
4
|
|
|
|
5
|
|
|
use Laravel\Forge\Deployment\Commands\DeployCommand; |
6
|
|
|
use Laravel\Forge\Deployment\Commands\EnableDeploymentCommand; |
7
|
|
|
use Laravel\Forge\Deployment\Commands\GetDeploymentLogCommand; |
8
|
|
|
use Laravel\Forge\Deployment\Commands\DisableDeploymentCommand; |
9
|
|
|
use Laravel\Forge\Deployment\Commands\GetDeploymentScriptCommand; |
10
|
|
|
use Laravel\Forge\Deployment\Commands\ResetDeploymentStatusCommand; |
11
|
|
|
use Laravel\Forge\Deployment\Commands\UpdateDeploymentScriptCommand; |
12
|
|
|
|
13
|
|
|
class DeploymentManager |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* Enable quick deployment on given site. |
17
|
|
|
* |
18
|
|
|
* @return \Laravel\Forge\Deployment\Commands\EnableDeploymentCommand |
19
|
|
|
*/ |
20
|
|
|
public function enable() |
21
|
|
|
{ |
22
|
|
|
return (new EnableDeploymentCommand()); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Disable quick deployment on given site. |
27
|
|
|
* |
28
|
|
|
* @return \Laravel\Forge\Deployment\Commands\DisableDeploymentCommand |
29
|
|
|
*/ |
30
|
|
|
public function disable() |
31
|
|
|
{ |
32
|
|
|
return (new DisableDeploymentCommand()); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Get deployment script from given site. |
37
|
|
|
* |
38
|
|
|
* @return \Laravel\Forge\Deployment\Commands\GetDeploymentScriptCommand |
39
|
|
|
*/ |
40
|
|
|
public function script() |
41
|
|
|
{ |
42
|
|
|
return (new GetDeploymentScriptCommand()); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Update deployment script for given site. |
47
|
|
|
* |
48
|
|
|
* @param string $script |
49
|
|
|
* |
50
|
|
|
* @return \Laravel\Forge\Deployment\Commands\UpdateDeploymentScriptCommand |
51
|
|
|
*/ |
52
|
|
|
public function updateScript(string $script) |
53
|
|
|
{ |
54
|
|
|
return (new UpdateDeploymentScriptCommand())->withPayload(['content' => $script]); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Perform deployment of given site. |
59
|
|
|
* |
60
|
|
|
* @return \Laravel\Forge\Deployment\Commands\DeployCommand |
61
|
|
|
*/ |
62
|
|
|
public function deploy() |
63
|
|
|
{ |
64
|
|
|
return (new DeployCommand()); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Reset deployment status for given site. |
69
|
|
|
* |
70
|
|
|
* @return \Laravel\Forge\Deployment\Commands\ResetDeploymentStatusCommand |
71
|
|
|
*/ |
72
|
|
|
public function reset() |
73
|
|
|
{ |
74
|
|
|
return (new ResetDeploymentStatusCommand()); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Get latest deployment log from given site. |
79
|
|
|
* |
80
|
|
|
* @return \Laravel\Forge\Deployment\Commands\GetDeploymentLogCommand |
81
|
|
|
*/ |
82
|
|
|
public function log() |
83
|
|
|
{ |
84
|
|
|
return (new GetDeploymentLogCommand()); |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|