Skip to content
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

Support ssh keys for git operations #17

Closed
bcremer opened this issue Jun 24, 2014 · 2 comments
Closed

Support ssh keys for git operations #17

bcremer opened this issue Jun 24, 2014 · 2 comments

Comments

@bcremer
Copy link
Contributor

bcremer commented Jun 24, 2014

This can be archived using an ENV var.

http://alvinabad.wordpress.com/2013/03/23/how-to-specify-an-ssh-key-file-with-the-git-command/

@bcremer
Copy link
Contributor Author

bcremer commented Jul 1, 2014

We might need a little ssh wrapper script for that:
bin/ssh-as.sh

#!/bin/bash
set -e
set -u

ssh -i $SSH_KEYFILE $@

Also the ssh-key and the wrapper script must be available in the filesystem, so the files must be copied from the phar into the config dir/runtime dir:

$commandline = 'git ' . $commandline;

$env = array(
    'SSH_KEYFILE' => '~/.config/sw-cli-tools/stash_read_only_key.txt',
    'GIT_SSH'     => '/run/user/1000/sw-cli-tools/sw-cli-tools/bin/ssh-as.sh'
);

$process = new Process($commandline, null, $env);
$process->setTimeout(self::DEFAULT_TIMEOUT);

@bcremer
Copy link
Contributor Author

bcremer commented Oct 13, 2014

This has been fixed with: fbfe65f

@bcremer bcremer closed this as completed Oct 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant