-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
69 lines (56 loc) · 1.61 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
#!/usr/bin/ruby -e
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'fileutils'
require 'rake'
require 'rake/clean'
require 'rubygems'
require 'rubygems/package_task'
require 'rspec/core/rake_task'
require 'tmpdir'
#Environment variables: http://docs.travis-ci.com/user/environment-variables/
PWD = File.dirname(__FILE__)
PKG_DIR = File.join(PWD, 'pkg')
NAME = 'authress-sdk'
begin
RSpec::Core::RakeTask.new(:spec)
task :default => [:info, :spec]
desc "Install new version of #{NAME} locally"
task :redeploy => [:uninstall, :repackage, :deploy]
task :after_build => [:display_repository, :publish_git_tag, :merge_downstream]
task :full_release => [:release, :publish_git_tag]
GEMSPEC = Gem::Specification.load(Dir['*.gemspec'].first)
Gem::PackageTask.new(GEMSPEC) {|pkg|}
task :info do
puts %x[ruby -v]
puts "gem version: #{%x[gem -v]}"
puts %x[bundle -v]
end
task :set_owner do
system("gem owner #{NAME} -a [email protected]")
end
task :uninstall do
Bundler.with_clean_env do
puts %x[gem uninstall -x #{NAME} -a]
end
end
task :deploy do
Bundler.with_unbundled_env do
#Create local gem repository for testing
Dir.chdir(PKG_DIR) do
FileUtils.rm_rf('gems')
gem = Dir["*.gem"].first
FileUtils.mkdir_p('gems')
FileUtils.cp(gem, 'gems')
%x[gem generate_index]
end
puts %x[gem install pkg/*.gem --no-ri --no-rdoc -u]
end
end
task :publish_git_tag do
puts %x[git tag #{GEMSPEC.version}]
puts %x[git push origin #{GEMSPEC.version}]
end
rescue LoadError
# no rspec available
end