diff --git a/RoboFile.php b/RoboFile.php index 98c463f..7565719 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -24,6 +24,9 @@ public function run( ] ) { + // Bootstrap the environment + \Migrator\Step\StepParent::fillDynamicEnvironmentFromEnv(); + \Migrator\LagoonUtilityBelt::setUpLagoon_yml(); $climate = new CLImate; $opts = array_merge($opts, $this->processEnvironment()); diff --git a/src/Step/Deploy.php b/src/Step/Deploy.php index 0bd859f..38decd6 100644 --- a/src/Step/Deploy.php +++ b/src/Step/Deploy.php @@ -16,7 +16,7 @@ public function runImplementation(array $args) ) ? $args["passIfTextExistsInLogs"] : null; // We'd like to run the buildvar values through the text substitutions - $processedBuildVars = array_map(fn($v) => $this->doTextSubstitutions($v), $args['buildVariables'] ?: []); + $processedBuildVars = array_map(fn($v) => ["name" => $v["name"], "value" => $this->doTextSubstitutions($v['value'])], $args['buildVariables'] ?: []); $variables = !empty($processedBuildVars) ? $processedBuildVars : null; $bulkName = !empty($args['bulkName']) ? $args['bulkName'] : null; $skipDeploymentWait = !empty($args['skipDeploymentWait']) ? $args['skipDeploymentWait'] : false; diff --git a/src/Step/Setdeploytarget.php b/src/Step/Setdeploytarget.php index 90b6b3f..076d045 100644 --- a/src/Step/Setdeploytarget.php +++ b/src/Step/Setdeploytarget.php @@ -12,8 +12,16 @@ public function runImplementation(array $args) if(empty($args['target'])) { throw new \Exception("Step type setdeploytarget requires an argument 'target'"); } + + // Do substitutions on Target + $target = self::doTextSubstitutions($args['target']); + if(!is_numeric($target)) { + throw new \Exception(sprintf("The target specified is not numeric: %s", $target)); + } + $targetInt = intval($target); + $this->log("Setting deploy target to {$args['target']}"); - $this->utilityBelt->setDeployTargetForEnvironment($this->args->project, $this->args->environment, $args['target']); + $this->utilityBelt->setDeployTargetForEnvironment($this->args->project, $this->args->environment, $targetInt); } } \ No newline at end of file