diff options
author | tpowell-progress <104777878+tpowell-progress@users.noreply.github.com> | 2022-10-24 14:22:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 14:22:55 -0400 |
commit | 6aa6efa303ebca8f35802614a1bba09f52eaf2ca (patch) | |
tree | dac677dc149877f10b268578ec42647238beb072 | |
parent | bb0071c0420b45f0b9297286b488dde2d80c5ff4 (diff) | |
download | chef-6aa6efa303ebca8f35802614a1bba09f52eaf2ca.tar.gz |
INFC-321 Uncomment "Upgrade Chef/Ohai Appbundler" build stage in kitchen tests (#13286)
* Uncomment build stage in kitchen
* Only retrieve the first ansidecl.h if multiple
* Commenting on why I'm going with [0]th ansidecl.h
Signed-off-by: Thomas Powell <powell@progress.com>
-rw-r--r-- | .github/workflows/kitchen.yml | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml index 7296703467..7844ebe111 100644 --- a/.github/workflows/kitchen.yml +++ b/.github/workflows/kitchen.yml @@ -71,28 +71,35 @@ jobs: ohai -v rake --version bundle -v - # - name: 'Upgrade Chef/Ohai via Appbundler' - # id: upgrade - # run: | - # $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH - # $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) + - name: 'Upgrade Chef/Ohai via Appbundler' + id: upgrade + run: | + $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) + + # The chef-client installer does not put the file 'ansidecl.h' down in the correct location + # This leads to failures during testing. Moving that file to its correct position here. + # Another example of 'bad' that needs to be corrected + $output = gci -path C:\opscode\ -file ansidecl.h -Recurse + + # As of Ruby 3.1, there are 3 ansidecl.h files found in the opscode path + # Grabbing the first (and shortest) path found is a bit of a :fingers-crossed: but + # making the leap that ansidecl.h isn't going to vary in a way that will fail + # subtly. + if ($output -is [Array]) { $output = $output[0] } - # # The chef-client installer does not put the file 'ansidecl.h' down in the correct location - # # This leads to failures during testing. Moving that file to its correct position here. - # # Another example of 'bad' that needs to be corrected - # $output = gci -path C:\opscode\ -file ansidecl.h -Recurse - # $target_path = $($output.Directory.Parent.FullName + "\x86_64-w64-mingw32\include") - # Move-Item -Path $output.FullName -Destination $target_path + $target_path = $($output.Directory.Parent.FullName + "\x86_64-w64-mingw32\include") + Move-Item -Path $output.FullName -Destination $target_path - # gem install appbundler appbundle-updater --no-doc - # If ($lastexitcode -ne 0) { Exit $lastexitcode } - # appbundle-updater chef chef $env:GITHUB_SHA --tarball --github $env:GITHUB_REPOSITORY - # If ($lastexitcode -ne 0) { Exit $lastexitcode } - # Write-Output "Installed Chef / Ohai release:" - # chef-client -v - # If ($lastexitcode -ne 0) { Exit $lastexitcode } - # ohai -v - # If ($lastexitcode -ne 0) { Exit $lastexitcode } + gem install appbundler appbundle-updater --no-doc + If ($lastexitcode -ne 0) { Exit $lastexitcode } + appbundle-updater chef chef $env:GITHUB_SHA --tarball --github $env:GITHUB_REPOSITORY + If ($lastexitcode -ne 0) { Exit $lastexitcode } + Write-Output "Installed Chef / Ohai release:" + chef-client -v + If ($lastexitcode -ne 0) { Exit $lastexitcode } + ohai -v + If ($lastexitcode -ne 0) { Exit $lastexitcode } - name: 'Run end_to_end::default recipe' id: run run: | |