Merge pull request #51 from sharetribe/heroku-deployment-ssh-key

Fix Heroku deployment
This commit is contained in:
Kimmo Puputti 2017-02-24 10:46:50 +02:00 committed by GitHub
commit 11b8a114a2
2 changed files with 29 additions and 1 deletions

27
heroku-copy-ssh-key-from-env.sh Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Since we have a dependency to a private GitHub
# `sharetribe/sharetribe-sdk-js` repository, we must give Heroku SSH
# access to there. This script copies the GITHUB_SSH_KEY to the
# current user to enable SSH access to the repository.
# NOTE: This script should be removed when the dependency is not a
# private repository anymore.
set -e
if [ -z "$GITHUB_SSH_KEY" ]
then
echo "No GitHub SSH key to copy"
exit 0
fi
echo "Copying GitHub SSH key"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$GITHUB_SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "Adding GitHub SSH Host key to known hosts"
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts

View file

@ -44,10 +44,11 @@
"eject": "sharetribe-scripts eject",
"start": "node server/index.js",
"dev-server": "yarn run build&&nodemon --watch server server/index.js",
"heroku-prebuild": "./heroku-copy-ssh-key-from-env.sh",
"heroku-postbuild": "yarn run build"
},
"engines": {
"node": "6.9.4",
"yarn": "0.19.1"
"yarn": "0.20.3"
}
}