summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobb Kidd <robb@thekidds.org>2020-04-25 15:00:49 -0400
committerRobb Kidd <rkidd@chef.io>2020-04-28 11:50:00 -0400
commit42560ab8650f5534c603967cd7ad554b00e680b0 (patch)
treec543cd133d03ac1519e2b23e279694eab9c32bee
parent62b93bc099ee4ed5bf059620b9aad8b3341756b3 (diff)
downloadchef-42560ab8650f5534c603967cd7ad554b00e680b0.tar.gz
reorder gem installs and add a retry
Needed to install the gems-from-git-repos first. Those are the least likely to have missing dependencies. Then we move on to installing the gems that live in subdirectories of this repo. Sometimes that fails for non-obvious reasons, but a retry seems to succeed. Signed-off-by: Robb Kidd <robb@thekidds.org>
-rw-r--r--habitat/plan.ps114
1 files changed, 9 insertions, 5 deletions
diff --git a/habitat/plan.ps1 b/habitat/plan.ps1
index f1ec962a94..db7760d651 100644
--- a/habitat/plan.ps1
+++ b/habitat/plan.ps1
@@ -79,20 +79,24 @@ function Invoke-Build {
Write-BuildLine " ** Using bundler to retrieve the Ruby dependencies"
bundle install
if (-not $?) { throw "unable to install gem dependencies" }
- Write-BuildLine " ** Running the chef project's 'rake install' to install the path-based gems so they look like any other installed gem."
- bundle exec rake install # this needs to be 'bundle exec'd because a Rakefile makes reference to Bundler
- if (-not $?) { throw "unable to install the gems that live in directories within this repo" }
- Write-BuildLine " ** Also 'rake install' any gem sourced as a git reference."
+ Write-BuildLine " ** 'rake install' any gem sourced as a git reference so they'll look like regular gems."
foreach($git_gem in (Get-ChildItem "$env:GEM_HOME/bundler/gems")) {
try {
Push-Location $git_gem
- Write-BuildLine " -- and $git_gem too"
+ Write-BuildLine " -- installing $git_gem"
rake install # this needs to NOT be 'bundle exec'd else bundler complains about dev deps not being installed
if (-not $?) { throw "unable to install $git_gem as a plain old gem" }
} finally {
Pop-Location
}
}
+ Write-BuildLine " ** Running the chef project's 'rake install' to install the path-based gems so they look like any other installed gem."
+ bundle exec rake install # this needs to be 'bundle exec'd because a Rakefile makes reference to Bundler
+ if (-not $?) {
+ Write-Warning " -- That didn't work. Let's try again."
+ bundle exec rake install # this needs to be 'bundle exec'd because a Rakefile makes reference to Bundler
+ if (-not $?) { throw "unable to install the gems that live in directories within this repo" }
+ }
} finally {
Pop-Location
}