2013-03-11 81 views
1

我想我的「開發」分支部署到我的開發服務器,但是當我運行cap development deploy,我得到以下錯誤:無法創建符號鏈接

executing "ln -nfs /var/www/xyz.co.uk/shared/web/media /var/www/xyz.co.uk/releases/20130311143220/web/media" 
    servers: ["x.xx.xx.xxx"] 
    [x.xx.xx.xxx] executing command 
*** [err :: x.xx.xx.xxx] ln: 
*** [err :: x.xx.xx.xxx] failed to create symbolic link `/var/www/xyz.co.uk/releases/20130311143220/web/media' 
*** [err :: x.xx.xx.xxx] : No such file or directory 
*** [err :: x.xx.xx.xxx] 
    command finished in 44ms 
*** [deploy:update_code] rolling back 

當我看着服務器/var/www/xyz.co.uk/shared/web/media對被創建並且/var/www/xyz.co.uk/releases/20130311143220被創建,但是一旦符號鏈接失敗,那麼20130311143220在其回退時被刪除。有任何想法嗎?我以ssh作爲根。

Capifony配置

deploy.rb

set :stage_dir, 'app/config/deploy' # needed for Symfony2 only 
set :stages, %w(production staging development) 

set :application, "xyz.co.uk" 

set :user, "root" # The server's user for deploys 
set :repository, "[email protected]:xyz/#{application}.git" 
set :scm,   :git 

set :keep_releases, 3 
set :use_sudo,  false 
set :shared_files,  ["app/config/parameters.yml"] 
set :shared_children, [app_path + "/logs", web_path + "/media", "vendor"] 
set :use_composer, true 
set :update_vendors, true 
set :dump_assetic_assets, true 

require 'capistrano/ext/multistage' 
logger.level = Logger::MAX_LEVEL 

development.rb

server 'x.xx.xx.xxx', :app, :web, :primary => true 
ssh_options[:port] = xxxx 
ssh_options[:forward_agent] = true 
set :deploy_to, "/var/www/xyz.co.uk/" 
set :symfony_env_prod, "test" 

UPDATE

實際的錯誤信息是:

failed: "sh -c 'ln -nfs /var/www/xyz.co.uk/shared/web/media /var/www/xz.co.uk/releases/20130312135615/web/media'" on x.xx.xx.xxx 

而且,這裏是我的.gitignore文件:

/web/bundles/ 
/app/bootstrap* 
/app/cache/* 
/app/logs/* 
/vendor/ 
/app/config/parameters.yml 
composer.phar 
/.idea/ 
/web/media/* 

是否有所作爲,我的用戶名和密碼,才能從我的git倉庫拉比我的開發服務器上的不同我本地機器,我從哪裏部署?

+0

我們可能需要您的Capifony配置。 – 2013-03-11 14:51:30

+0

好吧給我2分鐘,我會更新我的問題。 – user1961082 2013-03-11 14:55:12

+0

使用Capifony配置更新的問題。 – user1961082 2013-03-11 14:57:23

回答

1

原因是因爲我沒有設置set_branch開發所以它使用空的主!

+3

3年,但你從未放棄!我愛這個精神。 – 2013-11-12 18:51:33

0

在你的資源庫服務器(bitbucked,github)中,媒體文件夾已被推送?看來capifony試圖設置爲共享一個不存在的文件夾。

+0

不,我的GIT存儲庫中沒有媒體文件夾,因爲我在.gitignore中忽略了它。 – user1961082 2013-03-13 17:29:30