我正在尝试将 Capifony 配置为部署到我的远程服务器。我想知道的是我的uploads
目录是否应该在.gitignore 中?运行时cap development depoy
出现符号链接错误:
executing "ln -nfs /var/www/dev.xyz.co.uk/shared/web/uploads /var/www/dev.xyz.co.uk/releases/20130313103147/web/uploads"
*** [err :: x.xx.xx.xxx] ln:
*** [err :: x.xx.xx.xxx] failed to create symbolic link `/var/www/dev.xyz.co.uk/releases/20130313103147/web/uploads'
*** [err :: x.xx.xx.xxx] : No such file or directory
*** [err :: x.xx.xx.xxx]
这是因为/web/uploads
它在 .gitignore 中,所以它永远不会从 git 中拉出来以进行符号链接?
我需要先在远程服务器上克隆我的存储库还是 Capifony 为我这样做?
deploy.rb 下面:
set :stage_dir, 'app/config/deploy' # needed for Symfony2 only
set :stages, %w(production staging development)
require 'capistrano/ext/multistage'
set :application, "xyz.co.uk"
set :user, "root" # The server's user for deploys
set :scm, :git
set :repository, "git@github.com:test/#{application}.git"
set :keep_releases, 3
set :use_sudo, false
set :shared_files, ["app/config/parameters.yml"]
set :shared_children, [app_path + "/logs", web_path + "/uploads", "vendor"]
set :use_composer, true
set :update_vendors, true
set :dump_assetic_assets, true
set :deploy_via, :copy
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, "dev"