Skip to content

Commit 81a579a

Browse files
authored
Merge pull request #30 from OpenVoxProject/8_14_0
8.14.0
2 parents 20fd636 + 99c0515 commit 81a579a

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

Rakefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ require 'rake'
55
require 'rubygems'
66
require 'rubygems/package_task'
77

8+
def run_command(cmd)
9+
output, status = Open3.capture2e(cmd)
10+
abort "Command failed! Command: #{cmd}, Output: #{output}" unless status.exitstatus.zero?
11+
output.chomp
12+
end
13+
14+
Dir.glob(File.join('tasks/**/*.rake')).each { |file| load file }
15+
16+
### Puppetlabs stuff ###
17+
818
if Rake.application.top_level_tasks.grep(/^(pl:|package:)/).any?
919
begin
1020
require 'packaging'

lib/puppet/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Raketasks and such to set the version based on the output of `git describe`
99

1010
module Puppet
11-
PUPPETVERSION = '8.13.0'
11+
PUPPETVERSION = '8.14.0'
1212

1313
##
1414
# version is a public API method intended to always provide a fast and

puppet.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = "openvox"
3-
spec.version = "8.13.0"
3+
spec.version = "8.14.0"
44
spec.licenses = ['Apache-2.0']
55

66
spec.required_rubygems_version = Gem::Requirement.new("> 1.3.1")

tasks/tag.rake

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
namespace :vox do
2+
desc 'Update version, create tag, and push to origin'
3+
task :tag, [:tag] do |_, args|
4+
abort 'You must provide a tag.' if args[:tag].nil? || args[:tag].empty?
5+
version = args[:tag]
6+
abort "#{version} does not appear to be a valid version string in x.y.z format" unless Gem::Version.correct?(version)
7+
8+
# Update lib/puppet/version.rb and puppet.gemspec
9+
puts "Setting version to #{version}"
10+
data = File.read('lib/puppet/version.rb')
11+
data = data.sub(/PUPPETVERSION = '\d+\.\d+\.\d+'/, "PUPPETVERSION = '#{version}'")
12+
File.write('lib/puppet/version.rb', data)
13+
data = File.read('puppet.gemspec')
14+
data = data.sub(/spec.version = "\d+\.\d+\.\d+"/, "spec.version = \"#{version}\"")
15+
File.write('puppet.gemspec', data)
16+
run_command("git add lib/puppet/version.rb && git add puppet.gemspec && git commit -m 'Set version to #{version}'", true)
17+
18+
# Run git command to get short SHA and one line description of the commit on HEAD
19+
branch = run_command('git rev-parse --abbrev-ref HEAD', true)
20+
sha = run_command('git rev-parse --short HEAD', true)
21+
msg = run_command('git log -n 1 --pretty=%B', true)
22+
23+
puts "Branch: #{branch}"
24+
puts "SHA: #{sha}"
25+
puts "Commit: #{msg}"
26+
27+
run_command("git tag -a #{version} -m '#{version}'")
28+
29+
unless !ENV['NOPUSH'].nil?
30+
puts "Pushing to origin"
31+
run_command("git push origin && git push origin #{version}")
32+
end
33+
end
34+
end

0 commit comments

Comments
 (0)