Symfony2 + Capifony - 本地PC上的资产转储

时间:2015-01-20 22:03:33

标签: symfony coffeescript less capistrano capifony

我对assetic:dump有疑问。我使用组合css / less文件和js / coffeescript文件。我需要运行assetic:dump而不是执行cap deploy,因为目标服务器尚未安装节点js和coffeescript。如果我在deploy.rb中使用set :dump_assetic_assets, true,则capifony在目标服务器上部署后运行assetic:dump。它在编译coffeescript期间抛出错误。

我不知道如何解决这个问题。我认为为我的项目选择Symfony 2是错误的。所有的发展都是一些问题。我认为部署是基础的东西,但是Symfony 2中的问题很大。

#1更新

set :application, "project"
set :domain,      "10.0.0.61"
set :deploy_to,   "/var/www/html/project"
set :app_path,    "app"
set :user,        "kunesd"

#ssh_options[:forward_agent] = true
#ssh_options[:port] = "22"
set :branch, "master"

# set :symfony_env_prod, "dev"

set   :scm,           :git
set   :repository,    "d:\\Prace\\Project\\web\\os-project\\"
set   :deploy_via,    :copy
# 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, :primary => true       # This may be the same as your `Web` server

# Composer settings
# set :use_composer, true
#set :use_composer_tmp, true
# set :update_vendors, false
#set :vendors_mode, "install"

# General settings
#set :shared_files,    ["app/config/parameters.yml"]
#set :shared_children, [app_path + "/logs", web_path + "/uploads"]
set :keep_releases,  3
set :use_sudo, false
#set :writable_dirs,     [app_path + "/logs", app_path + "/cache", web_path + "/uploads"]
#set :webserver_user,    "www-data"
#set :permission_method, :acl
#set :use_set_permissions, true

# Be more verbose by uncommenting the following line
 logger.level = Logger::TRACE

感谢您的回答。

1 个答案:

答案 0 :(得分:0)

我认为你有两个选择:

  1. 为capifony创建一个自定义任务,该任务将在部署命令
  2. 之前执行
  3. 创建本地脚本,首先运行资产转储任务,然后运行capifony standard命令。