From bde68f71b895450368d1d36461587f2ac6b55696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Luke=C5=A1?= Date: Sun, 10 May 2020 17:00:04 +0200 Subject: [PATCH] added support for running `bref/dashboard` within `bref/dev-env` container The `HOST_AWS_CONF_DIR` ENV variable is set in brefphp/dev-environment#2 --- bref | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bref b/bref index c1a1ae7ae..5d9d57c6b 100755 --- a/bref +++ b/bref @@ -340,8 +340,21 @@ $app->command('dashboard [--host=] [--port=] [--profile=] [--stage=]', function 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, '--env', 'AWS_PROFILE='.$profile, 'bref/dashboard']); + $awsConfDir = strlen(getenv('HOST_AWS_CONF_DIR')) > 0 + ? getenv('HOST_AWS_CONF_DIR') + : getenv('HOME') . '/.aws' + ; + $process = new Process( + [ + 'docker', 'run', '--rm', + '-p', $host . ':' . $port . ':8000', + '-v', $awsConfDir . ':/root/.aws:ro', + '--env', 'STACKNAME=' . $stack, + '--env', 'REGION=' . $region, + '--env', 'AWS_PROFILE=' . $profile, + 'bref/dashboard', + ] + ); $process->setTimeout(null); $process->start(); do {