在经历了一系列错误后,我第一次尝试使用 Capistrano 进行部署,我发现这个我不明白。
此任务部署失败,deploy:assets:backup_manifest
这是失败后的结果;
INFO [e8ec3f64] Running /usr/bin/env cp /var/www/html/webapp/releases/20140102105308/public/assets/manifest*.json /var/www/html/webapp/releases/20140102105308/assets_manifest_backup.json on 208.68.39.56
DEBUG [e8ec3f64] Command: cd /var/www/html/webapp/releases/20140102105308 && /usr/bin/env cp /var/www/html/webapp/releases/20140102105308/public/assets/manifest*.json /var/www/html/webapp/releases/20140102105308/assets_manifest_backup.json
cap aborted!
cp stdout: Nothing written
cp stderr: Nothing written
任何想法如何去做。非常感谢..
Capfile 在这里;
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails/tree/master/assets
# https://github.com/capistrano/rails/tree/master/migrations
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
# require 'capistrano/rails'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
部署文件在这里;
#SSHKit.config.command_map[:rake] = "bundle exec rake"
set :application, 'webapp'
set :repo_url, 'git@bitbucket.org:xxxxxxxxxxxxxxxxxxxxx.git'
set :branch, 'new_look'
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :deploy_to, '/var/www/html/webapp'
set :scm, :git
set :format, :pretty
set :log_level, :debug
set :pty, true
set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
within release_path do
execute :rake, 'cache:clear'
end
end
end
after :finishing, 'deploy:cleanup'
end
只是补充; manifest.json 除了 manifest.yml 不会退出任何地方。谢谢