Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Renders error from the SecretCommand #202

Merged
merged 4 commits into from
Nov 18, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions src/Commands/SecretCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Laravel\VaporCli\Commands;

use Laravel\VaporCli\Helpers;
use Laravel\VaporCli\Manifest;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

Expand All @@ -28,32 +27,12 @@ protected function configure()
/**
* Execute the command.
*
* @return void
* @return int
*/
public function handle()
{
Helpers::ensure_api_token_is_available();

$this->vapor->storeSecret(
Manifest::id(),
$this->argument('environment'),
$this->option('name') ?? Helpers::ask('Name'),
$this->option('value') ?? $this->determineValue()
);

Helpers::info('Secret stored successfully.');
Helpers::line('You should deploy the project using the "deploy" command to ensure the new secrets are available.');
}
Helpers::danger('Secrets are no longer supported. Instead, you may utilize environment variables and / or encrypted environment files.');

/**
* Determine the secret's value.
*
* @return string
*/
protected function determineValue()
{
return $this->option('file')
? file_get_contents($this->option('file'))
: Helpers::ask('Value');
return 1;
}
}