summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Duffield <tom@chef.io>2017-08-14 10:35:50 -0500
committerTom Duffield <tom@chef.io>2017-08-14 10:35:50 -0500
commitde3cb594e5af462c163a7eb0c5b717e7648f990b (patch)
tree2fbe514845cb21c029c403f2e9f0c11b8bbe3710
parent7f8d62878ba4b55a4be30dbce44001709f319a90 (diff)
downloadchef-tduffield/work-around-bug.tar.gz
Fix up update_version to work around bundler bugtduffield/work-around-bug
Signed-off-by: Tom Duffield <tom@chef.io>
-rwxr-xr-x.expeditor/update_version.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/.expeditor/update_version.sh b/.expeditor/update_version.sh
index f8d0c8d92b..a4036cf648 100755
--- a/.expeditor/update_version.sh
+++ b/.expeditor/update_version.sh
@@ -7,10 +7,15 @@
set -evx
sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" chef-config/lib/chef-config/version.rb
-sed -i -r "s/VersionString\.new\(\".+\"\)/VersionString.new(\"$(cat VERSION)\")/" lib/chef/version.rb
+sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" lib/chef/version.rb
-# Update the version inside Gemfile.lock
-bundle lock --update chef chef-config
+# There is a bug (https://github.com/bundler/bundler/issues/5644) that is preventing
+# us from updating the chef-dk gem via `bundle update` or `bundle lock --update`.
+# Until that is addressed, let's replace the version using sed.
+sed -i -r "s/chef\s\([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\)$/chef \($(cat VERSION)\)/" Gemfile.lock
+sed -i -r "s/chef\s\([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\-(.+)\)$/chef \($(cat VERSION)-\1\)/" Gemfile.lock
+sed -i -r "s/chef-config\s\([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\)$/chef-config \($(cat VERSION)\)/" Gemfile.lock
+sed -i -r "s/chef-config\s\(= [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\)$/chef-config \(= $(cat VERSION)\)/" Gemfile.lock
# Once Expeditor finshes executing this script, it will commit the changes and push
# the commit as a new tag corresponding to the value in the VERSION file.