summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-01-16 15:31:05 -0800
committerGitHub <noreply@github.com>2019-01-16 15:31:05 -0800
commit6630fc82eab8e892632ed042baed24d6ba7dd2dc (patch)
tree1bab5925cca951ce551e7482f065711240b5008b
parentc86f10dfb9c898874a58cff92804ef437e3e8e98 (diff)
parenta2898c7b12c4ee8219fcb11ee449bfa91018dbd6 (diff)
downloadchef-6630fc82eab8e892632ed042baed24d6ba7dd2dc.tar.gz
Merge pull request #8127 from chef/master_dep_update
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 a95ef794e9..4784a0b236 100644
--- a/.expeditor/update_dep.sh
+++ b/.expeditor/update_dep.sh
@@ -11,17 +11,26 @@
set -evx
+function new_gem_included() {
+ git diff | grep -E '^\+' | grep "${GEM_NAME} (${VERSION})"
+}
+
branch="expeditor/${GEM_NAME}_${VERSION}"
git checkout -b "$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 .