forked from Cimpress-MCP/LambdaWrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile.rb
59 lines (48 loc) · 1.17 KB
/
rakefile.rb
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
require 'rake'
require 'rake/clean'
require 'bundler/setup'
require 'rubygems/package_task'
require_relative 'version'
STDOUT.sync = true
STDERR.sync = true
NAME = 'lambda_wrap'.freeze
desc 'Clean'
task :clean do
Dir.glob('*.gem').each do |f|
puts "Deleting file #{f}"
File.delete(f)
end
end
desc 'Creates the ruby gem'
task create: [:clean] do
puts "Creating gem with version #{VERSION}"
puts `gem build lambda_wrap.gemspec`
end
task test: :rubocop
task :rubocop do
`rubocop`
end
desc 'Uninstalls the gem'
task :uninstall do
puts "Uninstalling gem #{NAME}"
puts `gem uninstall #{NAME} --all`
end
desc 'Installs the gem from the local source'
task installlocal: [:uninstall, :create, :test] do
gemfile = Dir.glob('*.gem').first
puts `gem install #{gemfile}`
end
desc 'Installs the ruby gem from rubygems'
task :install do
puts `gem install #{NAME}`
end
desc 'Publishes the ruby gem'
task publish: [:create, :test] do
if VERSION.to_s == '0.0.0'
raise 'Not allowed publishing the gem if version is 0.0.0.'\
'Are you on a release branch?'
end
gemfile = Dir.glob('*.gem').first
puts "Publishing gem #{gemfile}"
puts `gem push #{gemfile}`
end