From b70999c8df239451acea25722486385ab35b7c3c Mon Sep 17 00:00:00 2001 From: Dennis Bell Date: Fri, 23 Sep 2022 00:13:47 -0700 Subject: [PATCH] Added GENESIS_CALL_ENV for v2.8.x style calling --- lib/Genesis/Env.pm | 5 +++++ t/30-env.t | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/Genesis/Env.pm b/lib/Genesis/Env.pm index 30864b7b..661a6d38 100644 --- a/lib/Genesis/Env.pm +++ b/lib/Genesis/Env.pm @@ -862,6 +862,8 @@ sub get_environment_variables { $env{GENESIS_ENVIRONMENT} = $self->name; $env{GENESIS_TYPE} = $self->type; $env{GENESIS_CALL_BIN} = humanize_bin(); + + # Deprecated, use GENESIS_CALL_ENV instead, but drop the $GENESIS_ENVIRONMENT after the command $env{GENESIS_CALL} = $env{GENESIS_CALL_BIN}. ($is_alt_path ? sprintf(" -C '%s'", humanize_path($self->path)) : ""); @@ -874,6 +876,9 @@ sub get_environment_variables { $env_ref = humanize_path($self->path)."/$env_ref" if $is_alt_path; $env_ref = "'$env_ref'" if $env_ref =~ / \(\)!\*\?/; + $env{GENESIS_ENV_REF} = $env_ref; + $env{GENESIS_CALL_ENV} = "$env{GENESIS_CALL_BIN} $env_ref"; + if ($ENV{GENESIS_COMMAND}) { $env{GENESIS_PREFIX_TYPE} = $ENV{GENESIS_PREFIX_TYPE} || 'none'; $env{GENESIS_CALL_PREFIX} = sprintf("%s %s %s", $env{GENESIS_CALL_BIN}, $env_ref, $ENV{GENESIS_COMMAND}); diff --git a/t/30-env.t b/t/30-env.t index ec358a03..7da43bab 100644 --- a/t/30-env.t +++ b/t/30-env.t @@ -1596,12 +1596,14 @@ EOF GENESIS_TYPE => $top->type, GENESIS_CALL_BIN => Genesis::humanize_bin(), GENESIS_CALL => "genesis", + GENESIS_CALL_ENV => "genesis ".$env->name, GENESIS_CI_BASE => "/concourse/main/".$env->name."/", GENESIS_CI_MOUNT => "/concourse/", GENESIS_CI_MOUNT_OVERRIDE => "true", GENESIS_CREDHUB_EXODUS_SOURCE => "root_vault/credhub", GENESIS_CREDHUB_EXODUS_SOURCE_OVERRIDE => "root_vault/credhub", # Shouldn't this be boolean? GENESIS_CREDHUB_ROOT => "root_vault-credhub/base-extended-thing", + GENESIS_ENV_REF => $env->name, GENESIS_ENV_KIT_OVERRIDE_FILES => re('\/(var\/folders|tmp)\/.*\/env-overrides-0.yml'), GENESIS_EXODUS_BASE => "/shhhh/exodus/base-extended/thing", GENESIS_EXODUS_MOUNT => "/shhhh/exodus/",