-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure bundle install for pact_broker:dev:setup uses correct Gem…
…file Closes: #243
- Loading branch information
Showing
1 changed file
with
12 additions
and
3 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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
|
||
desc 'Set up a dev instance of the Pact Broker' | ||
task 'pact_broker:dev:setup' do | ||
puts "Copying example directory" | ||
FileUtils.cp_r 'example', 'dev' | ||
gemfile_contents = File.read('dev/Gemfile') | ||
|
||
|
||
puts "Changing source of pact_broker gem from rubygems.org to local file system" | ||
new_gemfile_contents = gemfile_contents.gsub(/^.*gem.*pact_broker.*$/, "gem 'pact_broker', path: '../'") | ||
File.open('dev/Gemfile', "w") { |file| file << new_gemfile_contents } | ||
bundle_install = "BUNDLE_GEMFILE=dev/Gemfile bundle install" | ||
puts bundle_install | ||
puts `#{bundle_install}` | ||
|
||
Dir.chdir("dev") do | ||
Bundler.with_clean_env do | ||
puts "Executing bundle install" | ||
puts `bundle install` | ||
end | ||
end | ||
end |