summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-01-16 15:31:13 -0800
committerGitHub <noreply@github.com>2019-01-16 15:31:13 -0800
commita3a03b7ff745a83517638958b16e5158c0fbfc0a (patch)
treeae4739ae4f92e8ec0476f9aec478aff5effc6e16
parentb2fe2edccb34a992306de7bd264619eba732d5f4 (diff)
parent5ec7f47ea75b563fc40a2ef297a4191318f7c254 (diff)
downloadchef-a3a03b7ff745a83517638958b16e5158c0fbfc0a.tar.gz
Merge pull request #8126 from chef/updating_gems
Chef 14: Pull in the gem update retry logic from DK
-rw-r--r--.expeditor/update_dep.sh21
1 files changed, 15 insertions, 6 deletions
diff --git a/.expeditor/update_dep.sh b/.expeditor/update_dep.sh
index 6114e71b73..5b7029525c 100644
--- a/.expeditor/update_dep.sh
+++ b/.expeditor/update_dep.sh
@@ -11,6 +11,10 @@
set -evx
+function new_gem_included() {
+ git diff | grep -E '^\+' | grep "${GEM_NAME} (${VERSION})"
+}
+
release_branch="chef-14"
new_branch="expeditor/${GEM_NAME}_${VERSION}"
git checkout "$release_branch"
@@ -18,12 +22,17 @@ git checkout -b "$new_branch"
bundle install
-# it appears that the gem that triggers this script fires off this script before
-# the gem is actually available via bundler on rubygems.org.
-sleep 240
-
-gem install rake
-rake dependencies:update_gemfile_lock
+tries=12
+for (( i=1; i<=$tries; i+=1 )); do
+ bundle exec rake dependencies:update_gemfile_lock
+ new_gem_included && break || sleep 20
+ if [ $i -eq $tries ]; then
+ echo "Searching for '${GEM_NAME} (${VERSION})' ${i} times and did not find it"
+ exit 1
+ else
+ echo "Searched ${i} times for '${GEM_NAME} (${VERSION})'"
+ fi
+done
git add .