Update runbld in windows 2012 images via packer_cache (#98887)

Fixes #97998 

Use the windows packer_cache script to update the runbld binary to the
latest version.

Tested in this PR in an older commit with these changes:
ab89ed094c
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+pull-request+packaging-tests-windows/354/PACKAGING_TASK=default-windows-archive,os=windows-2012-r2/console
This commit is contained in:
Brian Seeders 2023-08-25 14:20:56 -04:00 committed by GitHub
parent cd62bc84d7
commit 4c2d253b7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

16
.ci/packer_cache.ps1 Executable file
View file

@ -0,0 +1,16 @@
$RUNBLD_DIR = 'C:\Program Files\runbld\src\runbld-7.0.3'
$RUNBLD = Join-Path $RUNBLD_DIR 'runbld'
# Check if 7.0.3 doesn't already exist
if (-not (Test-Path $RUNBLD)) {
New-Item -Path $RUNBLD_DIR -ItemType Directory -Force
Invoke-WebRequest -Uri 'http://packages.elasticsearch.org.s3.amazonaws.com/infra/runbld-7.0.3' -OutFile $RUNBLD
$RUNBLD_HARDLINK_DIR = 'C:\Program Files\infra\bin'
$RUNBLD_HARDLINK = Join-Path $RUNBLD_HARDLINK_DIR 'runbld'
Remove-Item -Path $RUNBLD_HARDLINK -Force
New-Item -Path $RUNBLD_HARDLINK_DIR -ItemType Directory -Force
fsutil hardlink create $RUNBLD_HARDLINK $RUNBLD
}