forked from telcat/vagrant-proxmox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (53 loc) · 1.66 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
require 'rake'
require 'rake/clean'
require 'rubygems'
require 'bundler/setup'
require 'rubygems/gem_runner'
require 'rspec/core/rake_task'
require 'geminabox_client'
require 'yaml'
gemspec = eval(File.read 'vagrant-proxmox.gemspec')
desc 'Build the project'
task :build do
Gem::GemRunner.new.run ['build', "#{gemspec.name}.gemspec"]
end
RSpec::Core::RakeTask.new
desc 'Run RSpec code examples with coverage'
RSpec::Core::RakeTask.new('spec_coverage') do |_|
ENV['RUN_WITH_COVERAGE'] = 'true'
end
task :release_local do
rake_config = YAML::load(File.read("#{ENV['HOME']}/.rake/rake.yml")) rescue {}
GeminaboxClient.new(rake_config['geminabox']['url']).push "#{gemspec.name}-#{gemspec.version}.gem", overwrite: true
puts "Gem #{gemspec.name} pushed to #{rake_config['geminabox']['url']}"
end
task :release_rubygems do
`gem push "#{gemspec.name}-#{gemspec.version}.gem"`
end
task release_all: [:release_local, :release_rubygems]
namespace :jenkins do
task job: [:build, :spec_coverage, :release_all]
end
namespace :test do
desc 'Run all tests (enable coverage with COVERAGE=y)'
task :all do
Rake::Task['test:rspec'].invoke
Rake::Task['test:cucumber'].invoke
end
desc 'Run all rspec tests (enable coverage with COVERAGE=y)'
task :rspec do
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:_specs) do |task|
task.verbose = false
end
Rake::Task['_specs'].invoke
end
desc 'Run all cucumber tests (enable coverage with COVERAGE=y)'
task :cucumber do
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:_features) do |task|
task.cucumber_opts = '--quiet --format progress --require features features'
end
Rake::Task['_features'].invoke
end
end