Skip to content

Commit f98e4a5

Browse files
authored
Merge pull request #151 from block/myron/commit-gemfile-lock-when-releasing
Commit an update to `Gemfile.lock` when bumping the version.
2 parents 92988d8 + 0a2cd26 commit f98e4a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

config/release/Rakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# That's why we get the project root from git instead of using `__dir__`.
1111
project_root = `git rev-parse --show-toplevel`.strip
1212

13+
require "bundler"
1314
require "gem/release"
1415
require "#{project_root}/elasticgraph-support/lib/elastic_graph/version"
1516
require "#{project_root}/script/list_eg_gems"
@@ -19,6 +20,13 @@ task :bump_version, [:version] do |_, args|
1920
version = args.fetch(:version)
2021
::Dir.chdir(project_root) do
2122
sh "bundle exec gem bump elasticgraph-support --file #{project_root}/elasticgraph-support/lib/elastic_graph/version.rb -v #{version} -m 'Release v#{version}.'"
23+
24+
# We also want to commit an update to `Gemfile.lock` as part of the version bump.
25+
::Bundler.with_unbundled_env do
26+
sh "bundle install"
27+
sh "git add Gemfile.lock"
28+
sh "git commit --amend --no-edit"
29+
end
2230
end
2331
end
2432

0 commit comments

Comments
 (0)