在docs page上,提到您可以在远程服务器上的parameters.yml
文件夹中创建应用的shared/app/config/
文件。然后,Capifony应将此文件符号链接为真实的parameters.yml
文件。
但是,当我运行部署时,在我的部署机器上输出以下内容(详细):
--> Updating Composer dependencies
* executing "sh -c 'cd /var/www/app-stage/releases/20140219212733 && SYMFONY_ENV=prod php composer.phar update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress'"
servers: ["stage-server"]
[stage-server] executing command
** [out :: stage-server] Loading composer repositories with package information
** [out :: stage-server] Updating dependencies
** [out :: stage-server] Nothing to install or update
** [out :: stage-server] Writing lock file
** [out :: stage-server] Generating optimized autoload files
** [out :: stage-server] Creating the "app/config/parameters.yml" file
** [out :: stage-server] Clearing the cache for the prod environment with debug false
** [out :: stage-server] Installing assets using the hard copy option
** [out :: stage-server] Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
** [out :: stage-server] Installing assets for Pucs\KioskBundle into web/bundles/pucskiosk
** [out :: stage-server] Installing assets for FOS\JsRoutingBundle into web/bundles/fosjsrouting
似乎在运行composer update时,它会生成一个新的parameters.yml文件。但是Capifony永远不会删除它和符号链接。
为什么在parameters.yml文件中没有Capifony符号链接?除了在共享目录中创建文件之外,我还需要其他步骤吗?也许在我的deploy.rb
文件中明确添加符号链接?
staging.rb
的一些设置)set :stages, %w(production staging)
set :default_stage, "staging"
set :stage_dir, "app/config/deploy"
require 'capistrano/ext/multistage'
set :application, "kiosk"
set :app_path, "app"
set :repository, "***"
set :scm, :git
set :deploy_via, :remote_cache
set :model_manager, "doctrine"
set :use_sudo, false
set :use_composer, true
set :update_vendors, true
set :copy_vendors, true
set :keep_releases, 3
after "deploy" do
run "cd #{deploy_to}/current && php app/console cache:clear --env=prod"
run "cd #{deploy_to}/current && php app/console assetic:dump --env=prod"
end
# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL
答案 0 :(得分:2)
您应该阅读文档;)http://capifony.org/#symfony2_deployment
您错过了:shared_files
个参数。
set :shared_files, ["app/config/parameters.yml"]