forked from voxpupuli/puppet-blacksmith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
43 lines (36 loc) · 1.01 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
require 'rake'
require 'rake/clean'
require 'rubygems'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'cucumber'
require 'cucumber/rake/task'
require 'fileutils'
CLEAN.include("pkg/", "tmp/")
CLOBBER.include("Gemfile.lock")
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
require 'puppet_blacksmith/version'
task :default => [:clean, :spec, :cucumber, :build]
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = "--tag ~live"
end
Cucumber::Rake::Task.new(:cucumber) do |t|
require 'puppet/version'
if Gem::Version.new(Puppet.version) < Gem::Version.new("3.6.0")
t.cucumber_opts = "--tags ~@metadatajson"
end
end
task :bump do
v = Gem::Version.new("#{Blacksmith::VERSION}.0")
fail("Unable to increase prerelease version #{Blacksmith::VERSION}") if v.prerelease?
s = <<-EOS
module Blacksmith
VERSION = #{v.bump.to_s}
end
EOS
File.open("lib/puppet_blacksmith/version.rb", "w") do |file|
file.print s
end
sh "git add version"
sh "git commit -m 'Bump version'"
end