Multiple Stages
IFX Nuget IIS Development and Windows Service plus IIS Flop logic on conditional compile
This commit is contained in:
parent
66f38fcf33
commit
72b648589e
@ -44,7 +44,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -59,7 +59,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -74,7 +74,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -95,7 +95,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -112,7 +112,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -130,7 +130,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -147,7 +147,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -162,7 +162,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -178,7 +178,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -193,7 +193,7 @@ public class UnitTestInfinityQSController
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
|
@ -56,7 +56,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -71,7 +71,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -92,7 +92,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -109,7 +109,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -127,7 +127,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -144,7 +144,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -159,7 +159,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -175,7 +175,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
@ -190,7 +190,7 @@ public class UnitTestInfinityQSV2Controller
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
#if DEBUG
|
||||
[Ignore]
|
||||
#endif
|
||||
[TestMethod]
|
||||
|
@ -15,7 +15,7 @@ trigger:
|
||||
- "ClientHub/*"
|
||||
|
||||
pool:
|
||||
name: Mesa-Windows-Service
|
||||
name: Mesa-IIS
|
||||
demands: OI-Metrology-Server-Development
|
||||
|
||||
variables:
|
||||
@ -25,13 +25,6 @@ variables:
|
||||
ASPNETCORE_ENVIRONMENT: "Development"
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set exeName=OI.Metrology.Server
|
||||
echo %exeName%
|
||||
echo ##vso[task.setvariable variable=ExeName;]%exeName%
|
||||
echo $(ExeName)
|
||||
displayName: ExeName
|
||||
|
||||
- script: |
|
||||
set coreVersion=net7.0
|
||||
echo %coreVersion%
|
||||
@ -43,7 +36,7 @@ steps:
|
||||
set configuration=Debug
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
echo ($Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: |
|
||||
@ -61,32 +54,16 @@ steps:
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
|
||||
- script: |
|
||||
set uuId=A6302662940458499454E35D28FCC9F7
|
||||
echo %uuId%
|
||||
echo ##vso[task.setvariable variable=UUId;]%uuId%
|
||||
echo $(UUId)
|
||||
displayName: UUId
|
||||
|
||||
- script: |
|
||||
set pwEncoding=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAtBhT01pNnUGaN/uPLxZGvAAAAAACAAAAAAADZgAAwAAAABAAAAAM4xlYguhv7jzchU8dq9pVAAAAAASAAACgAAAAEAAAANS9rIoaYfNq5TwCmTrqElsgAAAA7O4J52FqCctXlCxYB2J5b/W4T+pZCN2zwFj7XCAFW6IUAAAAhQsBDOERAUZJdtSy8AfxwOAZflo=
|
||||
echo %pwEncoding%
|
||||
echo ##vso[task.setvariable variable=PwEncoding;]%pwEncoding%
|
||||
echo $(PwEncoding)
|
||||
displayName: PwEncoding
|
||||
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(Configuration)
|
||||
echo $(CoreVersion)
|
||||
echo $(GitCommitSeven)
|
||||
echo $(Configuration)
|
||||
echo $(NugetSource)
|
||||
echo $(PwEncoding)
|
||||
echo $(UUId)
|
||||
echo $(GitCommitSeven)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
|
||||
@ -102,21 +79,6 @@ steps:
|
||||
workingDirectory: Server
|
||||
displayName: "Safe storage of app secrets - Server"
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "IsDevelopment" true
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "MockRoot" "/Data/Tests"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "URLs" "http://localhost:5002;"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "MonAResource" "OI_Metrology_Viewer_IFX"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "ApiExportPath" "\\messdv002.na.infineon.com\Candela\Archive\API"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "ConnectionString" "Data Source=MESSAD1001\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "Oi2SqlConnectionString" "Data Source=MESSAD1001\TEST1,59583;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;"
|
||||
workingDirectory: Server
|
||||
displayName: "Safe storage of app secrets II - Server"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Build - Tests"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Build - Server"
|
||||
@ -169,53 +131,6 @@ steps:
|
||||
workingDirectory: Server
|
||||
displayName: "Core Publish"
|
||||
|
||||
- script: 'sc stop "$(Build.Repository.Name)-$(Configuration)"'
|
||||
workingDirectory: Server
|
||||
displayName: "Service Control - Stop"
|
||||
continueOnError: true
|
||||
|
||||
- script: 'sc delete "$(Build.Repository.Name)-$(Configuration)"'
|
||||
workingDirectory: Server
|
||||
displayName: "Service Control - Delete"
|
||||
continueOnError: true
|
||||
|
||||
- task: DownloadSecureFile@1
|
||||
name: downloadSecureFileKDBX
|
||||
displayName: "Download secure file"
|
||||
inputs:
|
||||
secureFile: "Infineon-NA.kdbx"
|
||||
|
||||
- script: echo "<$(downloadSecureFileKDBX.secureFilePath)>"
|
||||
displayName: "Echo Path"
|
||||
|
||||
- powershell: |
|
||||
$data = @('$(downloadSecureFileKDBX.secureFilePath)', '-c:GetEntryString', '-Field:Password', '-refx-UUID:$(UUId)', '-pw-enc:$(PwEncoding)')
|
||||
$data.count
|
||||
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||
$processStartInfo.FileName = "C:\Users\$(USERNAME)\AppData\Local\IFXApps\KeePass-2.51.1---KPScript-2.51.1\KPScript.exe"
|
||||
$processStartInfo.RedirectStandardError = $true
|
||||
$processStartInfo.RedirectStandardOutput = $true
|
||||
$processStartInfo.UseShellExecute = $false
|
||||
$processStartInfo.Arguments = $data
|
||||
$process = New-Object System.Diagnostics.Process
|
||||
$process.StartInfo = $processStartInfo
|
||||
$process.Start() | Out-Null
|
||||
$process.WaitForExit()
|
||||
$stdout = $process.StandardOutput.ReadToEnd()
|
||||
$stderr = $process.StandardError.ReadToEnd()
|
||||
Write-Host "stderr: $stderr"
|
||||
Write-Host "exit code: " + $process.ExitCode
|
||||
Write-Host "##vso[task.setvariable variable=pipelinePassword;]$stdout"
|
||||
displayName: pipelinePassword
|
||||
|
||||
- script: 'sc create "$(Build.Repository.Name)-$(Configuration)" start= delayed-auto DisplayName= "$(Build.Repository.Name)-$(Configuration)-$(GitCommitSeven)-$(Build.BuildId)" binPath= D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server\$(ExeName).exe obj= INFINEON\$(USERNAME) password="$(pipelinePassword)"'
|
||||
workingDirectory: Server
|
||||
displayName: "Service Control - Create"
|
||||
|
||||
- script: 'sc start "$(Build.Repository.Name)-$(Configuration)"'
|
||||
workingDirectory: Server
|
||||
displayName: "Service Control - Start"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: "Publish Artifact: drop"
|
||||
enabled: false
|
||||
@ -227,6 +142,3 @@ steps:
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Clean - Server"
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
displayName: "Force Fail"
|
||||
|
@ -14,131 +14,365 @@ trigger:
|
||||
- "Client/*"
|
||||
- "ClientHub/*"
|
||||
|
||||
pool:
|
||||
name: Mesa-IIS
|
||||
demands: OI-Metrology-Server
|
||||
|
||||
variables:
|
||||
# solution: '**/*.sln'
|
||||
# buildPlatform: 'Any CPU'
|
||||
buildConfiguration: "Release"
|
||||
ASPNETCORE_ENVIRONMENT: "Production"
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set coreVersion=net7.0
|
||||
echo %coreVersion%
|
||||
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||
echo $(CoreVersion)
|
||||
displayName: CoreVersion
|
||||
stages:
|
||||
- stage: IFX
|
||||
|
||||
- script: |
|
||||
set configuration=Release
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo ($Configuration)
|
||||
displayName: Configuration
|
||||
pool:
|
||||
name: Mesa-Windows-Service
|
||||
demands: OI-Metrology-Server-IFX
|
||||
|
||||
- script: |
|
||||
set nugetSource=https://messa08ec.ec.local/v3/index.json
|
||||
echo %nugetSource%
|
||||
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||
echo $(NugetSource)
|
||||
displayName: NugetSource
|
||||
jobs:
|
||||
- job: IFX
|
||||
steps:
|
||||
- script: |
|
||||
set exeName=OI.Metrology.Server
|
||||
echo %exeName%
|
||||
echo ##vso[task.setvariable variable=ExeName;]%exeName%
|
||||
echo $(ExeName)
|
||||
displayName: ExeName
|
||||
|
||||
- script: |
|
||||
set gitCommit=$(Build.SourceVersion)
|
||||
set gitCommitSeven=%gitCommit:~0,7%
|
||||
echo %gitCommitSeven%
|
||||
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
- script: |
|
||||
set coreVersion=net7.0
|
||||
echo %coreVersion%
|
||||
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||
echo $(CoreVersion)
|
||||
displayName: CoreVersion
|
||||
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(CoreVersion)
|
||||
echo $(Configuration)
|
||||
echo $(NugetSource)
|
||||
echo $(GitCommitSeven)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
- script: |
|
||||
set configuration=Debug
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
enabled: false
|
||||
- script: |
|
||||
set nugetSource=https://messa017.infineon.com/v3/index.json
|
||||
echo %nugetSource%
|
||||
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||
echo $(NugetSource)
|
||||
displayName: NugetSource
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets init
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "BuildNumber" "$(Build.BuildId)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommitSeven" "$(GitCommitSeven)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets list
|
||||
workingDirectory: Server
|
||||
displayName: "Safe storage of app secrets - Server"
|
||||
- script: |
|
||||
set gitCommit=$(Build.SourceVersion)
|
||||
set gitCommitSeven=%gitCommit:~0,7%
|
||||
echo %gitCommitSeven%
|
||||
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Build - Server"
|
||||
- script: |
|
||||
set uuId=A6302662940458499454E35D28FCC9F7
|
||||
echo %uuId%
|
||||
echo ##vso[task.setvariable variable=UUId;]%uuId%
|
||||
echo $(UUId)
|
||||
displayName: UUId
|
||||
|
||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
displayName: "PowerShell Script"
|
||||
- script: |
|
||||
set pwEncoding=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAtBhT01pNnUGaN/uPLxZGvAAAAAACAAAAAAADZgAAwAAAABAAAAAM4xlYguhv7jzchU8dq9pVAAAAAASAAACgAAAAEAAAANS9rIoaYfNq5TwCmTrqElsgAAAA7O4J52FqCctXlCxYB2J5b/W4T+pZCN2zwFj7XCAFW6IUAAAAhQsBDOERAUZJdtSy8AfxwOAZflo=
|
||||
echo %pwEncoding%
|
||||
echo ##vso[task.setvariable variable=PwEncoding;]%pwEncoding%
|
||||
echo $(PwEncoding)
|
||||
displayName: PwEncoding
|
||||
|
||||
- script: "dotnet test --configuration $(Configuration)"
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Test"
|
||||
# enabled: false
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(Configuration)
|
||||
echo $(CoreVersion)
|
||||
echo $(GitCommitSeven)
|
||||
echo $(NugetSource)
|
||||
echo $(PwEncoding)
|
||||
echo $(UUId)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||
workingDirectory: Server
|
||||
displayName: "Tool Restore"
|
||||
enabled: false
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" ReportGenerator -reports:.vscode/TestResults/*/coverage.cobertura.xml -targetDir:$(Build.ArtifactStagingDirectory)\Coverage -reportTypes:Html_Dark'
|
||||
workingDirectory: Server
|
||||
displayName: "Report Generator"
|
||||
enabled: false
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets init
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "BuildNumber" "$(Build.BuildId)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommitSeven" "$(GitCommitSeven)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets list
|
||||
workingDirectory: Server
|
||||
displayName: "Safe storage of app secrets - Server"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/*.trx"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/*.trx"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "IsDevelopment" true
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "MockRoot" "/Data/Tests"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "URLs" "http://localhost:5002;"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "MonAResource" "OI_Metrology_Viewer_IFX"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "ApiExportPath" "\\messdv002.na.infineon.com\Candela\Archive\API"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "ConnectionString" "Data Source=MESSAD1001\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "Oi2SqlConnectionString" "Data Source=MESSAD1001\TEST1,59583;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;"
|
||||
workingDirectory: Server
|
||||
displayName: "Safe storage of app secrets II - Server"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/coverage.cobertura.xml"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Build - Tests"
|
||||
|
||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||
displayName: "Create work item"
|
||||
inputs:
|
||||
teamProject: "Mesa_FI"
|
||||
workItemType: Bug
|
||||
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
|
||||
assignedTo: "$(Build.RequestedForId)"
|
||||
enabled: false
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Build - Server"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o "D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server" --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Publish"
|
||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
displayName: "PowerShell Script"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: "Publish Artifact: drop"
|
||||
enabled: false
|
||||
- script: "dotnet test --configuration $(Configuration)"
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Test"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Clean - Tests"
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||
workingDirectory: Server
|
||||
displayName: "Tool Restore"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" ReportGenerator -reports:.vscode/TestResults/*/coverage.cobertura.xml -targetDir:$(Build.ArtifactStagingDirectory)\Coverage -reportTypes:Html_Dark'
|
||||
workingDirectory: Server
|
||||
displayName: "Report Generator"
|
||||
enabled: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/*.trx"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/*.trx"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/coverage.cobertura.xml"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
codeCoverageTool: "Cobertura"
|
||||
summaryFileLocation: "$(System.DefaultWorkingDirectory)/.vscode/TestResults/*/coverage.cobertura.xml"
|
||||
enabled: false
|
||||
|
||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||
displayName: "Create work item"
|
||||
inputs:
|
||||
teamProject: "Mesa_FI"
|
||||
workItemType: Bug
|
||||
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
|
||||
assignedTo: "$(Build.RequestedForId)"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o "D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server" --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Publish"
|
||||
|
||||
- task: DownloadSecureFile@1
|
||||
name: downloadSecureFileKDBX
|
||||
displayName: "Download secure file"
|
||||
inputs:
|
||||
secureFile: "Infineon-NA.kdbx"
|
||||
|
||||
- script: echo "<$(downloadSecureFileKDBX.secureFilePath)>"
|
||||
displayName: "Echo Path"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Clean - Tests"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: src/BaGet
|
||||
displayName: "Core Clean - Server"
|
||||
|
||||
- powershell: |
|
||||
$data = @('$(downloadSecureFileKDBX.secureFilePath)', '-c:GetEntryString', '-Field:Password', '-refx-UUID:$(UUId)', '-pw-enc:$(PwEncoding)')
|
||||
$data.count
|
||||
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||
$processStartInfo.FileName = "C:\Users\$(USERNAME)\AppData\Local\IFXApps\KeePass-2.51.1---KPScript-2.51.1\KPScript.exe"
|
||||
$processStartInfo.RedirectStandardError = $true
|
||||
$processStartInfo.RedirectStandardOutput = $true
|
||||
$processStartInfo.UseShellExecute = $false
|
||||
$processStartInfo.Arguments = $data
|
||||
$process = New-Object System.Diagnostics.Process
|
||||
$process.StartInfo = $processStartInfo
|
||||
$process.Start() | Out-Null
|
||||
$process.WaitForExit()
|
||||
$stdout = $process.StandardOutput.ReadToEnd()
|
||||
$stderr = $process.StandardError.ReadToEnd()
|
||||
Write-Host "stderr: $stderr"
|
||||
Write-Host "exit code: " + $process.ExitCode
|
||||
Write-Host "##vso[task.setvariable variable=pipelinePassword;]$stdout"
|
||||
displayName: pipelinePassword
|
||||
|
||||
- script: 'sc create "$(Build.Repository.Name)-$(Configuration)" start= delayed-auto DisplayName= "$(Build.Repository.Name)-$(Configuration)-$(GitCommitSeven)-$(Build.BuildId)" binPath= D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server\$(ExeName).exe obj= INFINEON\$(USERNAME) password="$(pipelinePassword)"'
|
||||
workingDirectory: Server
|
||||
displayName: "Service Control - Create"
|
||||
continueOnError: true
|
||||
|
||||
- script: 'sc configure "$(ExeName)-$(Configuration)" DisplayName= "$(Build.Repository.Name)-$(Configuration)-$(GitCommitSeven)-$(Build.BuildId)"'
|
||||
displayName: "Service Control - Configure"
|
||||
|
||||
- script: 'sc stop "$(ExeName)-$(Configuration)"'
|
||||
displayName: "Service Control - Stop"
|
||||
continueOnError: true
|
||||
|
||||
- script: 'rmdir "D:\$(CoreVersion)\$(Build.Repository.Name)\Server"'
|
||||
displayName: "Remove directory"
|
||||
continueOnError: true
|
||||
|
||||
- script: 'mklink /J "D:\$(CoreVersion)\$(Build.Repository.Name)\Server" "D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server"'
|
||||
displayName: "Link directory"
|
||||
continueOnError: true
|
||||
|
||||
- script: 'sc start "$(ExeName)-$(Configuration)"'
|
||||
displayName: "Service Control - Start"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: "Publish Artifact: drop"
|
||||
enabled: false
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
displayName: "Force Fail"
|
||||
enabled: false
|
||||
|
||||
- stage: EC
|
||||
|
||||
pool:
|
||||
name: Mesa-IIS
|
||||
demands: OI-Metrology-Server-EC
|
||||
|
||||
jobs:
|
||||
- job: EC
|
||||
steps:
|
||||
- script: |
|
||||
set coreVersion=net7.0
|
||||
echo %coreVersion%
|
||||
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||
echo $(CoreVersion)
|
||||
displayName: CoreVersion
|
||||
|
||||
- script: |
|
||||
set configuration=Release
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo ($Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: |
|
||||
set nugetSource=https://messa08ec.ec.local/v3/index.json
|
||||
echo %nugetSource%
|
||||
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||
echo $(NugetSource)
|
||||
displayName: NugetSource
|
||||
|
||||
- script: |
|
||||
set gitCommit=$(Build.SourceVersion)
|
||||
set gitCommitSeven=%gitCommit:~0,7%
|
||||
echo %gitCommitSeven%
|
||||
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
|
||||
- script: |
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(CoreVersion)
|
||||
echo $(Configuration)
|
||||
echo $(NugetSource)
|
||||
echo $(GitCommitSeven)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" nuget locals all --clear'
|
||||
displayName: "Nuget Clear"
|
||||
enabled: false
|
||||
|
||||
- script: |
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets init
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "BuildNumber" "$(Build.BuildId)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets set "GitCommitSeven" "$(GitCommitSeven)"
|
||||
"C:\program files\dotnet\dotnet.exe" user-secrets list
|
||||
workingDirectory: Server
|
||||
displayName: "Safe storage of app secrets - Server"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Build - Server"
|
||||
|
||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
displayName: "PowerShell Script"
|
||||
|
||||
- script: "dotnet test --configuration $(Configuration)"
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Test"
|
||||
# enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||
workingDirectory: Server
|
||||
displayName: "Tool Restore"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" ReportGenerator -reports:.vscode/TestResults/*/coverage.cobertura.xml -targetDir:$(Build.ArtifactStagingDirectory)\Coverage -reportTypes:Html_Dark'
|
||||
workingDirectory: Server
|
||||
displayName: "Report Generator"
|
||||
enabled: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/*.trx"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/*.trx"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: "**/coverage.cobertura.xml"
|
||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||
|
||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||
displayName: "Create work item"
|
||||
inputs:
|
||||
teamProject: "Mesa_FI"
|
||||
workItemType: Bug
|
||||
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
|
||||
assignedTo: "$(Build.RequestedForId)"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o "D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server" --source $(NugetSource)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Publish"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: "Publish Artifact: drop"
|
||||
enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Clean - Tests"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Clean - Server"
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Clean - Server"
|
||||
|
Loading…
x
Reference in New Issue
Block a user