builds upon work done here
Used as part of a chain of buildpacks, allows the use of ssh keys inside a builder
inside another buildpack
#!/usr/bin/env bash
set -eo pipefail
layersdir=$1
env_dir=$2/env
export SSH_DIRECTORY="$(cat $env_dir/SSH_DIRECTORY)"
echo "---> Java Buildpack"
if [[ $SSH_DIRECTORY ]] ; then
setup-ssh
fi
# git clone [email protected]:username/private-repo.git
...
then build your app using
pack build --env="SSH_PRIVATE_KEY=$(cat ~/.ssh/id_rsa)" --path=/path/to/app --buildpacks=path/to/private-ssh-pack,path/to/language-pack