【问题标题】:Capistrano deploy from Git HTTP repo从 Git HTTP repo 部署 Capistrano
【发布时间】:2013-01-10 08:50:34
【问题描述】:

有没有人通过 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/384https://github.com/capistrano/capistrano/issues/384的票证中提供了更准确的问题描述

【问题讨论】:

  • 为什么为什么为什么!这让我非常沮丧! ;)
  • 你是指 HTTP 上的 repo?
  • http 位。为什么不能使用 https?
  • 可能。不过,我从来没有在 https 上部署过 cap。尽管使用它安装宝石没有问题。我想知道您是否可以尝试不使用 scm_username 和密码,或者更改为 https
  • 如果您使用 VPN 服务器,我有解决方案如何通过 ssh 协议进行部署。如果你需要我可以回答。

标签: ruby-on-rails git http deployment capistrano


【解决方案1】:

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-18
  • 1970-01-01
相关资源
最近更新 更多