Skip to content

Commit

Permalink
Merge pull request #200 from pantheon-systems/psite-create-fix
Browse files Browse the repository at this point in the history
Adding logic to handle the deploy_product workflow
  • Loading branch information
Josh Koenig committed Jan 2, 2015
2 parents dd3e8f2 + 0dbac3e commit d4af637
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions terminus.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ function drush_terminus_pantheon_site_create($name = FALSE) {
* @param $site_uuid
*/
function terminus_site_creation_poll($site_uuid) {
$deploy_environment = FALSE;
$dev_environment = FALSE;
$sync_code = FALSE;
$time = 0;
while (TRUE) {
Expand All @@ -1697,8 +1697,17 @@ function terminus_site_creation_poll($site_uuid) {
if ($workflow->type === 'deploy_environment' &&
$workflow->environment === 'dev' &&
$workflow->result === 'succeeded' &&
$deploy_environment === FALSE) {
$deploy_environment = TRUE;
$dev_environment === FALSE) {
$dev_environment = TRUE;
echo "\n" . 'Completed development environment creation in ';
echo (int) $workflow->total_time ." seconds. \n";
}
// When spinning up via a product uuid directly, the deploy_product
// workflow is used.
if ($workflow->type === 'deploy_product' &&
$workflow->result === 'succeeded' &&
$dev_environment === FALSE) {
$dev_environment = TRUE;
echo "\n" . 'Completed development environment creation in ';
echo (int) $workflow->total_time ." seconds. \n";
}
Expand All @@ -1718,7 +1727,7 @@ function terminus_site_creation_poll($site_uuid) {
}
}

if ($deploy_environment && $sync_code) {
if ($dev_environment && $sync_code) {
break;
}
// Failsafe: time out after 30m
Expand Down

0 comments on commit d4af637

Please sign in to comment.