Skip to content

Commit

Permalink
Bundle install in runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Bugno committed Nov 25, 2010
1 parent f2bea16 commit 1e85fb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks
4 changes: 3 additions & 1 deletion app/models/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def perform
stdout = ""
self.started_at = Time.now
stdout << Runner.execute("git clone #{project.vcs_source} #{self.build_dir} 2>&1")
stdout << Runner.execute("cd #{self.build_dir} && #{project.task} 2>&1")
Dir.chdir(self.build_dir) do
stdout << Runner.execute("bundle install && #{project.task} 2>&1")
end
status = $?.exitstatus
self.stdout = stdout
if status == 0
Expand Down
2 changes: 2 additions & 0 deletions extras/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def self.execute(command)
def self.with_clean_env(&blk)
old_env = ENV.clone
ENV.delete("BUNDLE_GEMFILE")
ENV["PWD"] = Dir.pwd
result = blk.call
ENV["BUNDLE_GEMFILE"] = old_env["BUNDLE_GEMFILE"]
ENV["PWD"] = old_env["PWD"]
result
end
end

0 comments on commit 1e85fb0

Please sign in to comment.