summaryrefslogtreecommitdiff
path: root/lib/tasks/gems.rake
blob: e185d1ba9f170fccb97ecd8f687179267ef51246 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace :gem do

  engines = %w(core users certs help)
  version = File.read(File.expand_path("../../../version", __FILE__)).strip

  desc "run rake gem for all gems"
  task :build do
    engines.each do |gem_name|
      puts "########################### #{gem_name} #########################"
      cmd = "rm -rf #{gem_name}/pkg"; puts cmd; system cmd
      cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd
    end
    cmd = "rm -rf pkg"; puts cmd; system cmd
    cmd = "bundle exec rake gem"; puts cmd; system cmd
  end
  
  desc "run gem install for all gems"
  task :install do

    engines.each do |gem_name|
      puts "########################### #{gem_name} #########################"
      cmd = "rm #{gem_name}/pkg"; puts cmd; system cmd
      cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd
      cmd = "cd #{gem_name}/pkg && gem install leap_web_#{gem_name}-#{version}.gem"; puts cmd; system cmd
    end
    cmd = "rm -rf pkg"; puts cmd; system cmd
    cmd = "bundle exec rake gem"; puts cmd; system cmd
    cmd = "gem install pkg/leap_web-#{version}.gem"; puts cmd; system cmd
  end

  desc "Release all gems to gemcutter. Package leap web components, then push"
  task :release do

    engines.each do |gem_name|
      puts "########################### #{gem_name} #########################"
      cmd = "cd #{gem_name}/pkg && gem push leap_web_#{gem_name}-#{version}.gem"; puts cmd; system cmd
    end
    cmd = "gem push pkg/leap_web-#{version}.gem"; puts cmd; system cmd
  end
end