-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCapfile
More file actions
executable file
·38 lines (30 loc) · 1.05 KB
/
Capfile
File metadata and controls
executable file
·38 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'dotenv'
#Dotenv.load
Dotenv.load(
File.expand_path("../.env.#{ENV['RUBBER_ENV']}", __FILE__),
File.expand_path("../.env", __FILE__))
gemfile = File.expand_path(File.join(__FILE__, '..', 'Gemfile'))
if File.exist?(gemfile) && ENV['BUNDLE_GEMFILE'].nil?
puts "Respawning with 'bundle exec'"
exec("bundle", "exec", "cap", *ARGV)
end
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
env = ENV['RUBBER_ENV'] ||= (ENV['RAILS_ENV'] || 'production')
# env = ARGV.shift
# # Default to vagrant if not provided
# stages = %w( staging production )
# default_stage = 'staging'
# unless stages.include?(env)
# # using default stage, put that argument back
# ARGV.unshift(env)
# env = default_stage
# end
# ENV['RUBBER_ENV'] = ENV['RAILS_ENV'] = env
root = File.dirname(__FILE__)
# this tries first as a rails plugin then as a gem
$:.unshift "#{root}/vendor/plugins/rubber/lib/"
require 'rubber'
Rubber::initialize(root, env)
require 'rubber/capistrano'
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'