Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3148c19243
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 22 lines (17 sloc) 0.779 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/bin/bash
[ -n "$APP" ] || { echo "error: APP required"; exit 1; }
[ -n "$HEROKU_API_KEY" ] || { echo "error: HEROKU_API_KEY required"; exit 1; }

echo "setting up ~/.ssh"
mkdir -p $HOME/.ssh

cat >$HOME/.ssh/config <<EOF
StrictHostKeyChecking no
EOF

[ -n "$SSH_PRIVATE_KEY" ] && echo "$SSH_PRIVATE_KEY" >$HOME/.ssh/id_rsa
[ -n "$SSH_PUBLIC_KEY" ] && echo "$SSH_PUBLIC_KEY" >$HOME/.ssh/id_rsa.pub

if [ ! -f $HOME/.ssh/id_rsa ]; then
ssh-keygen -f $HOME/.ssh/id_rsa -N "" -t rsa
  heroku keys:add --app $APP
  heroku config:set --app $APP SSH_PRIVATE_KEY="$(< $HOME/.ssh/id_rsa)" SSH_PUBLIC_KEY="$(< $HOME/.ssh/id_rsa.pub)"
fi

heroku plugins:install https://github.com/heroku/manager-cli.git
heroku plugins:install https://github.com/ddollar/heroku-anvil.git
Something went wrong with that request. Please try again.