Update to use GIT_SSH_COMMAND
This commit is contained in:
parent
9eb189decd
commit
f3d197dc9b
@ -19,10 +19,13 @@ API_PASSWORD = os.environ['API_PASSWORD']
|
||||
DATA_DIR = os.environ['DATA_DIR']
|
||||
GIT_AUTH_MODE = os.environ['GIT_AUTH_MODE']
|
||||
|
||||
GIT_ENV = os.environ.copy()
|
||||
|
||||
if GIT_AUTH_MODE == 'http':
|
||||
auth_option = []
|
||||
elif GIT_AUTH_MODE == 'ssh':
|
||||
auth_option = ['--config','core.sshCommand="ssh -i /ssh/ssh-key"','-o','StrictHostKeyChecking=accept-new']
|
||||
GIT_ENV["GIT_SSH_COMMAND"] = "ssh -i /ssh/ssh-key"
|
||||
auth_option=['-o','StrictHostKeyChecking=accept-new']
|
||||
else:
|
||||
raise ValueError("Invalid GIT_AUTH_MODE")
|
||||
|
||||
@ -127,6 +130,7 @@ def execute_git_pull(repo_path):
|
||||
['git', 'pull'] + auth_option,
|
||||
cwd=repo_path,
|
||||
capture_output=True,
|
||||
env=GIT_ENV,
|
||||
text=True,
|
||||
timeout=300 # 5-minute timeout
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user