Skip to content

Commit

Permalink
allow skipping pr creation in version bump script
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvd committed Aug 6, 2020
1 parent 391d91b commit d9cfe65
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tools/release/bump_plugin_versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
require 'uri'
require 'fileutils'
require 'yaml'
require 'optparse'

options = {pr: true}
OptionParser.new do |opts|
opts.banner = "Usage: bump_plugin_versions.rb base_branch last_release allow_for --[no-]pr"

opts.on("--[no-]pr", "Create Pull Request") do |v|
options[:pr] = v
end
end.parse!

def compute_dependecy(version, allow_for)
gem_version = Gem::Version.new(version)
Expand Down Expand Up @@ -58,14 +68,12 @@ def compute_dependecy(version, allow_for)

IO.write("Gemfile.template", gemfile)

puts "Cleaning up before running 'rake artifact:tar'"
FileUtils.rm_f("Gemfile")
puts "Cleaning up before running computing dependencies"
FileUtils.rm_f("Gemfile.jruby-2.5.lock.release")
FileUtils.rm_rf("vendor")

# compute new lock file
puts "Running 'rake artifact:tar'"
result = `rake artifact:tar`
puts "Running: ./gradlew clean installDefaultGems"
`./gradlew clean installDefaultGems`

puts "Cleaning up generated lock file (removing injected requirements)"
# remove explicit requirements from lock file
Expand All @@ -84,6 +92,7 @@ def compute_dependecy(version, allow_for)

puts `git diff Gemfile.jruby-2.5.lock.release`

exit(0) unless options[:pr]
puts "Creating commit.."

branch_name = "update_lock_#{Time.now.to_i}"
Expand Down

0 comments on commit d9cfe65

Please sign in to comment.