-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide environment keys / Add EnvironmentHasExceededLimit solution (#222)
* Add deployment solution EnvironmentHasExceededLimit * Add test EnvironmentHasExceededLimit * Change str_contains to Str::contains * move message filter * formatting * update tests * formatting --------- Co-authored-by: Joe Dixon <[email protected]>
- Loading branch information
1 parent
9a28dc6
commit 77f86c2
Showing
4 changed files
with
99 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Laravel\VaporCli\Solutions; | ||
|
||
use Illuminate\Support\Str; | ||
use Laravel\VaporCli\Deployment; | ||
|
||
class EnvironmentVariableLimitReached | ||
{ | ||
/** | ||
* The deployment that have failed. | ||
* | ||
* @var \Laravel\VaporCli\Deployment | ||
*/ | ||
protected $deployment; | ||
|
||
/** | ||
* Create a new solution instance. | ||
* | ||
* @param \Laravel\VaporCli\Deployment $deployment | ||
* @return void | ||
*/ | ||
public function __construct($deployment) | ||
{ | ||
$this->deployment = $deployment; | ||
} | ||
|
||
/** | ||
* Checks if the solution is applicable. | ||
* | ||
* @return bool | ||
*/ | ||
public function applicable() | ||
{ | ||
return Str::contains($this->deployment->status_message, [ | ||
'Lambda was unable to configure your environment variables because the environment variables you have provided exceeded the 4KB limit', | ||
]); | ||
} | ||
|
||
/** | ||
* Returns the list of solutions based on the deployment. | ||
* | ||
* @return array | ||
*/ | ||
public function all() | ||
{ | ||
return [ | ||
'Use encrypted environment files in place of or in addition to environment variables: https://docs.vapor.build/1.0/projects/environments.html#encrypted-environment-files', | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters