2022-04-01 13:43:34 +00:00
|
|
|
$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12,Tls13'
|
|
|
|
[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
|
|
|
|
|
|
|
|
# Function 'DownloadComponents' downloads some components that need on build satge
|
|
|
|
#
|
|
|
|
# It gets two parameters list of maps and download path
|
|
|
|
#
|
|
|
|
# The map consists of: download_allways ($true/$false) - should this component should download every time
|
|
|
|
# name - name of the dowmloaded component
|
|
|
|
# link - component download link
|
|
|
|
|
|
|
|
function DownloadComponents {
|
|
|
|
|
|
|
|
param ( $prereq_list, $path )
|
2022-11-08 08:26:46 +00:00
|
|
|
|
|
|
|
[void](New-Item -ItemType Directory -Force -Path $path)
|
2022-04-01 13:43:34 +00:00
|
|
|
|
|
|
|
ForEach ( $item in $prereq_list ) {
|
|
|
|
$url = $item.link
|
|
|
|
$output = $path + $item.name
|
|
|
|
|
2022-11-08 08:26:46 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if( $item.download_allways ){
|
2022-04-01 13:43:34 +00:00
|
|
|
[system.console]::WriteLine("Downloading $url")
|
|
|
|
Invoke-WebRequest -Uri $url -OutFile $output
|
2022-11-08 08:26:46 +00:00
|
|
|
} else {
|
|
|
|
if(![System.IO.File]::Exists($output)){
|
|
|
|
[system.console]::WriteLine("Downloading $url")
|
|
|
|
Invoke-WebRequest -Uri $url -OutFile $output
|
|
|
|
}
|
2022-04-01 13:43:34 +00:00
|
|
|
}
|
2022-11-08 08:26:46 +00:00
|
|
|
} catch {
|
|
|
|
Write-Host "[ERROR] Can not download" $item.name "by link" $url
|
2022-04-01 13:43:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-08 08:26:46 +00:00
|
|
|
switch ( $env:DOCUMENT_SERVER_VERSION )
|
|
|
|
{
|
|
|
|
latest { $DOCUMENT_SERVER_LINK = "https://download.onlyoffice.com/install/documentserver/windows/onlyoffice-documentserver-ee.exe" }
|
|
|
|
custom { $DOCUMENT_SERVER_LINK = $env:DOCUMENT_SERVER_CUSTOM_LINK.Replace(",", "") }
|
|
|
|
}
|
|
|
|
|
2022-05-12 16:06:09 +00:00
|
|
|
$nginx_version = '1.21.1'
|
2022-11-08 08:26:46 +00:00
|
|
|
$psql_version = '9.5.4'
|
2022-05-12 16:06:09 +00:00
|
|
|
|
2022-04-01 13:43:34 +00:00
|
|
|
$path_prereq = "${pwd}\build\install\win\"
|
|
|
|
|
|
|
|
$prerequisites = @(
|
|
|
|
@{
|
|
|
|
download_allways = $false;
|
2022-11-08 08:26:46 +00:00
|
|
|
name = "nginx-${nginx_version}.zip";
|
2022-05-12 16:06:09 +00:00
|
|
|
link = "https://nginx.org/download/nginx-${nginx_version}.zip";
|
2022-04-01 13:43:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@{
|
|
|
|
download_allways = $false;
|
2022-09-28 14:02:59 +00:00
|
|
|
name = "WinSW.NET4new.exe";
|
|
|
|
link = "https://github.com/winsw/winsw/releases/download/v2.11.0/WinSW.NET4.exe";
|
2022-04-01 13:43:34 +00:00
|
|
|
}
|
2022-11-08 08:26:46 +00:00
|
|
|
|
|
|
|
@{
|
|
|
|
download_allways = $true;
|
|
|
|
name = "onlyoffice-documentserver.latest.exe";
|
|
|
|
link = $DOCUMENT_SERVER_LINK
|
|
|
|
}
|
|
|
|
|
|
|
|
@{
|
|
|
|
download_allways = $false;
|
|
|
|
name = "psqlodbc_x64.msi";
|
|
|
|
link = "http://download.onlyoffice.com/install/windows/redist/psqlodbc_x64.msi"
|
|
|
|
}
|
|
|
|
|
|
|
|
@{
|
|
|
|
download_allways = $false;
|
|
|
|
name = "postgresql-${psql_version}-1-windows-x64.exe";
|
|
|
|
link = "https://get.enterprisedb.com/postgresql/postgresql-${psql_version}-1-windows-x64.exe"
|
|
|
|
}
|
2022-09-28 14:02:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
$path_nuget_packages = "${pwd}\.nuget\packages\"
|
2022-04-01 13:43:34 +00:00
|
|
|
|
2022-09-28 14:02:59 +00:00
|
|
|
$nuget_packages = @(
|
2022-04-01 13:43:34 +00:00
|
|
|
@{
|
|
|
|
download_allways = $false;
|
2022-09-28 14:02:59 +00:00
|
|
|
name = "rabbitmq.client.3.6.5.nupkg";
|
|
|
|
link = "https://www.nuget.org/api/v2/package/RabbitMQ.Client/3.6.5";
|
2022-04-01 13:43:34 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
DownloadComponents $prerequisites $path_prereq
|
2022-09-28 14:02:59 +00:00
|
|
|
|
|
|
|
DownloadComponents $nuget_packages $path_nuget_packages
|