Skip to content

Instantly share code, notes, and snippets.

@eentzel
Last active August 29, 2015 14:04
Show Gist options
  • Save eentzel/af485bf308c25094f633 to your computer and use it in GitHub Desktop.
Save eentzel/af485bf308c25094f633 to your computer and use it in GitHub Desktop.
pip install over git when credentials are not installed in ~/.ssh
touch deployer_key
chmod 600 deployer_key
cat > deployer_key <<EOF
-----BEGIN RSA PRIVATE KEY-----
something something something
-----END RSA PRIVATE KEY-----
EOF
cat > sshwrap <<'EOF'
#!/bin/sh -x
exec /usr/bin/ssh -i deployer_key "$@"
EOF
chmod 700 sshwrap
export GIT_SSH="./sshwrap"
virtualenv env
. env/bin/activate
pip install --upgrade git+ssh://[email protected]/user/repo.git
@eentzel
Copy link
Author

eentzel commented Jul 22, 2014

The problem — you want to run the pip install git+ssh://[email protected]/user/repo.git line at then end, but your jenkins user doesn't have SSH access to GitHub.

The One possible solution — hardcode the SSH private key in your build config, save it to a file, and set GIT_SSH so that Git will use the private key you provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment