Skip to content

Commit

Permalink
(FM-6170) Addition of branch check for build number creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Helen Campbell committed May 8, 2017
1 parent 81803aa commit c151dd2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,18 @@ def max_thread_limit
end

sha = `git rev-parse HEAD`[0..7]
branch = `git branch`

# If we're in a CI environment include our build number
if build = ENV['BUILD_NUMBER'] || ENV['TRAVIS_BUILD_NUMBER']
new_version = sprintf('%s-%04d-%s', version, build, sha)
if branch.include? "* release"
new_version = sprintf('%s-%s%04d-%s', version, "r", build, sha)
else
new_version = sprintf('%s-%04d-%s', version, build, sha)
end
else
new_version = "#{version}-#{sha}"
end
end

print new_version
end
Expand Down

0 comments on commit c151dd2

Please sign in to comment.