2019-10-04 01:41:06 -04:00
|
|
|
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
|
|
|
|
{
|
|
|
|
# Relaunch as an elevated process:
|
|
|
|
Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2019-10-23 06:22:15 -04:00
|
|
|
$AppProps = ConvertFrom-StringData (Get-Content .ci/java-versions.properties -raw)
|
|
|
|
$env:ES_BUILD_JAVA=$AppProps.ES_BUILD_JAVA
|
|
|
|
$env:ES_RUNTIME_JAVA=$AppProps.ES_RUNTIME_JAVA
|
2019-10-04 01:41:06 -04:00
|
|
|
|
|
|
|
$ErrorActionPreference="Stop"
|
|
|
|
$gradleInit = "C:\Users\$env:username\.gradle\init.d\"
|
|
|
|
echo "Remove $gradleInit"
|
|
|
|
Remove-Item -Recurse -Force $gradleInit -ErrorAction Ignore
|
|
|
|
New-Item -ItemType directory -Path $gradleInit
|
|
|
|
echo "Copy .ci/init.gradle to $gradleInit"
|
|
|
|
Copy-Item .ci/init.gradle -Destination $gradleInit
|
|
|
|
|
|
|
|
[Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine")
|
|
|
|
$env:PATH="C:\Users\jenkins\.java\$env:ES_BUILD_JAVA\bin\;$env:PATH"
|
|
|
|
$env:JAVA_HOME=$null
|
|
|
|
$env:SYSTEM_JAVA_HOME="C:\Users\jenkins\.java\$env:ES_RUNTIME_JAVA"
|
|
|
|
Remove-Item -Recurse -Force \tmp -ErrorAction Ignore
|
|
|
|
New-Item -ItemType directory -Path \tmp
|
|
|
|
|
|
|
|
$ErrorActionPreference="Continue"
|
|
|
|
# TODO: remove the task exclusions once dependencies are set correctly and these don't run for Windows or buldiung the deb on windows is fixed
|
2019-10-21 10:09:12 -04:00
|
|
|
& .\gradlew.bat -g "C:\Users\$env:username\.gradle" --parallel --scan --console=plain destructiveDistroTest
|
2019-10-04 01:41:06 -04:00
|
|
|
|
2019-10-07 08:33:25 -04:00
|
|
|
exit $LastExitCode
|