This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dbloete
committed
Sep 10, 2010
1 parent
1a4cc31
commit fc4733e
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Vlad task for Bundler. | ||
# | ||
# Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and | ||
# Bundler will be activated after each new deployment. | ||
|
||
namespace :vlad do | ||
namespace :bundle do | ||
desc <<-DESC | ||
Install the current Bundler environment. By default, gems will be \ | ||
installed to the shared/bundle path. Gems in the development and \ | ||
test group will not be installed. The install command is executed \ | ||
with the --deployment and --quiet flags. You can override any of \ | ||
these defaults by setting the variables shown below. If Vlad \ | ||
can not find the 'bundle' cmd then you can override the bundle_cmd \ | ||
variable to specifiy which one it should use. | ||
set :bundle_gemfile, "Gemfile" | ||
set :bundle_dir, File.join(shared_path, 'bundle') | ||
set :bundle_flags, "--deployment --quiet" | ||
set :bundle_without, [:development, :test] | ||
set :bundle_cmd, "bundle" # e.g. change to "/opt/ruby/bin/bundle" | ||
DESC | ||
remote_task :install, :roles => :app do | ||
bundle_dir = Rake::RemoteTask.fetch(:bundle_dir, File.join(shared_path, 'bundle')) | ||
bundle_without = [*Rake::RemoteTask.fetch(:bundle_without, [:development, :test])].compact | ||
bundle_flags = Rake::RemoteTask.fetch(:bundle_flags, "--deployment --quiet") | ||
bundle_gemfile = Rake::RemoteTask.fetch(:bundle_gemfile, "Gemfile") | ||
bundle_cmd = Rake::RemoteTask.fetch(:bundle_cmd, "bundle") | ||
|
||
args = ["--gemfile #{File.join(current_release, bundle_gemfile)}"] | ||
args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty? | ||
args << bundle_flags.to_s | ||
args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty? | ||
|
||
run "#{bundle_cmd} install #{args.join(' ')}" | ||
end | ||
end | ||
end |