From 3211ee6575ef24a071818604346cd03be679d883 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 22 Aug 2019 16:24:39 +0200 Subject: [PATCH 1/2] Add AWS profile option when using the dashboard --- bref | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bref b/bref index aa9fb197f..263b8c18c 100755 --- a/bref +++ b/bref @@ -250,10 +250,11 @@ $app->command('deployment stack-name [--region=]', function (string $stackName, return 0; })->descriptions('Displays the latest deployment logs from CloudFormation. Only the logs from the last 24 hours are displayed. Use these logs to debug why a deployment failed.'); -$app->command('dashboard [--host=] [--port=]', function (string $host = 'localhost', int $port = 8000, SymfonyStyle $io) { +$app->command('dashboard [--host=] [--port=] [--profile=]', function (string $host = 'localhost', int $port = 8000, string $profile = 'default', SymfonyStyle $io) { if ($host === 'localhost') { $host = '127.0.0.1'; } + if (! file_exists('serverless.yml')) { $io->error('No `serverless.yml` file found.'); @@ -279,7 +280,7 @@ $app->command('dashboard [--host=] [--port=]', function (string $host = 'localho return 1; } - $servelessInfo = new Process(['serverless', 'info']); + $servelessInfo = new Process(['serverless', 'info', '--aws-profile', $profile]); $servelessInfo->start(); $animation = new LoadingAnimation($io); do { From 14af91141e7cdeb96486fb76ee706013ab950f98 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 22 Aug 2019 17:05:01 +0200 Subject: [PATCH 2/2] Send AWS profile to the docker dashboard --- bref | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bref b/bref index 263b8c18c..7ff10c33f 100755 --- a/bref +++ b/bref @@ -324,7 +324,7 @@ $app->command('dashboard [--host=] [--port=] [--profile=]', function (string $ho return 1; } - $process = new Process(['docker', 'run', '--rm', '-p', $host . ':' . $port.':8000', '-v', getenv('HOME').'/.aws:/root/.aws:ro', '--env', 'STACKNAME='.$stack, '--env', 'REGION='.$region, 'bref/dashboard']); + $process = new Process(['docker', 'run', '--rm', '-p', $host . ':' . $port.':8000', '-v', getenv('HOME').'/.aws:/root/.aws:ro', '--env', 'STACKNAME='.$stack, '--env', 'REGION='.$region, '--env', 'AWS_PROFILE='.$profile, 'bref/dashboard']); $process->setTimeout(null); $process->start(); do {