Change from ticks to IQS ID and SC
Change pool to Windows-Service Build Tests first Disable Tests
This commit is contained in:
@ -67,24 +67,35 @@ public class ExportRepository : IExportRepository
|
|||||||
List<HeaderCommon> results = new();
|
List<HeaderCommon> results = new();
|
||||||
string json;
|
string json;
|
||||||
HeaderCommon? hc;
|
HeaderCommon? hc;
|
||||||
string ticks = "Ticks";
|
string? directory;
|
||||||
|
string directoryName;
|
||||||
JsonElement? jsonElement;
|
JsonElement? jsonElement;
|
||||||
|
const string ticks = "Ticks";
|
||||||
JsonProperty[] jsonProperties;
|
JsonProperty[] jsonProperties;
|
||||||
List<string> files = GetFiles(headerCommon, "*.json");
|
List<string> files = GetFiles(headerCommon, "*.json");
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
{
|
{
|
||||||
json = File.ReadAllText(file);
|
json = File.ReadAllText(file);
|
||||||
jsonElement = JsonSerializer.Deserialize<JsonElement>(json);
|
|
||||||
if (jsonElement is null || jsonElement.Value.ValueKind != JsonValueKind.Object)
|
|
||||||
continue;
|
|
||||||
jsonProperties = (from l in jsonElement.Value.EnumerateObject() where l.Name == ticks select l).ToArray();
|
|
||||||
if (!jsonProperties.Any() || !long.TryParse(jsonProperties[0].Value.ToString(), out long ticksValue))
|
|
||||||
continue;
|
|
||||||
hc = JsonSerializer.Deserialize<HeaderCommon>(json);
|
hc = JsonSerializer.Deserialize<HeaderCommon>(json);
|
||||||
if (hc is null)
|
if (hc is null)
|
||||||
continue;
|
continue;
|
||||||
hc.ID = ticksValue;
|
if (hc.ID < 1)
|
||||||
hc.Date = new(ticksValue);
|
{
|
||||||
|
directory = Path.GetDirectoryName(file);
|
||||||
|
if (directory is null)
|
||||||
|
continue;
|
||||||
|
directoryName = Path.GetFileName(directory);
|
||||||
|
if (directoryName.Length < 1 || directoryName[0] != '-' || !long.TryParse(directoryName[1..], out long id))
|
||||||
|
continue;
|
||||||
|
hc.ID = id;
|
||||||
|
}
|
||||||
|
jsonElement = JsonSerializer.Deserialize<JsonElement>(json);
|
||||||
|
if (jsonElement is not null && jsonElement.Value.ValueKind == JsonValueKind.Object)
|
||||||
|
{
|
||||||
|
jsonProperties = (from l in jsonElement.Value.EnumerateObject() where l.Name == ticks select l).ToArray();
|
||||||
|
if (jsonProperties.Any() && long.TryParse(jsonProperties[0].Value.ToString(), out long ticksValue))
|
||||||
|
hc.Date = new(ticksValue);
|
||||||
|
}
|
||||||
results.Add(hc);
|
results.Add(hc);
|
||||||
}
|
}
|
||||||
result = new()
|
result = new()
|
||||||
|
@ -15,16 +15,23 @@ trigger:
|
|||||||
- "ClientHub/*"
|
- "ClientHub/*"
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
name: Mesa-IIS
|
name: Mesa-Windows-Service
|
||||||
demands: OI-Metrology-Server-Development
|
demands: OI-Metrology-Server-Development
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
# solution: '**/*.sln'
|
# solution: '**/*.sln'
|
||||||
# buildPlatform: 'Any CPU'
|
# buildPlatform: 'Any CPU'
|
||||||
buildConfiguration: 'Debug'
|
buildConfiguration: "Debug"
|
||||||
ASPNETCORE_ENVIRONMENT: 'Development'
|
ASPNETCORE_ENVIRONMENT: "Development"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- script: |
|
||||||
|
set exeName=OI.Metrology.Server
|
||||||
|
echo %exeName%
|
||||||
|
echo ##vso[task.setvariable variable=ExeName;]%exeName%
|
||||||
|
echo $(ExeName)
|
||||||
|
displayName: ExeName
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set coreVersion=net7.0
|
set coreVersion=net7.0
|
||||||
echo %coreVersion%
|
echo %coreVersion%
|
||||||
@ -79,13 +86,28 @@ steps:
|
|||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Safe storage of app secrets - 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)'
|
- script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'
|
||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Core Build - Server"
|
displayName: "Core Build - Server"
|
||||||
|
|
||||||
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||||
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
displayName: 'PowerShell Script'
|
displayName: "PowerShell Script"
|
||||||
|
|
||||||
- script: "dotnet test --configuration $(Configuration)"
|
- script: "dotnet test --configuration $(Configuration)"
|
||||||
workingDirectory: Tests
|
workingDirectory: Tests
|
||||||
@ -129,16 +151,69 @@ steps:
|
|||||||
SourceFolder: '$(Build.ArtifactStagingDirectory)\Server'
|
SourceFolder: '$(Build.ArtifactStagingDirectory)\Server'
|
||||||
TargetFolder: 'D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server'
|
TargetFolder: 'D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server'
|
||||||
|
|
||||||
|
- 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:A6302662940458499454E35D28FCC9F7', '-pw-enc:AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAtBhT01pNnUGaN/uPLxZGvAAAAAACAAAAAAADZgAAwAAAABAAAAAM4xlYguhv7jzchU8dq9pVAAAAAASAAACgAAAAEAAAANS9rIoaYfNq5TwCmTrqElsgAAAA7O4J52FqCctXlCxYB2J5b/W4T+pZCN2zwFj7XCAFW6IUAAAAhQsBDOERAUZJdtSy8AfxwOAZflo=')
|
||||||
|
$data.count
|
||||||
|
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||||
|
$processStartInfo.FileName = "C:\Users\meseafsvc\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= "$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" binPath= D:\$(CoreVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)\Server\$(ExeName).exe obj= INFINEON\meseafsvc password="$(pipelinePassword)"'
|
||||||
|
workingDirectory: Server
|
||||||
|
displayName: "Service Control - Create"
|
||||||
|
|
||||||
|
- script: 'sc start "$(Build.Repository.Name)-$(Configuration)"'
|
||||||
|
workingDirectory: Server
|
||||||
|
displayName: "Service Control - Start"
|
||||||
|
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
displayName: "Publish Artifact: drop"
|
displayName: "Publish Artifact: drop"
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
- script: |
|
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
|
||||||
workingDirectory: Tests
|
workingDirectory: Tests
|
||||||
displayName: "Core Clean - Tests"
|
displayName: "Core Clean - Tests"
|
||||||
|
|
||||||
- script: |
|
- script: '"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)'
|
||||||
"C:\program files\dotnet\dotnet.exe" clean --configuration $(Configuration)
|
|
||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Core Clean - Server"
|
displayName: "Core Clean - Server"
|
||||||
|
|
||||||
|
- 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_\Debug\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||||
|
workingDirectory: "EAF Viewer"
|
||||||
|
displayName: "Force Fail"
|
||||||
|
Reference in New Issue
Block a user