Skip to content

Commit

Permalink
added support for running bref/dashboard within bref/dev-env cont…
Browse files Browse the repository at this point in the history
…ainer

The `HOST_AWS_CONF_DIR` ENV variable is set in brefphp/dev-environment#2
  • Loading branch information
meridius committed May 10, 2020
1 parent 5e1ebf3 commit bde68f7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bref
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bde68f7

Please sign in to comment.