Skip to content

Commit

Permalink
Added GENESIS_CALL_ENV for v2.8.x style calling
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisjbell committed Sep 23, 2022
1 parent 206df2f commit b70999c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Genesis/Env.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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)) : "");

Expand All @@ -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});
Expand Down
2 changes: 2 additions & 0 deletions t/30-env.t
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down

0 comments on commit b70999c

Please sign in to comment.