Skip to content

Instantly share code, notes, and snippets.

@oleander

oleander/Capfile Secret

Last active December 14, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleander/7c12888132885a7f06db to your computer and use it in GitHub Desktop.
Save oleander/7c12888132885a7f06db to your computer and use it in GitHub Desktop.
load "deploy"
load "config/deploy"
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:user/my-app.git"
set :branch, "master"
# Config
role :app, domain
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 :normalize_asset_timestamps, false
namespace :whenever do
desc "Update the crontab file"
task :update_crontab, roles: :app do
run "cd #{release_path} && #{bundle_runner} whenever --update-crontab #{application}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment