Skip to content

Instantly share code, notes, and snippets.

@gtalarico
Created May 24, 2018 00:14
Show Gist options
  • Save gtalarico/56919d749ec64f1f9f3ba2f16b4a4d6a to your computer and use it in GitHub Desktop.
Save gtalarico/56919d749ec64f1f9f3ba2f16b4a4d6a to your computer and use it in GitHub Desktop.
Install Private Git on Heroku w/ exposing credentials in requirements.txt
# Add this file to app root, Heroku will execute it on start, clone repo and add location to path
DIR=./package
if [ -d "$DIR" ]; then
printf '%s\n' "Deleting existing folder: ($DIR)"
rm -rdf "$DIR"
fi
# GIT_CREDENTIALS=username:pwd
echo "Cloning..."
git clone --progress --branch master --depth=1 --single-branch http://${GIT_CREDENTIALS}@github.com/org/repo.git package
echo "Cloning completed. Adding Package to PATH"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/package"
echo "Adding to PTH: ${DIR}"
export PYTHONPATH=$DIR:$PYTHONPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment