updated Rakefile and .gitignore file

This commit is contained in:
Dan Bode 2011-05-26 18:48:00 -07:00
parent 845ba25967
commit 35933a2616
2 changed files with 15 additions and 6 deletions

6
.gitignore vendored
View File

@ -1 +1,7 @@
apt
mysql
gcc
rabbitmq
openstack
git
*.swp

View File

@ -3,23 +3,26 @@ remote_modules = [
'git@github.com:bodepd/puppetlabs-mysql.git' ,
'git@github.com:bodepd/puppetlabs-gcc.git',
'git@github.com:bodepd/puppetlabs-git.git',
'git@github.com:bodepd/puppetlabs-rabbitmq.git'
'git@github.com:bodepd/puppetlabs-rabbitmq.git',
'git@github.com:bodepd/puppet-openstack.git',
]
task :prepare do
ignore_add = []
puts 'Downloading remote packages'
puts 'Trying to download remote packages'
ignore_file = File.join(File.dirname(__FILE__), '.gitignore')
FileUtils.touch(ignore_file) unless File.exists?(ignore_file)
File.open(ignore_file, 'w') do |fh|
File.open(ignore_file, 'a') do |fh|
remote_modules.each do |mymodule|
puts `git clone #{mymodule}`
if mymodule =~ /.*?\/(\w+-(\w+))\.git$/
unless File.exists?($2)
puts `git clone #{mymodule}`
puts "mv #{$1} #{$2}"
FileUtils.mv($1, $2)
end
if File.read(ignore_file).grep(/#{mymodule}/).empty?
fh.puts($2)
end
puts "mv #{$1} #{$2}"
FileUtils.mv($1, $2)
else
raise ArgumentError, "Invalid module name #{mymodule}"
end