Skip to content

Add example ssh script #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ This one sets a custom script to be executed in place of `ssh`, and can be used
with repo.git.custom_environment(GIT_SSH=ssh_executable):
repo.remotes.origin.fetch()

Here's an executable used as GIT_SSH::

#!/bin/sh
ID_RSA=/var/lib/openshift/5562b947ecdd5ce939000038/app-deployments/id_rsa
exec /usr/bin/ssh -o StrictHostKeyChecking=no -i $ID_RSA "$@"

Please note script must have executable permissions. StrictHostKeyChecking=no is used to avoid prompts asking to save hots key to ~/.ssh/known_hosts (this is in case you run this in some service)

You might also have a look at `Git.update_environment(...)` in case you want to setup a changed environment more permanently.

Submodule Handling
Expand Down