簡體   English   中英

SVN的Capistrano部署失敗

[英]Capistrano deployment from svn failing

我正在嘗試使用capistrano 2將我的應用程序從Subversion部署到本地服務器。 這是我嘗試部署的代碼,它只是默認的Rails應用程序:

https://www.assembla.com/code/capistranotest/subversion/nodes

這是指向我的svn存儲庫的my deploy.rb文件:

set :application, "CapistranoTest"
set :user, "jack"
set :repository,  "https://subversion.assembla.com/svn/capistranotest/"

set :scm, :subversion

set :deploy_to, "/home/jaeren/capistranotest"

role :web, "192.168.169.129"
role :app, "192.168.169.129"
role :db,  "192.168.169.129", :primary => true

set :scm_username, "jack"
set :runner, "jack"

set :use_sudo, false

我的帽子deploy:setup可以工作並創建必要的文件夾。 但是,當我運行cap deploy:cold並在提示我的Assembla帳戶時輸入我的用戶名和密碼時,出現此錯誤。 誰能告訴我為什么?

Jacks-MacBook-Pro:capistranotest Jack$ cd trunk
Jacks-MacBook-Pro:trunk Jack$ cap deploy:cold
  * 2015-04-27 00:31:45 executing `deploy:cold'
  * 2015-04-27 00:31:45 executing `deploy:update'
 ** transaction: start
  * 2015-04-27 00:31:45 executing `deploy:update_code'
    executing locally: "svn info https://subversion.assembla.com/svn/capistranotest/ --username \"jack\"--password \"\"--no-auth-cache  -rHEAD"
Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted Area
Password for 'jack--password': *************************

Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted Area
Username: jack
Password for 'jack': *************************

    command finished in 53369ms
  * executing "svn checkout -q --username \"jack\"--password \"\"--no-auth-cache  -r6 https://subversion.assembla.com/svn/capistranotest/ /home/jack/capistranotest/releases/20150426233238 && (echo 6 > /home/jack/capistranotest/releases/20150426233238/REVISION)"
    servers: ["192.168.169.129"]
    [192.168.169.129] executing command
 ** [192.168.169.129 :: err] Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted Area
 ** [192.168.169.129 :: err] Password for 'jack--password':
Password: 
 ** [192.168.169.129 :: err] Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted Area
 ** [192.168.169.129 :: err] Username:

- 編輯 -

嘗試更改為capistrano 2.12.0,它輸出不同的命令,但是我仍然遇到相同的錯誤:

Jaerens-MacBook-Pro:trunk Jaeren$ cap deploy:cold
  * executing `deploy:cold'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "svn info https://subversion.assembla.com/svn/capistranotest/ --username jaeren --password  --no-auth-cache  -rHEAD"
Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted Area
Username: Jaeren
Password for 'Jaeren': ***********

    command finished in 8473ms
  * executing "svn checkout -q --username jaeren --password  --no-auth-cache  -r6 https://subversion.assembla.com/svn/capistranotest/ /home/jaeren/capistranotest/releases/20150427001157 && (echo 6 > /home/jaeren/capistranotest/releases/20150427001157/REVISION)"
    servers: ["192.168.169.129"]
    [192.168.169.129] executing command
 ** [192.168.169.129 :: err] Authentication realm: <https://subversion.assembla.com:443> Assembla Restricted Area
 ** [192.168.169.129 :: err] Username:

謝謝。

看起來它正在嘗試通過jack--password進行身份驗證,因為username的值與其后的--password選項之間沒有空格。

executing locally: "svn info https://subversion.assembla.com/svn/capistranotest/ --username \"jack\"--password \"\"--no-auth-cache  -rHEAD"

我懷疑這是執行該命令的任何錯誤,這可能是Capistrano內置的。 嘗試升級到最新的Capistrano,然后仍不能解決問題,請在Capistrano項目上提交GitHub問題。

瑞安·比格(Ryan Bigg)是對的。 SVN身份驗證任務中有一個錯誤,Capistrano使用該錯誤登錄到遠程SVN存儲庫。

我正在運行Capistrano 2.15.6版,相關文件的路徑為

capistrano-YOURVERSION/lib/capistrano/recipes/deploy/scm/subversion.rb

打開此文件進行編輯,然后在底部查找身份驗證定義塊。

def authentication
    username = variable(:scm_username)
    return "" unless username
    result = %(--username "#{variable(:scm_username)}")
    result << %(--password "#{variable(:scm_password)}") unless variable(:scm_auth_cache) || variable(:scm_prefer_prompt)
    result << "--no-auth-cache " unless variable(:scm_auth_cache)
    result
end

注意,缺少--password和--no-auth-cache連接到結果變量的空白。 我只是在這里添加了一個空間

def authentication
    username = variable(:scm_username)
    return "" unless username
    result = %(--username "#{variable(:scm_username)}")
    result << %( --password "#{variable(:scm_password)}") unless variable(:scm_auth_cache) || variable(:scm_prefer_prompt)
    result << " --no-auth-cache " unless variable(:scm_auth_cache)
    result
end

簽出存儲庫時,可能不會提示OP輸入SVN憑據,因為他們已將密碼保存為SSH用戶。 Capistrano接受SCM憑據,因此在部署期間無需提示用戶輸入。 之所以會提示您輸入詳細信息,是因為上面的代碼中沒有多余的空白,它看起來像是Capistrano嘗試在不發送密碼的情況下進行身份驗證的服務器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM