问题描述
我需要了解capistrano为什么不创建当前文件夹。我正在使用以下命令:cap deploy:setup,cap deploy:check,cap deploy
I need to understand why capistrano doesn't create the folder current. I'm using the following command : cap deploy:setup, cap deploy:check, cap deploy
但是当我检查应用程序目录时,我不是当前文件夹。
But when i check in my app directory, i don't current folder.
这是我的deploy.rb
This my deploy.rb
# Execute "bundle install" after deploy, but only when really needed
require 'bundler/capistrano'
# Automatically precompile assets
load "deploy/assets"
# RVM integration
require "rvm/capistrano"
# Application name
set :application, "app"
# Application environment
set :rails_env, :production
# Deploy username and sudo username
set :user, "ubuntu"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
#We don't want to use sudo (root) - for security reasons
set :use_sudo, false
#Target ruby version
set :rvm_ruby_string, '1.9.3-p374'
#System-wide RVM installation
set :rvm_type, :user
#We use sudo (root) for system-wide RVM installation
set :rvm_install_with_sudo, true
#git is our SCM
set :scm, :git
#Use github repository
set :repository, "[email protected]:.../CM.git"
#master is our default git branch
set :branch, "master"
#Deploy via github
set :deploy_to, "/var/www/app/#{application}"
set :deploy_via, :remote_cache
#We have all components of the app on the same server
server "125.156.125.125", :app, :web, :db, :primary => true
namespace :deploy do
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
task :symlink_shared do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
end
task :assets do
system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:# {shared_path}/"
end
end
after 'deploy:update_code', 'deploy:symlink_shared'
$ b之后$ b
如果有人可以帮助我,我不知道错误在哪里?
谢谢
I don't understand where is the error, if someone can i help me ?Thanks you
推荐答案
Capistrano创建一个当前的符号链接(不是目录),作为部署周期的最后一步之一,通常就在向应用服务器发送启动/重启命令之前。它无法在部署之前创建该符号链接,因为没有要符号链接的内容( / releases
中没有检出)。
Capistrano creates a current symlink (not directory) as one of the last steps in it's deployment cycle, generally right before the application server gets sent a start/restart command. It cannot create that symlink before deploying as there is nothing to symlink to (no checkouts in /releases
).
如果仍然没有创建符号链接,请检查您的capistrano部署日志中是否有错误,如果出现错误,它将不会创建符号链接,然后再进行创建。如果有错误,请在您的问题中发布。
If it's still not creating the symlink, check your capistrano deploy logs for an error, it won't create the symlink if it has an error before making it to that point. And if there is an error, please post it in your question.
这篇关于缺少当前文件夹Capistrano Rails 3.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!