Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (52 sloc) 1.621 kb
# Used by the core Rakefile and the integration test suite.
# Each has a need to care about component paths, etc.
module CoreComponents
module_function
def root
@root ||= File.expand_path('../..', __FILE__)
end
def components
%w[cloud_controller dea health_manager router stager services/redis services/mysql services/mongodb services/postgresql services/neo4j]
end
def dirs
components.map {|subdir| File.join(root, subdir) }
end
# Changes to each directory in turn, and yields full $PWD to a block.
def in_each_dir
dirs.each do |dir|
Dir.chdir(dir) do
yield(dir)
end
end
end
def bundle_environment
env = "unset BUNDLE_GEMFILE;"
if ENV['BUNDLE_PATH']
env << "export BUNDLE_PATH=#{ENV['BUNDLE_PATH']};"
end
env
end
# Change to each 'core' directory with a Gemfile and run the specified command.
def for_each_gemfile(command, why = 'install')
command = "#{bundle_environment}#{command}"
# We show full command output when --trace is set.
tracing = Rake.application.options.trace
dirs.each do |full_path|
# Skip any components that do not include Gemfiles
next unless File.exist?(File.join(full_path, 'Gemfile'))
Dir.chdir(full_path) do
output = `#{command} 2>&1`
if $? == 0
unless tracing
output = "bundle #{why} successful for #{File.basename(full_path)}"
end
puts output
else
puts "FATAL: `#{command}` failed in #{full_path}"
exit 1
end
end
end
end
end
# vim: ts=2 sw=2 filetype=ruby
Jump to Line
Something went wrong with that request. Please try again.