2013-01-11 80 views
1

我試圖用capifony部署symfony2項目。在資源部署symfony2時資產安裝錯誤

我得到以下錯誤:

--> Updating code base with rsync_with_remote_cache strategy 
--> Creating cache directory................................✔ 
--> Creating symlinks for shared directories................✔ 
--> Creating symlinks for shared files......................✔ 
--> Normalizing asset timestamps............................✔ 
--> Downloading Composer....................................✔ 
--> Updating Composer dependencies..........................✔ 
--> Building bootstrap file.................................✔ 
--> Updating Composer.......................................✔ 
--> Dumping an optimized autoloader.........................✔ 
--> Installing bundle's assets..............................✘ 
*** [err :: server.de] 
*** [err :: server.de] 
*** [err :: server.de] 
*** [err :: server.de] [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] 
*** [err :: server.de] You have requested a non-existent parameter "secret". 
*** [err :: server.de] 
*** [err :: server.de] 
*** [err :: server.de] 
*** [deploy:update_code] rolling back 
failed: "sh -c 'sh -c '\\''cd /var/www/server.de/releases/20130111092102 && php app/console assets:install web --env=prod'\\'''" on server.de 

我deploy.rb

set :application, "Testproject" 
set :domain,  "server.de" 
set :deploy_to, "/var/www/server.de/" 
set :app_path, "app" 
set :user,  "username" 
ssh_options[:forward_agent] = true 

set :repository, "file:///home/kai/webprojects/testproject/.git" 
set :scm,   :git 
set :deploy_via, :rsync_with_remote_cache 
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none` 

set :model_manager, "doctrine" 
# Or: `propel` 

role :web,  domain       # Your HTTP server, Apache/etc 
role :app,  domain       # This may be the same as your `Web` server 
role :db,   domain, :primary => true  # This is where Symfony2 migrations will run 

set :use_sudo,   false 

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

手動運行: PHP應用程序/控制檯資產:安裝網絡--env =督促沒有錯誤 工作

編輯: 由於來自PéCé的評論,因爲t他祕密參數: 這裏是我的應用程序/配置/ parameters.yml

parameters: 
    database_driver: pdo_mysql 
    database_host:  127.0.0.1 
    database_port:  ~ 
    database_name:  dbName 
    database_user:  dbName 
    database_password: secretPassword 

    mailer_transport: smtp 
    mailer_host:  localhost 
    mailer_user:  ~ 
    mailer_password: ~ 

    locale:   de 
    secret:   SomeSecret4465466 

    beryllium_cache.client.servers: { "localhost": 11211 } 

感謝您的想法

+0

我不知道Capifony但該消息告知沒有的參數「祕密」定義(密碼食鹽)中的應用程序/配置/ parameters.ini – AlterPHP

+0

是。感謝您指出了這一點。我忘了提及app/config/parameters.ini中的祕密參數已設置。我將編輯該問題。 – rechengehirn

+0

嗯。祕密參數是Symfony2的默認參數。但不知怎的,這個定義並不適用於我的情況......嗯。 – rechengehirn

回答

1

我找到了答案。它明確寫在capifony文檔中:

最後一步是配置你的app/config/parameters.yml文件。要做到這一點,最好的方法是在服務器上手動創建共享文件夾中的文件:

ssh your_deploy_server 
mkdir -p /var/www/my-app.com/shared/app/config 
vim /var/www/my-app.com/shared/app/config/parameters.yml 

一旦你的parameters.yml文件配置正確,你應該能夠測試部署的應用程序。在每個後續部署中,相同的app/config/parameters.yml文件將被鏈接到您的應用程序中,這意味着您只需在初始部署後進行配置。

那是:)