Skip to content

Commit

Permalink
updated Rakefile and .gitignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Bode committed May 27, 2011
1 parent 845ba25 commit 35933a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
apt
mysql
gcc
rabbitmq
openstack
git
*.swp
15 changes: 9 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@ remote_modules = [
'[email protected]:bodepd/puppetlabs-mysql.git' ,
'[email protected]:bodepd/puppetlabs-gcc.git',
'[email protected]:bodepd/puppetlabs-git.git',
'[email protected]:bodepd/puppetlabs-rabbitmq.git'
'[email protected]:bodepd/puppetlabs-rabbitmq.git',
'[email protected]: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
Expand Down

0 comments on commit 35933a2

Please sign in to comment.