From 1143e1c66b8b054a2fefca2a23b1f499522ddb76 Mon Sep 17 00:00:00 2001 From: Tomas Dabasinskas Date: Fri, 5 Jun 2015 12:59:45 +1000 Subject: Add example ssh script --- doc/source/tutorial.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 632d2d0c..5110a252 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -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 -- cgit v1.2.1 From bafb4cc0a95428cbedaaa225abdceecee7533fac Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 10 Jun 2015 13:46:11 +0200 Subject: docs(tutorial): fix typo, minor improvements --- doc/source/tutorial.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 5110a252..7cc296d8 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -343,13 +343,13 @@ 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:: +Here's an example executable that can be used in place of the `ssh_executable` above:: #!/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) +Please note that the script must be executable (i.e. `chomd +x script.sh`). `StrictHostKeyChecking=no` is used to avoid prompts asking to save the hosts key to `~/.ssh/known_hosts`, which happens in case you run this as daemon. You might also have a look at `Git.update_environment(...)` in case you want to setup a changed environment more permanently. -- cgit v1.2.1