2012-03-18 21 views
2

我有一點麻煩,而使用Capistrano的,我需要做的是部署從它駐留在我的本地機器我的私人VPS有沒有辦法告訴Capistrano將本地存儲庫部署到遠程服務器?

到目前爲止,我deploy.rb文件看起來像一個倉庫這樣的:

set :application, "store" 
set :repository, "/home/jose/linode/store" 
#set :local_repository, "/home/jose/linode/store" 
set :branch, "master" 
set :scm, :git 
set :user, "root" 
set :scm_username, "my_git_user" 

set :use_sudo, false 

set :deploy_to, '/home/www/store' 

# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` 

role :web, "169.255.255.255"       # Your HTTP server, Apache/etc 
role :app, "169.255.255.255"       # This may be the same as your `Web` server 
role :db, "169.255.255.255", :primary => true  # This is where Rails migrations will run 
#role :db, "your slave db-server here" 

然而,這個失敗,它輸出以下錯誤:

**** [169.255.255.255 :: ERR]致命的:庫 '的/ home /聖荷西/的Linode /存儲'不存在**

這使我相信它是在遠程服務器中尋找存儲庫!

需要什麼配置來告訴Capistrano Repo位於這裏,而不是:169.255.255.255?

非常感謝提前!

回答

3

你正在尋找的設置是:

set :deploy_via, :copy

,在你的/tmp/目錄中創建一個本地.tar.gz文件,並推到服務器部署過程中。

如果您查看源代碼,特別是lib/capistrano/recipes/deploy/strategy/copy.rb,您會看到一大堆註釋,從以下開始。

# This class implements the strategy for deployments which work 
    # by preparing the source code locally, compressing it, copying the 
    # file to each target host, and uncompressing it to the deployment 
    # directory. 

This article是爲較舊版本編寫的,但它仍然是相當有趣的,涵蓋了部署選項和優化。

+0

非常有趣!但在這裏:https://github.com/capistrano/capistrano/wiki/2.x-Significant-Configuration-Variables,我假設是最新版本,我沒有看到:deploy_via選項了?這會是一個問題嗎?你知道嗎?哦,謝謝你的回覆! – jlstr 2012-03-19 01:49:44

+1

它可能已經過時,但Capistrano文件一直是臭名昭着的。就我所知,'deploy_via'仍然在代碼中,所以試試看看會發生什麼。 – jdl 2012-03-19 03:10:54

+0

謝謝那個。我確實注意到,自從deploy_via以來,正如你所說的那樣沒有問題。 – jlstr 2012-03-20 13:26:19

相關問題