Skip to content

Commit

Permalink
Fix SSH_HOSTS environment variable to actually work
Browse files Browse the repository at this point in the history
This is fix provided in the following PR: debitoor#9

Apparently Heroku environment variables for the application are not exposed to buildpacks, instead $ENV_DIR directory contains files for the environment variables application uses. This fixes that actually setting SSH_HOSTS works with this buildpack.
  • Loading branch information
Wojcirej committed Mar 21, 2024
1 parent e7880b1 commit 64c34f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ function indent() {

ENV_DIR=${3:-}
ssh_key="$(cat $ENV_DIR/SSH_KEY)"
ssh_hosts=${SSH_HOSTS:-"git@github.com"}
if [ -f $ENV_DIR/SSH_HOSTS ]; then
ssh_hosts="$(cat $ENV_DIR/SSH_HOSTS)"
echo "Available ssh hosts passed via SSH_HOSTS variable: $ssh_hosts"
else
ssh_hosts="git@github.com"
echo "SSH_HOSTS is not set, using default git@github.com"
fi

if [ "$ssh_key" != "" ]; then
echo "-----> Running SSH private key setup"
Expand Down

0 comments on commit 64c34f0

Please sign in to comment.