elasticsearch/.ci/packer_cache.ps1
Brian Seeders 4c2d253b7f
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
2023-08-25 14:20:56 -04:00

16 lines
619 B
PowerShell
Executable file

$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
}