forked from pakyow/pakyow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
84 lines (70 loc) · 1.6 KB
/
Rakefile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version = File.read(File.expand_path("../VERSION", __FILE__)).strip
libs = %i[
pakyow-support
pakyow-core
pakyow-presenter
pakyow-mailer
pakyow-rake
pakyow-test
pakyow-realtime
pakyow-ui
]
rspec_libs = %i[
pakyow-support
pakyow-core
pakyow-presenter
pakyow-mailer
pakyow-test
pakyow-realtime
pakyow-ui
]
task :ci do
errors = []
rspec_libs.each do |lib|
system(%(cd #{lib} && bundle exec rspec)) || errors << lib
end
fail("Errors in #{errors.join(', ')}") unless errors.empty?
end
namespace :release do
desc 'Remove the gems'
task :clean do
system "rm *.gem"
end
desc 'Create the gems'
task :build => [:clean] do
system 'gem build pakyow.gemspec'
libs.each do |lib|
puts
system "gem build #{lib}/#{lib}.gemspec"
end
end
desc 'Create and install the gems'
task :install => [:build] do
system "gem install pakyow-#{version}.gem"
end
desc 'Create and publish the gems'
task :publish => [:build] do
puts
puts "\033[31mAre you sure you want to publish ze gems? There's no going back!"
puts "Enter the current version number to continue...\033[0m"
puts
input = STDIN.gets.chomp
puts
if input == version
gems = libs.map { |lib| "#{lib}-#{version}.gem"}
# add pakyow last
gems << "pakyow-#{version}.gem"
# push!
gems.each do |file|
puts "Pushing #{file}"
system "gem push #{file}"
end
else
puts "Aborting"
end
end
desc 'Create a tag for the current version'
task :tag do
`git tag -a v#{version} -m 'Pakyow #{version}'`
end
end