Skip to content

Commit 7aea396

Browse files
author
Joshua Timberman
committed
Merge pull request poise#25 from tinnet/pip-git-ssh-fix
COOK-2766: use deployment key when installing reqs with pip
2 parents b858e51 + 90aff7a commit 7aea396

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

providers/django.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@
6262
cwd new_resource.release_path
6363
# seems that if we don't set the HOME env var pip tries to log to /root/.pip, which fails due to permissions
6464
# setting HOME also enables us to control pip behavior on per-project basis by dropping off a pip.conf file there
65-
environment 'HOME' => ::File.join(new_resource.path,'shared')
65+
# GIT_SSH allow us to reuse the deployment key used to clone the main
66+
# repository to clone any private requirements
67+
if new_resource.deploy_key
68+
environment 'HOME' => ::File.join(new_resource.path,'shared'), 'GIT_SSH' => "#{new_resource.path}/deploy-ssh-wrapper"
69+
else
70+
environment 'HOME' => ::File.join(new_resource.path,'shared')
71+
end
6672
user new_resource.owner
6773
group new_resource.group
6874
end

0 commit comments

Comments
 (0)