diff options
author | Wild Kat <wk@futureinquestion.net> | 2018-03-11 23:11:13 +0100 |
---|---|---|
committer | Wild Kat <wk@futureinquestion.net> | 2018-03-11 23:11:13 +0100 |
commit | ad2a0675edee605bda8fe460b3656857eb050129 (patch) | |
tree | 70cb7eb8fd6dba4f4520a88744b4757d7cb552c1 | |
parent | 34cdbeb75f3c74d803fb60c509fc06e4f6365f0c (diff) |
Introduce support for OXIDIZED_SSH_PASSPHRASE
-rw-r--r-- | docs/Hooks.md | 2 | ||||
-rw-r--r-- | lib/oxidized/hook/githubrepo.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/docs/Hooks.md b/docs/Hooks.md index fab4025..080d301 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -67,6 +67,8 @@ This hook configures the repository `remote` and _push_ the code when the specif * `publickey`: publickey for repository auth. * `privatekey`: privatekey for repository auth. +It is also possible to set the environment variable `OXIDIZED_SSH_PASSPHRASE` to a passphrase if your keypair requires it. + When using groups repositories, each group must have its own `remote` in the `remote_repo` config. ``` yaml diff --git a/lib/oxidized/hook/githubrepo.rb b/lib/oxidized/hook/githubrepo.rb index d33e54e..f74b22a 100644 --- a/lib/oxidized/hook/githubrepo.rb +++ b/lib/oxidized/hook/githubrepo.rb @@ -51,7 +51,7 @@ class GithubRepo < Oxidized::Hook else if cfg.has_key?('publickey') && cfg.has_key?('privatekey') log "Using ssh auth with key", :debug - Rugged::Credentials::SshKey.new(username: 'git', publickey: File.expand_path(cfg.publickey), privatekey: File.expand_path(cfg.privatekey)) + Rugged::Credentials::SshKey.new(username: 'git', publickey: File.expand_path(cfg.publickey), privatekey: File.expand_path(cfg.privatekey), passphrase: ENV["OXIDIZED_SSH_PASSPHRASE"]) else log "Using ssh auth with agentforwarding", :debug Rugged::Credentials::SshKeyFromAgent.new(username: 'git') |