Codebasis als Dateien ins Arbeitsrepo statt als Gitlink

QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142)
getrackt, ohne .gitmodules und ohne erreichbares Remote. Der
Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar
gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege
der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen.

Umstellung:
- Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert
  (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6)
- Gitlink aus dem Index entfernt
- Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB

Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte
bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
This commit is contained in:
Christoph Schwörer
2026-08-26 07:43:51 +02:00
parent 18edae75b6
commit f045b99a25
24664 changed files with 5846716 additions and 1 deletions
@@ -0,0 +1,31 @@
trigger:
- please_dont_get_triggered
schedules:
- cron: '0 0 * * *'
branches:
include:
- master
jobs:
- job: Analyze
timeoutInMinutes: 120
pool: Default
steps:
- task: AdvancedSecurity-Codeql-Init@1
inputs:
languages: 'csharp'
enableAutomaticCodeQLInstall: true
- checkout: self
fetchDepth: 0
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- build 2>&1'
displayName: Build
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_USE_LONG_TIMEOUT: true
- task: AdvancedSecurity-Dependency-Scanning@1
- task: AdvancedSecurity-Codeql-Analyze@1
@@ -0,0 +1,151 @@
trigger:
- master
- release/*
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
IsDevBuild: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')]
UploadCentronArtifacts: $[or(startsWith(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))]
pool: Default
steps:
- task: DownloadSecureFile@1
name: codeSigningCertificate
displayName: 'Download Code Signing Certificate'
inputs:
secureFile: 'c-entron code signing certificate.pfx'
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- setup-versioning 2>&1'
displayName: 'Setup Versioning'
env:
CENTRON_BUILD_IS_DEV_BUILD: $(IsDevBuild)
- powershell: |
$versionNumber = [Version][string] (& "$env:BUILD_SOURCESDIRECTORY\dotnettools\nbgv.exe" get-version -v Version 2>&1);
$isPullRequestBuild = $env:BUILD_REASON -eq 'PullRequest';
$version = if ($isPullRequestBuild) { "$versionNumber (PR)" } else { "$versionNumber" };
Write-Host "##vso[build.updatebuildnumber]$version"
displayName: 'Set Azure DevOps Build Version'
workingDirectory: '"./deployment/centron"'
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- build-installer create-nuget-packages end-to-end-tests 2>&1'
displayName: Build
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: $(IsDevBuild)
CENTRON_BUILD_CODE_SIGNING_CERTIFICATE: $(codeSigningCertificate.secureFilePath)
CENTRON_BUILD_CODE_SIGNING_CERTIFICATE_PASSWORD: $(codeSigningCertificatePassword)
- task: PublishTestResults@2
displayName: 'Publish Test: c-entron EndToEnd Tests'
inputs:
testResultsFormat: VSTest
testResultsFiles: 'artifacts/EndToEndTests/TestResults.trx'
testRunTitle: 'c-entron EndToEnd Tests'
buildConfiguration: 'Release'
failTaskOnFailedTests: true
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables.UploadCentronArtifacts, true))
displayName: 'Deploy Artifact: Centron.WebServices.Core Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.WebServices.Core.*.nupkg'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables.UploadCentronArtifacts, true))
displayName: 'Deploy Artifact: Centron.Interfaces Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.Interfaces.*.nupkg'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables.UploadCentronArtifacts, true))
displayName: 'Deploy Artifact: Centron.Core Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.Core.*.nupkg'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables.UploadCentronArtifacts, true))
displayName: 'Deploy Artifact: Centron.Controls Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.Controls.*.nupkg'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron.NET Installer'
inputs:
targetPath: './artifacts/c-entron.NET Installer.zip'
artifactName: 'c-entron.NET Installer'
- task: razorspoint.rp-build-release-pnptasks.RP-PnPPowerShell.PnPPowerShell@3
condition: and(succeeded(), eq(variables.UploadCentronArtifacts, true))
displayName: 'Deploy Artifact: c-entron.NET Installer'
continueOnError: true
inputs:
SharePointVersion: SpOnline
sharepointConntection: 'Software Builds - SharePoint'
FileOrInline: Inline
RequiredVersion: '3.23.2007.1'
PnPPowerShellInline: |
cd deployment/centron;
$version = [Version][string] (& "$env:BUILD_SOURCESDIRECTORY\dotnettools\nbgv.exe" get-version -v Version 2>&1)
$mainVersion = $version.ToString(3)
$file = Add-PnpFile -Folder "/Shared Documents/c-entron.NET/v$mainVersion/v$version" -Path "..\..\artifacts\c-entron.NET Installer.zip"
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron Web-Service Installer'
inputs:
targetPath: './artifacts/c-entron Web-Service Installer.zip'
artifactName: 'c-entron Web-Service Installer'
- task: razorspoint.rp-build-release-pnptasks.RP-PnPPowerShell.PnPPowerShell@3
condition: and(succeeded(), eq(variables.UploadCentronArtifacts, true))
displayName: 'Deploy Artifact: c-entron Web-Service Installer'
continueOnError: true
inputs:
SharePointVersion: SpOnline
sharepointConntection: 'Software Builds - SharePoint'
FileOrInline: Inline
RequiredVersion: '3.23.2007.1'
PnPPowerShellInline: |
cd deployment/centron;
$version = [Version][string] (& "$env:BUILD_SOURCESDIRECTORY\dotnettools\nbgv.exe" get-version -v Version 2>&1)
$mainVersion = $version.ToString(3)
$file = Add-PnpFile -Folder "/Shared Documents/c-entron Web-Service/v$mainVersion/v$version" -Path "..\..\artifacts\c-entron Web-Service Installer.zip"
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron Web-Service Dependencies'
inputs:
targetPath: './artifacts/c-entron Web-Service Dependencies.txt'
artifactName: 'c-entron Web-Service Dependencies'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron.NET Dependencies'
inputs:
targetPath: './artifacts/c-entron.NET Dependencies.txt'
artifactName: 'c-entron.NET Dependencies'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: Nuget Packages'
inputs:
targetPath: './artifacts/nuget'
artifactName: 'Nuget Packages'
@@ -0,0 +1,56 @@
trigger:
- master
- release/*
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
IsDevBuild: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')]
UploadCentronArtifacts: $[or(startsWith(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))]
pool: Default
steps:
# Step: Install .NET SDK (version from global.json)
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
packageType: 'sdk'
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'
- powershell: |
if ("$(Build.SourceBranch)" -match "^refs/heads/(master|release)") {
Write-Host "##vso[task.setvariable variable=ShouldUpload;isOutput=true]true"
} else {
Write-Host "##vso[task.setvariable variable=ShouldUpload;isOutput=true]false"
}
name: set_upload_flag
# Step: Setup versioning and create NuGet packages
- template: build-templates/versioning.yaml
parameters:
isDevBuild: $(IsDevBuild)
# Step: Build Web Service
- template: build-templates/build-web-service.yaml
parameters:
isDevBuild: $(IsDevBuild)
# Step: Build Centron.NET
- template: build-templates/build-centron-net.yaml
parameters:
isDevBuild: $(IsDevBuild)
# Step: Build Nexus
- template: build-templates/build-nexus.yaml
parameters:
isDevBuild: $(IsDevBuild)
# Step: Deploy all artifacts
- template: build-templates/deploy-artifacts.yaml
# Step: Deploy all artifacts to nuget server
- template: build-templates/deploy-artifacts-nuget.yaml
# Step: Deploy all artifacts to sharepoint
- template: build-templates/deploy-artifacts-sharepoint.yaml
@@ -0,0 +1,59 @@
# Template for Centron.NET build, signing, and installer creation
parameters:
- name: isDevBuild
type: string
steps:
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- build-centron-net-only 2>&1'
displayName: Build Centron.Net
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- task: TrustedSigning@0
displayName: Signing Centron.Net
inputs:
AzureTenantID: $(AzureTenantID)
AzureClientID: $(AzureClientID)
AzureClientSecret: $(AzureClientSecret)
AzureClientSendCertificateChain: false
Endpoint: 'https://weu.codesigning.azure.net/'
TrustedSigningAccountName: 'CentronCodesigning'
CertificateProfileName: 'centroncert'
FileDigest: 'SHA256'
Files: |
$(Build.SourcesDirectory)\src\centron\Centron.WPF.UI\bin\Release\net10.0-windows\win-x64\publish\c-entron 2.0.exe
$(Build.SourcesDirectory)\src\centron\Centron.WPF.UI\bin\Release\net10.0-windows\win-x64\publish\c-entron 2.0.dll
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- set-dependencies-centron-net 2>&1'
displayName: Set Centron.Net Dependencies
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- build-centron-net-installer-only 2>&1'
displayName: Build Centron.Net Installer
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- task: TrustedSigning@0
displayName: Signing Centron.Net Installer
inputs:
AzureTenantID: $(AzureTenantID)
AzureClientID: $(AzureClientID)
AzureClientSecret: $(AzureClientSecret)
AzureClientSendCertificateChain: false
Endpoint: 'https://weu.codesigning.azure.net/'
TrustedSigningAccountName: 'CentronCodesigning'
CertificateProfileName: 'centroncert'
FileDigest: 'SHA256'
FilesFolder: '$(Build.SourcesDirectory)\deployment\centron\CentronSetupProject\bin\Release'
FilesFolderFilter: 'exe,dll,msi'
FilesFolderRecurse: true
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- set-zip-directory-centron-net 2>&1'
displayName: Set Centron.Net Zip-Directory
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
@@ -0,0 +1,55 @@
steps:
- script: 'dotnet run --project "./scripts/Scripts/Scripts.csproj" -- build-nexus 2>&1'
displayName: Build Nexus
- task: TrustedSigning@0
displayName: Signing Nexus
inputs:
AzureTenantID: $(AzureTenantID)
AzureClientID: $(AzureClientID)
AzureClientSecret: $(AzureClientSecret)
AzureClientSendCertificateChain: false
Endpoint: 'https://weu.codesigning.azure.net/'
TrustedSigningAccountName: 'CentronCodesigning'
CertificateProfileName: 'centroncert'
FileDigest: 'SHA256'
Files: |
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\CentronNexus.Host.exe
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\CentronNexus.Host.dll
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\CentronNexus.dll
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\CentronNexus.OutlookAddIn.dll
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\Centron.Core.dll
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\Centron.WebServices.Core.dll
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\Centron.Interfaces.dll
$(Build.SourcesDirectory)\src\nexus\CentronNexus.Host\bin\Release\net10.0\win-x64\publish\Centron.Office.Client.dll
- script: 'dotnet run --project "./scripts/Scripts/Scripts.csproj" -- zip-nexus-directory 2>&1'
displayName: Set Nexus Zip-Directory
- script: 'dotnet tool update --global wix --version "5.0.2" --allow-downgrade || dotnet tool install --global wix --version "5.0.2"'
displayName: Install WiX Toolset 5.x (WixSharp 2.x compatible)
- script: 'wix extension add -g WixToolset.UI.wixext/5.0.2'
displayName: Install WiX UI Extension 5.x
- script: 'dotnet run --project "./scripts/Scripts/Scripts.csproj" -- build-nexus-installer 2>&1'
displayName: Build Nexus Installer
- task: TrustedSigning@0
displayName: Signing Nexus
inputs:
AzureTenantID: $(AzureTenantID)
AzureClientID: $(AzureClientID)
AzureClientSecret: $(AzureClientSecret)
AzureClientSendCertificateChain: false
Endpoint: 'https://weu.codesigning.azure.net/'
TrustedSigningAccountName: 'CentronCodesigning'
CertificateProfileName: 'centroncert'
FileDigest: 'SHA256'
Files: $(Build.SourcesDirectory)\deployment\WixSharpInstaller\bin\Release\net10.0-windows\c-entron Nexus.msi
- script: 'dotnet run --project "./scripts/Scripts/Scripts.csproj" -- zip-nexus-singleFile 2>&1'
displayName: Zip Nexus Installer
@@ -0,0 +1,64 @@
# Template for Web Service build, signing, and installer creation
parameters:
- name: isDevBuild
type: string
steps:
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- build-web-service-only 2>&1'
displayName: Build Web-Service
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- task: TrustedSigning@0
displayName: Signing Web-Service
inputs:
AzureTenantID: $(AzureTenantID)
AzureClientID: $(AzureClientID)
AzureClientSecret: $(AzureClientSecret)
AzureClientSendCertificateChain: false
Endpoint: 'https://weu.codesigning.azure.net/'
TrustedSigningAccountName: 'CentronCodesigning'
CertificateProfileName: 'centroncert'
FileDigest: 'SHA256'
Files: |
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\Centron.Host.WindowsService.exe
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\Centron.Host.WindowsService.dll
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\ConnectionManager\c-entron Connection Manager.exe
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\ConnectionManager\c-entron Connection Manager.dll
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\Centron.Interfaces.dll
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\Centron.WebServices.Core.dll
$(Build.SourcesDirectory)\src\webservice\Centron.Host.WindowsService\bin\Release\net10.0-windows\win-x64\publish\Centron.Core.dll
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- set-dependencies-web-service 2>&1'
displayName: Set Web-Service Dependencies
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- build-web-service-installer-only 2>&1'
displayName: Build Web-Service Installer
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- task: TrustedSigning@0
displayName: Signing Web-Service Installer
inputs:
AzureTenantID: $(AzureTenantID)
AzureClientID: $(AzureClientID)
AzureClientSecret: $(AzureClientSecret)
AzureClientSendCertificateChain: false
Endpoint: 'https://weu.codesigning.azure.net/'
TrustedSigningAccountName: 'CentronCodesigning'
CertificateProfileName: 'centroncert'
FileDigest: 'SHA256'
FilesFolder: '$(Build.SourcesDirectory)\deployment\centron\WebServiceSetupProject\bin\Release'
FilesFolderFilter: 'exe,dll,msi'
FilesFolderRecurse: true
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- set-zip-directory-web-service 2>&1'
displayName: Set Web-Service Zip-Directory
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
@@ -0,0 +1,46 @@
# Template for deploying artifacts to NuGet, Azure Pipelines, and SharePoint
steps:
# NuGet Package Deployments
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
displayName: 'Deploy Artifact: Centron.WebServices.Core Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.WebServices.Core.*.nupkg'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
displayName: 'Deploy Artifact: Centron.Interfaces Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.Interfaces.*.nupkg'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
displayName: 'Deploy Artifact: Centron.Core Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.Core.*.nupkg'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
displayName: 'Deploy Artifact: Centron.Controls Nuget Package (NuGet)'
continueOnError: true
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'c-entron NuGet Server'
allowPackageConflicts: true
packagesToPush: 'artifacts/nuget/Centron.Controls.*.nupkg'
@@ -0,0 +1,45 @@
steps:
# SharePoint Deployments
- task: razorspoint.rp-build-release-pnptasks.RP-PnPPowerShell.PnPPowerShell@3
displayName: 'Deploy Artifact: c-entron.NET Installer (SharePoint)'
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
continueOnError: true
inputs:
SharePointVersion: SpOnline
sharepointConntection: 'Software Builds - SharePoint'
FileOrInline: Inline
RequiredVersion: '3.23.2007.1'
PnPPowerShellInline: |
$versionTemp = [Version]"$(version)"
$mainVersion = $versionTemp.ToString(3)
$file = Add-PnpFile -Folder "/Shared Documents/c-entron.NET/v$mainVersion/v$versionTemp" -Path "artifacts\c-entron.NET Installer.zip"
- task: razorspoint.rp-build-release-pnptasks.RP-PnPPowerShell.PnPPowerShell@3
displayName: 'Deploy Artifact: c-entron Web-Service Installer (SharePoint)'
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
continueOnError: true
inputs:
SharePointVersion: SpOnline
sharepointConntection: 'Software Builds - SharePoint'
FileOrInline: Inline
RequiredVersion: '3.23.2007.1'
PnPPowerShellInline: |
$versionTemp = [Version]"$(version)"
$mainVersion = $versionTemp.ToString(3)
$file = Add-PnpFile -Folder "/Shared Documents/c-entron Web-Service/v$mainVersion/v$versionTemp" -Path "artifacts\c-entron Web-Service Installer.zip"
- task: razorspoint.rp-build-release-pnptasks.RP-PnPPowerShell.PnPPowerShell@3
condition: and(succeeded(), eq(variables['set_upload_flag.ShouldUpload'], 'true'))
displayName: 'Upload Artifact to SharePoint: c-entron Nexus'
continueOnError: true
inputs:
SharePointVersion: SpOnline
sharepointConntection: 'Software Builds - SharePoint'
FileOrInline: Inline
RequiredVersion: '3.23.2007.1'
PnPPowerShellInline: |
$versionTemp = [Version]"$(version)"
$mainVersion = $versionTemp.ToString(3)
$file = Add-PnpFile -Folder "/Shared Documents/c-entron Nexus/v$mainVersion/v$versionTemp" -Path "artifacts\c-entron Nexus Installer.zip"
@@ -0,0 +1,37 @@
steps:
# Azure Pipeline Artifacts
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron.NET Installer'
inputs:
targetPath: './artifacts/c-entron.NET Installer.zip'
artifactName: 'c-entron.NET Installer'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron Web-Service Installer'
inputs:
targetPath: './artifacts/c-entron Web-Service Installer.zip'
artifactName: 'c-entron Web-Service Installer'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron Web-Service Dependencies'
inputs:
targetPath: './artifacts/c-entron Web-Service Dependencies.txt'
artifactName: 'c-entron Web-Service Dependencies'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: c-entron.NET Dependencies'
inputs:
targetPath: './artifacts/c-entron.NET Dependencies.txt'
artifactName: 'c-entron.NET Dependencies'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact: Nuget Packages'
inputs:
targetPath: './artifacts/nuget'
artifactName: 'Nuget Packages'
- task: PublishPipelineArtifact@1
displayName: 'Upload Artifact to Azure Pipelines: c-entron Nexus'
inputs:
targetPath: './artifacts/c-entron Nexus Installer.zip'
artifactName: 'c-entron Nexus Installer'
@@ -0,0 +1,24 @@
# Template for versioning setup and build number configuration
parameters:
- name: isDevBuild
type: string
steps:
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- setup-versioning 2>&1'
displayName: 'Setup Versioning'
env:
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
- powershell: |
$versionNumber = [Version][string] (& "$env:BUILD_SOURCESDIRECTORY\dotnettools\nbgv.exe" get-version -v Version 2>&1);
$isPullRequestBuild = $env:BUILD_REASON -eq 'PullRequest';
$version = if ($isPullRequestBuild) { "$versionNumber (PR)" } else { "$versionNumber" };
Write-Host "##vso[build.updatebuildnumber]$version"
Write-Host "##vso[task.setvariable variable=version]$versionNumber"
displayName: 'Set Azure DevOps Build Version'
- script: 'dotnet run --project "./scripts/Centron.Scripts/Centron.Scripts.csproj" -- create-nuget-packages 2>&1'
displayName: Clean and set Version and create Nuget-Packages
env:
CENTRON_BUILD_RUNNING_IN_AZURE_PIPELINE: true
CENTRON_BUILD_IS_DEV_BUILD: ${{ parameters.isDevBuild }}
@@ -0,0 +1,71 @@
trigger:
- master
- release/*
pool:
vmImage: 'ubuntu-latest'
variables:
DOCKER_BUILDKIT: 1
steps:
# to avoid shallow clone error from versioning
# https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/cloudbuild.md#azure-pipelines
- checkout: self
fetchDepth: 0
- script: |
versionNumber="$(nbgv get-version -v Version)"
versionNumberShort="${versionNumber%.*}"
gitCommitId="$(nbgv get-version -v GitCommitIdShort)"
echo "##vso[build.updatebuildnumber]$versionNumber"
echo "##vso[task.setvariable variable=versionNumber;isoutput=true]$versionNumber"
echo "##vso[task.setvariable variable=gitCommitId;isoutput=true]$gitCommitId"
echo "##vso[task.setvariable variable=versionNumberShort;isoutput=true]$versionNumberShort"
displayName: 'Set Azure DevOps Build Version'
name: 'versionSetup'
workingDirectory: 'deployment/centron'
- task: Docker@2
displayName: Login to Azure Container Registry
inputs:
command: login
containerRegistry: centronACR
- task: Docker@2
displayName: Build image
inputs:
command: build
containerRegistry: centronACR
repository: centron_webservice
tags: $(versionSetup.versionNumber),$(versionSetup.versionNumberShort),latest
Dockerfile: docker/c-entron-webservice/Dockerfile
arguments: "--build-arg centron_version=$(versionSetup.versionNumber) --build-arg centron_git_commit=$(versionSetup.gitCommitId) --build-arg dx_license=$(DX_LICENSE)"
buildContext: .
- task: Docker@2
displayName: push webservice image
inputs:
command: push
containerRegistry: centronACR
repository: centron_webservice
tags: $(versionSetup.versionNumber),$(versionSetup.versionNumberShort),latest
- task: Docker@2
displayName: Build nexus image
inputs:
command: build
containerRegistry: CentronACR
repository: centron_nexus
tags: $(versionSetup.versionNumber),$(versionSetup.versionNumberShort),latest
Dockerfile: docker/Dockerfile
buildContext: .
arguments: "--build-arg dx_license=$(DX_LICENSE)"
- task: Docker@2
displayName: Push nexus image
inputs:
command: push
containerRegistry: CentronACR
repository: centron_nexus
tags: $(versionSetup.versionNumber),$(versionSetup.versionNumberShort),latest
@@ -0,0 +1,92 @@
trigger:
- master
- release/*
pool: Tests
variables:
ArtifactsDirectory: $(Pipeline.Workspace)/artifacts
ArtifactsFileName: $(Pipeline.Workspace)/artifacts/EndToEndTests/TestResults.trx
DB_SERVER: db
DB_USERNAME: sa
DB_PASSWORD: SA!password
DB_PORT: 1433
DB_BACKUP_PATH: /var/opt/mssql/backup/DatabaseBackup.bak
resources:
containers:
- container: db
image: centron.azurecr.io/centron_db/regression_tests:latest
endpoint: centronACR
env:
MSSQL_SA_PASSWORD: $(DB_PASSWORD)
ACCEPT_EULA: Y
MSSQL_PID: Standard
DB_TRUST_SERVER_CERTIFICATE: true
DB_ENCRYPT: no
options: --name $(DB_SERVER)
ports:
- $(DB_PORT):$(DB_PORT)
services:
db: db
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchDepth: 1
fetchTags: false
# Step: Install .NET SDK (version from global.json)
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
packageType: 'sdk'
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'
- script: >-
dotnet build
"./tests/Centron.Tests.EndToEnd/Centron.Tests.EndToEnd.csproj"
-c Release
-f net10.0
-nodeReuse:false
displayName: Build Regression Tests
- script: >-
dotnet test
"./tests/Centron.Tests.EndToEnd/Centron.Tests.EndToEnd.csproj"
-c Release
-f net10.0
--no-build
--logger "trx;LogFileName=$(ArtifactsFileName)"
--results-directory "$(ArtifactsDirectory)"
-nodeReuse:false
displayName: Run Regression Tests
env:
CENTRON_TESTS_DATABASE_SERVER: localhost,$(DB_PORT)
CENTRON_TESTS_DATABASE_USERNAME: $(DB_USERNAME)
CENTRON_TESTS_DATABASE_PASSWORD: $(DB_PASSWORD)
DATABASE_BACKUP_PATH: $(DB_BACKUP_PATH)
MASTER_PASSWORD_SECURE_FILE_FOLDER: $(Pipeline.Workspace)
- task: PublishTestResults@2
displayName: 'Publish Test: c-entron Regression Tests'
condition: always()
inputs:
testResultsFormat: VSTest
testResultsFiles: $(ArtifactsFileName)
testRunTitle: 'c-entron Regression Tests'
buildConfiguration: 'Release'
failTaskOnFailedTests: true
- script: |
echo "== Before prune =="; df -h; docker system df || true
docker system prune -af
echo "== After prune =="; df -h; docker system df || true
displayName: Docker prune (safe)
condition: always()
continueOnError: true
@@ -0,0 +1,162 @@
trigger:
- master
- releases/*
pool: QuickTest
variables:
DOCKER_BUILDKIT: 1
SA_PASSWORD: SA!password
HARDWARE_ID: LinuxV1.ZDhiZjhiZjgtMjIwNS00MWQ1LThiMGEtMjM2ZjZhMzc2MGMz
resources:
containers:
- container: db
endpoint: centronACR
image: centron.azurecr.io/centron_db/version2:0213def19b183ffb83ce9649468ad914384c0bcb
env:
MSSQL_SA_PASSWORD: $(SA_PASSWORD)
ports:
- 1433:1433
options: --name db
# When an integration test uses emails, uncomment this (+ in the services) to add the mailcatcher container
# - container: smtp
# endpoint: centronACR
# image: centron.azurecr.io/mailcatcher:latest
# ports:
# - 1025:1025
# - 1080:1080
# options: --name centron-smtp-1
jobs:
- job: run
displayName: Run unit & integration tests
services:
db: db
# centron-smtp-1: smtp
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
packageType: 'sdk'
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'
- script: 'cp ./src/webservice/Centron.Host.Console/additional.props.docker ./src/webservice/Centron.Host.Console/additional.props'
displayName: Move config
- script: 'rm ./src/webservice/Centron.Host.Console/app.config'
displayName: Remove config
- script: |
versionNumber="$(/home/centron/.dotnet/tools/nbgv get-version -v Version)"
gitCommitId="$(/home/centron/.dotnet/tools/nbgv get-version -v GitCommitIdShort)"
echo "versionNumber: $versionNumber"
echo "gitCommitId: $gitCommitId"
sed -i "s/<Version>1.0.0.0<\/Version>/<Version>$versionNumber<\/Version>/" ../../Directory.Build.props
sed -i "s/<GitCommitId><\/GitCommitId>/<GitCommitId>$gitCommitId<\/GitCommitId>/" ../../Directory.Build.props
displayName: 'Set Azure DevOps Build Version'
workingDirectory: 'deployment/centron'
- script: 'dotnet build "./src/webservice/Centron.Host.Console/Centron.Host.Console.csproj"'
displayName: Build webservice
- script: 'cp ./tests/Centron.Tests.Integration/WebServiceConfig.xml ./src/webservice/Centron.Host.Console/bin/Debug/net10.0/WebServiceConfig.xml'
displayName: Copy config
- script: 'dotnet run --project "./src/webservice/Centron.Host.Console/Centron.Host.Console.csproj" > webservice.txt &'
env:
HARDWARE_ID: $(HARDWARE_ID)
displayName: Run webservice
- script: |
max_retries=30
counter=0
until $(curl --output /dev/null --silent --fail http://localhost:1234/CentronService); do
if [ $counter -eq $max_retries ]; then
echo "Failed to start webservice"
exit 1
fi
counter=$((counter+1))
echo "Waiting for webservice..."
sleep 1
done
displayName: Wait for webservice
- script: >
dotnet test "./tests/backend/Centron.Tests.BL/Centron.Tests.BL.csproj"
--logger "trx;LogFileName=TestResults.trx"
--results-directory "artifacts/tests/backend/bl/"
displayName: 'Run unit tests for backend/Centron.BL'
- task: PublishTestResults@2
condition: always()
displayName: 'Publish unit tests for backend/Centron.BL'
inputs:
testResultsFormat: VSTest
testResultsFiles: 'artifacts/tests/backend/bl/TestResults.trx'
testRunTitle: 'backend/Centron.Tests.BL'
buildConfiguration: 'Release'
failTaskOnFailedTests: true
mergeTestResults: true
- script: >
dotnet test "./tests/backend/Centron.Tests.DAO/Centron.Tests.DAO.csproj"
--logger "trx;LogFileName=TestResults.trx"
--results-directory "artifacts/tests/backend/dao/"
displayName: 'Run unit tests for backend/Centron.DAO'
- task: PublishTestResults@2
condition: always()
displayName: 'Publish unit tests for backend/Centron.DAO'
inputs:
testResultsFormat: VSTest
testResultsFiles: 'artifacts/tests/backend/dao/TestResults.trx'
testRunTitle: 'backend/Centron.Tests.DAO'
buildConfiguration: 'Release'
failTaskOnFailedTests: true
mergeTestResults: true
- script: >
dotnet test "./tests/shared/Centron.Tests.Core/Centron.Tests.Core.csproj"
--logger "trx;LogFileName=TestResults.trx"
--results-directory "artifacts/tests/shared/core/"
displayName: 'Run unit tests for shared/Centron.Core'
- task: PublishTestResults@2
condition: always()
displayName: 'Publish unit tests for shared/Centron.Core'
inputs:
testResultsFormat: VSTest
testResultsFiles: 'artifacts/tests/shared/core/TestResults.trx'
testRunTitle: 'shared/Centron.Tests.Core'
buildConfiguration: 'Release'
failTaskOnFailedTests: true
mergeTestResults: true
# Integration tests temporarily disabled
# - script: >
# dotnet test "./tests/Centron.Tests.Integration/Centron.Tests.Integration.csproj"
# --logger "trx;LogFileName=TestResults.trx"
# --results-directory "artifacts/tests/integration/"
# displayName: 'Run integration tests'
# - task: PublishTestResults@2
# condition: always()
# displayName: 'Publish integration tests'
# inputs:
# testResultsFormat: VSTest
# testResultsFiles: 'artifacts/tests/integration/TestResults.trx'
# testRunTitle: 'Centron.Tests.Integration'
# buildConfiguration: 'Release'
# failTaskOnFailedTests: true
# mergeTestResults: true
- script: |
pkill -f "Centron.Host.Console" || true
displayName: 'Cleanup webservice'
condition: always()
- publish: webservice.txt
artifact: webservice_$(System.JobAttempt)
displayName: Publish webservice log
condition: always()
continueOnError: true
- script: docker image prune -f --filter "dangling=true"
displayName: Cleanup dangling images
condition: always()
continueOnError: true