Skip to content

Commit

Permalink
few DevOps solutions changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maslinin committed Feb 28, 2024
1 parent 3accec2 commit 29875eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions DevOps/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# DevOps solutions

## Analysis of multiple projects in solution
You can use the *PowerShell* script ```SolutionScanner.ps1``` to analyze the output artifacts of the entire solution by using *Consyzer*.
## Analysis of multiple projects in the solution
You can use the *PowerShell* script ```SolutionScanner.ps1``` to analyze the output artifacts of the entire solution by using Consyzer.
In other words, this script allows you to analyze the artifacts of all projects in the solution.
For example, it can be useful in the *CI/CD pipeline*.
It can be useful in the *CI/CD pipeline*.

To run the script, use the following command:
```SolutionScanner.ps1 C:\Consyzer.exe C:\SolutionToBeAnalyzed ".exe, .dll" Release```, where
1) *SolutionScanner.ps1* - name of the Powershell script (or its path),
2) *C:\Consyzer.exe* - path to the Consyzer utility,
2) *C:\Consyzer.exe* - path to Consyzer utility,
3) *C:\SolutionToBeAnalyzed* - path to the analyzed solution,
4) *".exe, .dll"* - files extensions to be analyzed,
4) *".exe, .dll"* - files search pattern to be analyzed,
5) *Release* - solution build configuration.

You can also use the following task if you want to analyze in Azure Pipelines CI:
You can use the following task for analysis if you are using Azure Pipelines:
```
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)\Consyzer.ps1'
filePath: '$(Build.SourcesDirectory)\SolutionAnalyzer.ps1'
arguments: >
-pathToConsyzer '$YourPathToConsyzer'
-solutionForAnalysis '--AnalysisDirectory $(Build.SourcesDirectory)'
-fileExtensions '--SearchPattern "*.exe, *.dll"'
-pathToConsyzer '$PathToConsyzer'
-solutionForAnalysis '$(Build.SourcesDirectory)'
-fileExtensions '"*.exe, *.dll"'
-buildConfiguration '$YourBuildConfiguration'
displayName: 'Consyzer Analysis'
```
14 changes: 7 additions & 7 deletions DevOps/SolutionAnalyzer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ param(
[String]$searchPattern = "*.exe, *.dll",

[Parameter(HelpMessage={ "Build configuration to use. Default is $buildConfiguration." })]
[String]$buildConfiguration = "Debug"
[String]$buildConfiguration = "Release"
)

$defaultSearchParams = @{
Expand All @@ -34,18 +34,18 @@ $analysisFolders = $pathsToAnalysisFiles | ForEach-Object { $_.DirectoryName } |
$finalExitCode = -1
$messageBuilder = New-Object System.Text.StringBuilder
foreach ($folder in $analysisFolders) {
& $pathToConsyzer $folder $searchPattern
& $pathToConsyzer --AnalysisDirectory $folder --SearchPattern $searchPattern
if ( $LASTEXITCODE -ge $finalExitCode ) {
$finalExitCode = $LASTEXITCODE
}

# Scan project artifacts for consistency
$exitCodeMessages = @{
0 = "Successfully: $folder. No consistency problems were found."
1 = "Warning: $folder. One or more DLL components used in the project are on an absolute path."
2 = "Warning: $folder. One or more DLL components used in the project are on a relative path."
3 = "Warning: $folder. One or more DLL components used in the project are located on the system path."
4 = "Error: $folder. One or more DLL components used in the project were not found in the expected path."
0 = "Successfully: $folder. Consistency problems have not been found."
1 = "Warning: $folder. One or more DLL components used in the project are on the absolute path."
2 = "Warning: $folder. One or more DLL components used in the project are on the relative path."
3 = "Warning: $folder. One or more DLL components used in the project are in the system directory."
4 = "Error: $folder. One or more DLL components used in the project have not been found on the expected path."
}

$messageBuilder.AppendLine($exitCodeMessages[$LASTEXITCODE])
Expand Down

0 comments on commit 29875eb

Please sign in to comment.