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 に答える