Repository navigation
Does the git checkout run locally or remotely? #4281
|
I have a deploy SSH key in Bitbucket so the remote "deploy" user on the server can connect and checkout the repo. According to Bitbucket, that key hasn't been used for years despite deployments happily working regularly. As a test, I disabled my SSH agent which holds my own key with access to the repo and the deploy failed at the checkout stage because of the public key. I tried without agent forwarding and got the same. I must have misunderstood how the connection to the Git repo and checkout works. I thought the git checkout executed on the server as the remote_user. Can anyone explain? |
Replies: 1 comment 1 reply
|
The git commands run on the server, as What With the default deployer/recipe/deploy/update_code.php Lines 98 to 119 in c08d136 Only the deployer/recipe/deploy/update_code.php Lines 44 to 49 in c08d136 Why the deploy key showed no use
Lines 114 to 115 in c08d136 When it is set, Deployer passes Lines 289 to 291 in c08d136 So when Why it still failed without forwarding With forwarding off, the server can only use whatever key the
Once Checked against deployer master at commit c08d136 (recipe/deploy/update_code.php, src/Deployer.php, src/Host/Host.php, docs/hosts.md) by reading the source. Nothing was run. |
The git commands run on the server, as
remote_user. But Deployer turns on SSH agent forwarding by default, so the server-sidegitwas logging in to Bitbucket with the key in your local agent and never touched the deploy key.What
deploy:update_codedoesWith the default
update_code_strategy(archive), the task callsrun(), which executes on the remote host. It creates a bare mirror in{{deploy_path}}/.dep/repowithgit clone --mirror, then runsgit remote updateon later deploys:deployer/recipe/deploy/update_code.php
Lines 98 to 119 in c08d136