8

有没有人通过 HTTP 从 Git 存储库部署 Capistrano 的经验?

以下deploy.rb不起作用:

set :repository,  'http://git.repository-domain.com:4442/git/repo.git'
set :scm_username, "git_username"
set :scm_password, "git_password"
set :scm, :git

如果您按以下方式传递存储库,它会起作用:

set :repository,  'http://git_username:git_password@git.repository-domain.com:4442/git/repo.git'

后者仅在用户名或密码没有特殊字符时才有效。对这些字符进行 URL 编码将导致失败。

更新:问题的更准确描述可在https://github.com/capistrano/capistrano/issues/384的票证中找到

4

1 回答 1

20

Capistrano Git HTTPS 身份验证将在 Capistrano 3 中解决,您可以在其中设置存储库及其凭据:

set :repo_url, 'https://git.repository-domain.com:4442/git/repo.git'
set :git_http_username, 'username'
set :git_http_password, 'password'

此外,在 Capistrano 3 中已经可以使用的是存储库 URL 中的用户名:密码,即使密码包含特殊字符:

set :repo_url, 'https://ain:3490jL?a@git.repository-domain.com:4442/git/repo.git'

有关更多最新信息,请参阅https://github.com/capistrano/capistrano

于 2013-07-10T09:11:40.967 回答