I've an application that only being ran as a cron job. I'm using the whenever gem to maintain and deploy my cron jobs.
This is a my current deploy script.
require "bundler/capistrano"
require "whenever/capistrano"
set :application, "my-app"
set :domain, "example.com"
set :bundle_runner, "bundle exec"
# Git
set :scm, :git
set :repository, "git@bitbucket.org:username/my-app.rb.git"
set :branch, "master"
# Config
role :app, "example.com"
set :deploy_to, "/opt/apps/#{application}"
set :deploy_via, :remote_cache
set :keep_releases, 5
set :git_enable_submodules, 1
set :git_shallow_clone, 1
# User
set :user, "webmaster"
set :use_sudo, false
# SSH
ssh_options[:paranoid] = false
ssh_options[:forward_agent] = true
set :bundle_cmd, "bundle"
set :bundle_without, [:test, :development]
set :bundle_flags, "--deployment --without=development,test"
set :whenever_command, "#{bundle_cmd} exec whenever"
namespace :deploy do
task :restart, roles: [:app] do
whenever.update_crontab
end
end
The problem is that I'm getting this error during deploy.
* executing "cd -- /opt/apps/my-app/releases/20130224004202 && bbundle2 exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile && cp -- /opt/apps/my-app/shared/assets/manifest.yml /opt/apps/my-app/releases/20130224004202/assets_manifest.yml"
servers: ["example.com"]
[example.com] executing command
*** [err :: example.com] rake aborted!
*** [err :: example.com] No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
*** [err :: example.com]
*** [err :: example.com] (See full trace by running task with --trace)
command finished in 802ms
*** [deploy:update_code] rolling back
* executing "rm -rf /opt/apps/my-app/releases/20130224004202; true"
servers: ["example.com"]
[example.com] executing command
command finished in 111ms
It looks like Capistrano thinks that this is an rails application, which is not.
Is there a way to only do the following when running cap deploy
- Download source code from remote repository.
- Update the
current
folder. - Update crontabs using whenever.