【发布时间】:2016-06-26 11:08:38
【问题描述】:
我有一台服务器,我想通过 capistrano 部署我的源代码。 我可以通过此服务器上的 ssh 访问部署用户,但我从中提取的存储库实际上只能通过 https 访问。 我正在使用 capistrano 3.5 和
帽子分期医生
在变量中显示以下内容。可能不止标准上限,但我认为他们的所作所为是显而易见的。
变量
:application "capistrano_deployment"
:branch "master"
:default_env {}
:deploy_prefix ""
:deploy_root "/var/www"
:deploy_to "/var/www/capistrano_deployment"
:format :airbrussh
:git_environmental_variables {:git_askpass=>"/bin/echo", :git_ssh=>"/tmp/capistrano_deployment/git-ssh.sh"}
:keep_releases 5
:local_user "myuser"
:log_level :debug
:pty true
:repo_url "https://myuser@git.internal.net/git/capistrano_deployment.git"
:scm :git
:stage :staging
:target_directory "capistrano_deployment"
:tmp_dir "/tmp"
我遇到的问题是部署失败,因为 capistrano 没有要求我输入 git 这个存储库的密码,该存储库由 https 和 not 访问,因为 capistrano 似乎通过 ssh 假设。
INFO [ce69c094] Running /usr/bin/env git ls-remote --heads https://myuser@git.internal.net/git/capistrano_deployment.git as deploy@…
DEBUG [ce69c094] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/capistrano_deployment/git-ssh.sh" ; /usr/bin/env git ls-remo…
DEBUG [ce69c094] fatal: Authentication failed for 'https://myuser@git.internal.net/git/capistrano_deployment.git/'
我需要更改 capistrano 要求输入 https url 的密码 - 希望只有一次,而不是每个由 capistrano 执行的 git 查询? 似乎也有解决方案以明文形式在 .netrc 中部署用户名和密码(不是选项!)。想不惜一切代价避免这样的解决方案
【问题讨论】:
标签: git http authentication https capistrano