File tree 2 files changed +52
-0
lines changed
2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ public function solutions()
154
154
Solutions \ResourceUpdateInProgress::class,
155
155
Solutions \RunDeploymentHooksTimedOut::class,
156
156
Solutions \EnvironmentVariableLimitReached::class,
157
+ Solutions \EnvironmentIsUnhealthy::class,
157
158
])->map (function ($ solutionsClass ) {
158
159
return new $ solutionsClass ($ this );
159
160
})->filter
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Laravel \VaporCli \Solutions ;
4
+
5
+ use Illuminate \Support \Str ;
6
+ use Laravel \VaporCli \Deployment ;
7
+
8
+ class EnvironmentIsUnhealthy
9
+ {
10
+ /**
11
+ * The deployment that have failed.
12
+ *
13
+ * @var \Laravel\VaporCli\Deployment
14
+ */
15
+ protected $ deployment ;
16
+
17
+ /**
18
+ * Create a new solution instance.
19
+ *
20
+ * @param \Laravel\VaporCli\Deployment $deployment
21
+ * @return void
22
+ */
23
+ public function __construct ($ deployment )
24
+ {
25
+ $ this ->deployment = $ deployment ;
26
+ }
27
+
28
+ /**
29
+ * Checks if the solution is applicable.
30
+ *
31
+ * @return bool
32
+ */
33
+ public function applicable ()
34
+ {
35
+ return Str::contains ($ this ->deployment ->status_message , [
36
+ 'Unable to obtain a healthy response from the environment being deployed. ' ,
37
+ ]);
38
+ }
39
+
40
+ /**
41
+ * Returns the list of solutions based on the deployment.
42
+ *
43
+ * @return array
44
+ */
45
+ public function all ()
46
+ {
47
+ return [
48
+ 'Review "CLI" environment logs: https://vapor.laravel.com/app/projects/ ' .$ this ->deployment ->project_id .'/environments/ ' .$ this ->deployment ->environment ['name ' ].'/logs?period=5m&type=cli ' ,
49
+ ];
50
+ }
51
+ }
You can’t perform that action at this time.
0 commit comments