Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Added more verbose output
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Branca committed Jun 30, 2016
1 parent ffcddf7 commit 373d1e4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/StackFormation/BlueprintAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function executeBeforeScripts()
return;
}

if ($this->output && !$this->output->isQuiet()) {
$this->output->writeln("Running scripts:");
}

$envVars = $this->profileManager->getEnvVarsFromProfile($this->blueprint->getProfile());
if (empty($envVars)) {
$envVars = [];
Expand All @@ -59,7 +63,7 @@ public function executeBeforeScripts()
$tmpfile = tempnam(sys_get_temp_dir(), 'before_scripts_');
file_put_contents($tmpfile, implode("\n", $scripts));

$command = "cd $basePath && " . implode(' ', $envVars) . " /usr/bin/env bash $tmpfile";
$command = "cd $basePath && " . implode(' ', $envVars) . " /usr/bin/env bash -x $tmpfile";
passthru($command, $returnVar);
unlink($tmpfile);
if ($returnVar !== 0) {
Expand Down Expand Up @@ -132,10 +136,18 @@ public function deploy($dryRun=false)

protected function prepareArguments()
{
if ($this->output && !$this->output->isQuiet()) { $this->output->write("Preparing parameters... "); }
$parameters = $this->blueprint->getParameters();
if ($this->output && !$this->output->isQuiet()) { $this->output->writeln("done."); }

if ($this->output && !$this->output->isQuiet()) { $this->output->write("Preparing template... "); }
$template = $this->blueprint->getPreprocessedTemplate();
if ($this->output && !$this->output->isQuiet()) { $this->output->writeln("done."); }

$arguments = [
'StackName' => $this->blueprint->getStackName(),
'Parameters' => $this->blueprint->getParameters(),
'TemplateBody' => $this->blueprint->getPreprocessedTemplate(),
'Parameters' => $parameters,
'TemplateBody' => $template,
'Tags' => $this->blueprint->getTags()
];
if ($capabilities = $this->blueprint->getCapabilities()) {
Expand Down

0 comments on commit 373d1e4

Please sign in to comment.