Add BizTalk Server project build component to build agent machine. (#1960)
* Add BizTalk Project Build components, including msi and vsix. * Add BizTalk Build Components to software report. * Use registry/folder check replace actually BizTalk Project building for testing purpose. * Remove unnecessary try/catch. * Make sure BizTalk related software report only for Windows 2019 OS. * Add statement to make sure BizTalk test only invoked in Win19 env. * Fix test failue when no test runs use "skip" * Update the TestName to be identity to BizTalk.Test.ps1
This commit is contained in:
@@ -0,0 +1,83 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-BizTalkBuildComponent.ps1
|
||||||
|
## Desc: Install BizTalk Project Build Component
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
function Install-Msi
|
||||||
|
{
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
A helper function to install executables.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
install .exe or .msi binaries from specified Path.
|
||||||
|
|
||||||
|
.PARAMETER MsiPath
|
||||||
|
Msi or exe path. Required parameter.
|
||||||
|
|
||||||
|
.PARAMETER LogPath
|
||||||
|
The log file path where installation will write log to. Required parameter.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Install-Msi -MsiPath "c:\temp\abc.msi" -LogPath "c:\abc.log"
|
||||||
|
#>
|
||||||
|
|
||||||
|
Param
|
||||||
|
(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[String] $MsiPath,
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[String] $LogPath
|
||||||
|
)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$filePath = "msiexec.exe"
|
||||||
|
|
||||||
|
Write-Host "Starting Install $MsiPath..."
|
||||||
|
$ArgumentList = ('/i', $MsiPath, '/QN', '/norestart', "/l*v",$LogPath)
|
||||||
|
$process = Start-Process -FilePath $filePath -ArgumentList $ArgumentList -Wait -PassThru -Verb runAs
|
||||||
|
|
||||||
|
$exitCode = $process.ExitCode
|
||||||
|
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||||
|
{
|
||||||
|
Write-Host "Installation for $MsiPath is successful."
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host "Non zero exit code returned by $MsiPath installation process: $exitCode"
|
||||||
|
Get-Content $LogPath | Write-Host
|
||||||
|
exit $exitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-Host "Failed to install $MsiPath : $($_.Exception.Message)"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$bizTalkBuildComponentUri = "https://aka.ms/BuildComponentSetup.EN"
|
||||||
|
|
||||||
|
# Download
|
||||||
|
Write-Host "BizTalk Project Build Component download..."
|
||||||
|
$setupZipFile = Start-DownloadWithRetry -Url $bizTalkBuildComponentUri -Name "BuildComponentSetup.EN.zip"
|
||||||
|
|
||||||
|
# Unzip
|
||||||
|
$setupPath = "C:\BizTalkBuildComponent"
|
||||||
|
if (-not (Test-Path -Path $setupPath)) {
|
||||||
|
$null = New-Item -Path $setupPath -ItemType Directory -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Unzip $setupZipFile to $setupPath..."
|
||||||
|
Extract-7Zip -Path $setupZipFile -DestinationPath $setupPath
|
||||||
|
Remove-Item $setupZipFile
|
||||||
|
|
||||||
|
# Install
|
||||||
|
Install-Msi -MsiPath "$setupPath\Bootstrap.msi" -LogPath "$setupPath\bootstrap.log"
|
||||||
|
Install-Msi -MsiPath "$setupPath\BuildComponentSetup.msi" -LogPath "$setupPath\buildComponentSetup.log"
|
||||||
|
|
||||||
|
Remove-Item $setupPath -Recurse -Force
|
||||||
|
|
||||||
|
# Test
|
||||||
|
Invoke-PesterTests -TestFile "BizTalk" -TestName "BizTalk Build Component Setup"
|
||||||
@@ -286,6 +286,11 @@ function Get-YAMLLintVersion {
|
|||||||
yamllint --version
|
yamllint --version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-BizTalkVersion {
|
||||||
|
$bizTalkReg = Get-ItemProperty "HKLM:\SOFTWARE\WOW6432Node\Microsoft\BizTalk Server\3.0"
|
||||||
|
return "- $($bizTalkReg.ProductName) $($bizTalkReg.ProductVersion) "
|
||||||
|
}
|
||||||
|
|
||||||
function Get-PipxVersion {
|
function Get-PipxVersion {
|
||||||
$pipxVersion = pipx --version
|
$pipxVersion = pipx --version
|
||||||
return "Pipx $pipxVersion"
|
return "Pipx $pipxVersion"
|
||||||
|
|||||||
@@ -139,6 +139,15 @@ $markdown += New-MDList -Style Unordered -Lines @(
|
|||||||
$markdown += New-MDHeader "MSYS2" -Level 3
|
$markdown += New-MDHeader "MSYS2" -Level 3
|
||||||
$markdown += Get-PacmanVersion
|
$markdown += Get-PacmanVersion
|
||||||
$markdown += New-MDNewLine
|
$markdown += New-MDNewLine
|
||||||
|
|
||||||
|
if(Test-IsWin19)
|
||||||
|
{
|
||||||
|
$markdown += New-MDHeader "BizTalk Server" -Level 3
|
||||||
|
$markdown += Get-BizTalkVersion
|
||||||
|
$markdown += New-MDNewLine
|
||||||
|
}
|
||||||
|
|
||||||
|
$markdown += New-MDHeader "Notes:" -Level 5
|
||||||
$markdown += @'
|
$markdown += @'
|
||||||
```
|
```
|
||||||
Location: C:\msys64
|
Location: C:\msys64
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: BizTalk.Tests.ps1
|
||||||
|
## Desc: Test BizTalk project build component installed.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
Describe "BizTalk Build Component Setup" -Skip:(Test-IsWin16) {
|
||||||
|
It "BizTalk Registry Check" {
|
||||||
|
Test-Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\BizTalk Server\3.0" | Should -BeTrue
|
||||||
|
}
|
||||||
|
|
||||||
|
It "BizTalk Folder Check" {
|
||||||
|
"${env:ProgramFiles(x86)}\Microsoft BizTalk Server" | Should -Exist
|
||||||
|
}
|
||||||
|
|
||||||
|
It "BizTalk Build Targets files Check" {
|
||||||
|
"${env:ProgramFiles(x86)}\MSBuild\Microsoft\BizTalk\BizTalkC.targets" | Should -Exist
|
||||||
|
"${env:ProgramFiles(x86)}\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets" | Should -Exist
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -281,6 +281,11 @@
|
|||||||
"name": "Microsoft.VisualStudio.Installer.Projects.vsix",
|
"name": "Microsoft.VisualStudio.Installer.Projects.vsix",
|
||||||
"url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage",
|
"url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage",
|
||||||
"id": "VSInstallerProjects"
|
"id": "VSInstallerProjects"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BizTalkVsix.vsix",
|
||||||
|
"url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-biztalk/vsextensions/BizTalk/3.13.2.0/vspackage",
|
||||||
|
"id": "BizTalkProjectSystem.BD1D0FA0-E48A-4270-995F-F110DD9F7838"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -313,6 +313,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts": [
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-BizTalkBuildComponent.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
|
|||||||
Reference in New Issue
Block a user