Reputation: 7279
I'm trying to deploy an app with Mina, but I'm getting this error:
-----> Skipping asset precompilation
$ cp -R "/home/deploy/integracao/current/public/assets" "./public/assets"
cp: cannot create directory ‘./public/assets’: No such file or directory
! ERROR: Deploy failed.
The first time I deployed, everything worked fine. On the second pass (and so on) I'm seeing the error above.
This is my deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
set :domain, '192.168.0.87'
set :deploy_to, '/home/deploy/integracao'
set :repository, 'https://github.com...'
set :branch, 'master'
set :rails_env, 'production'
set :shared_paths, ['config/database.yml', 'log', 'config/application.yml']
set :user, 'deploy' # Username in the server to SSH to.
task :environment do
# If you're using rbenv, use this to load the rbenv environment.
# Be sure to commit your .rbenv-version to your repository.
invoke :'rbenv:load'
# For those using RVM, use this to load an RVM version@gemset.
# invoke :'rvm:use[ruby-1.9.3-p125@default]'
end
# Put any custom mkdir's in here for when `mina setup` is ran.
# For Rails apps, we'll make some of the shared paths that are shared between
# all releases.
task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/shared/log"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]
queue! %[mkdir -p "#{deploy_to}/shared/config"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]
queue! %[touch "#{deploy_to}/shared/config/database.yml"]
queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."]
end
desc "Deploys the current version to the server."
task :deploy => :environment do
deploy do
# Put things that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
to :launch do
queue "touch #{deploy_to}/tmp/restart.txt"
end
end
end
Upvotes: 0
Views: 1168
Reputation: 7279
I've just changed to invoke :'rails:assets_precompile:force'
inside the deploy task and got it working
Upvotes: 4