1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2018-2020 Nordix Foundation.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # SPDX-License-Identifier: Apache-2.0
17 # ============LICENSE_END=========================================================
19 # Wrapper function for choco (Software management automation for Windows)
20 function Install-Choco {
23 [Parameter(Mandatory)]
24 [string] $PackageName,
25 [string[]] $ArgumentList
32 Write-Host "Running [#$count]: choco install $packageName -y $ArgumentList"
33 choco install $packageName -y @ArgumentList
35 $pkg = choco list --localonly $packageName --exact --all --limitoutput
37 Write-Host "Package installed: $pkg"
43 Write-Host "Could not install $packageName after $count attempts"
46 Start-Sleep -Seconds 30
52 # Get required version of geode server to execute geode-native (client) tests
53 function Get-GeodeServer {
56 [Parameter(Mandatory)]
57 [string] $GeodeVersion,
58 [Parameter(Mandatory)]
59 [string] $LocationPath
62 $GeodeURL = "https://downloads.apache.org/geode/" + $GeodeVersion + "/apache-geode-" + $GeodeVersion + ".tgz"
63 $GeodePackage = "apache-geode-" + $GeodeVersion + ".tgz"
64 Write-Host "`nDownloading Geode Server version: $GeodeVersion"
65 Write-Host "from URL: $GeodeURL `n"
66 wget -Verbose $GeodeURL -OutFile $GeodePackage
67 If(!(test-path $LocationPath))
69 New-Item -ItemType Directory -Force -Path $LocationPath
71 Write-Host "`nExtracting Geode Server to: ${LocationPath}apache-geode-${GeodeVersion} `n"
72 tar -xzvf $GeodePackage -C $LocationPath
73 $env:GEODE_HOME = $LocationPath + "\apache-geode-" + $GeodeVersion
77 Write-Host "Install Git, version: latest"
78 Install-Choco -PackageName git.install
80 Write-Host "Install Doxygen, version: latest"
81 Install-Choco -PackageName doxygen.install
83 Write-Host "Install NUnit, version: ${ENV:NUNIT_VERSION}"
84 Install-Choco -PackageName nunit.install -ArgumentList "--version",${ENV:NUNIT_VERSION},"--allow-downgrade"
86 Write-Host "Install OpenSSL, version: latest"
87 Install-Choco -PackageName openssl
89 Write-Host "Install CMake, version: latest"
90 Install-Choco -PackageName cmake.portable
92 Write-Host "Install Dogtail, version: ${ENV:DOTNET_VERSION}"
93 Install-Choco -PackageName dotnet${ENV:DOTNET_VERSION}
95 Write-Host "Install .NET Framework and DevPack, version: ${ENV:DEV_DOTNET_VERSION}"
96 Install-Choco -PackageName "dotnet${ENV:DEV_DOTNET_VERSION}"
97 Install-Choco -PackageName "netfx-${ENV:DEV_DOTNET_VERSION}-devpack" -ArgumentList "--allowEmptyChecksums","-confirm"
99 Write-Host "Install GNU Win32 Core utilities, version: latest"
100 Install-Choco -PackageName gnuwin32-coreutils.portable
102 Write-Host "Install NSIS, version: latest"
103 Install-Choco -PackageName nsis
105 Write-Host "Install patch, version: latest"
106 Install-Choco -PackageName patch
108 Write-Host "Install NuGet, version: latest"
109 Install-Choco -PackageName nuget.commandline
111 Get-GeodeServer -GeodeVersion ${ENV:GEODE_SERVER_VERSION} -LocationPath ${ENV:GEODE_SERVER_PATH}