From 8f8a419ea3a95fb4a1b39f108df3d710c288bcea Mon Sep 17 00:00:00 2001 From: Bernie White Date: Tue, 18 Jul 2023 15:37:08 +1000 Subject: [PATCH] Clean up old pipelines (#259) --- .azure-pipelines/azure-pipelines.yaml | 193 ----------------------- .azure-pipelines/jobs/test.yaml | 71 --------- .azure-pipelines/jobs/testContainer.yaml | 76 --------- 3 files changed, 340 deletions(-) delete mode 100644 .azure-pipelines/azure-pipelines.yaml delete mode 100644 .azure-pipelines/jobs/test.yaml delete mode 100644 .azure-pipelines/jobs/testContainer.yaml diff --git a/.azure-pipelines/azure-pipelines.yaml b/.azure-pipelines/azure-pipelines.yaml deleted file mode 100644 index 017872d..0000000 --- a/.azure-pipelines/azure-pipelines.yaml +++ /dev/null @@ -1,193 +0,0 @@ -# Azure DevOps -# CI pipeline for PSDocs - -variables: - version: '0.10.0' - buildConfiguration: 'Release' - disable.coverage.autogenerate: 'true' - imageName: 'ubuntu-22.04' - - # Use build number format, i.e. 0.10.0-B2204001 -name: $(version)-B$(date:yyMM)$(rev:rrr) - -trigger: - branches: - include: - - 'main' - tags: - include: - - 'v0.*' - -pr: none - -stages: - -# Build pipeline -- stage: Build - displayName: Build - dependsOn: [] - jobs: - - job: - pool: - vmImage: $(imageName) - displayName: 'Module' - steps: - - # Install pipeline dependencies - - powershell: ./scripts/pipeline-deps.ps1 - displayName: 'Install dependencies' - - # Build module - - powershell: Invoke-Build -Configuration $(buildConfiguration) -Build $(Build.BuildNumber) - displayName: 'Build module' - - # DotNet test results - - task: PublishTestResults@2 - displayName: 'Publish unit test results' - inputs: - testRunTitle: 'DotNet on $(imageName)' - testRunner: VSTest - testResultsFiles: 'reports/*.trx' - mergeTestResults: true - platform: $(imageName) - configuration: $(buildConfiguration) - publishRunAttachments: true - condition: succeededOrFailed() - - # PSRule results - - task: PublishTestResults@2 - displayName: 'Publish PSRule results' - inputs: - testRunTitle: 'PSRule on $(imageName)' - testRunner: NUnit - testResultsFiles: 'reports/ps-rule*.xml' - mergeTestResults: true - platform: $(imageName) - configuration: $(buildConfiguration) - publishRunAttachments: true - condition: succeededOrFailed() - - # Generate artifacts - - publish: out/modules/PSDocs - displayName: 'Publish module' - artifact: PSDocs - -# Analysis pipeline -- stage: Analysis - displayName: Analysis - dependsOn: [] - jobs: - - job: - pool: - vmImage: $(imageName) - displayName: 'SonarCloud' - condition: not(eq(variables['Build.Reason'], 'PullRequest')) - steps: - - - script: | - echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)" - echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)\bin;$(PATH)" - displayName: 'Set Java version' - - # Run SonarCloud analysis - - script: dotnet tool install --global dotnet-sonarscanner - displayName: 'Install Sonar scanner' - - - script: $HOME/.dotnet/tools/dotnet-sonarscanner begin /k:"BernieWhite_PSDocs" /o:"berniewhite-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=$(sonarQubeToken) /v:"$(Build.BuildNumber)" /d:sonar.cs.vscoveragexml.reportsPaths="reports/" /d:sonar.cs.xunit.reportsPaths="reports/" - displayName: 'Prepare SonarCloud' - - - script: dotnet build - displayName: 'Build solution for analysis' - - - script: $HOME/.dotnet/tools/dotnet-sonarscanner end /d:sonar.login=$(sonarQubeToken) - displayName: 'Complete SonarCloud' - - - job: Secret_Scan - pool: - vmImage: 'windows-2022' - displayName: Secret scan - steps: - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 - displayName: 'Scan for secrets' - inputs: - debugMode: false - toolMajorVersion: V2 - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2 - displayName: 'Publish scan logs' - continueOnError: true - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 - displayName: 'Check for failures' - inputs: - CredScan: true - ToolLogsNotFoundAction: Error - -# Test pipeline -- stage: Test - dependsOn: Build - jobs: - - - template: jobs/test.yaml - parameters: - name: ubuntu_22_04_coverage - imageName: 'ubuntu-22.04' - displayName: 'PowerShell coverage' - coverage: 'true' - publishResults: 'false' - - - template: jobs/test.yaml - parameters: - name: macOS_10_15 - displayName: 'PowerShell 7.3 - macOS-11' - imageName: 'macOS-11' - - - template: jobs/test.yaml - parameters: - name: ps_5_1_windows_2022 - displayName: 'PowerShell 5.1 - Windows 2022' - imageName: 'windows-2022' - pwsh: 'false' - - - template: jobs/test.yaml - parameters: - name: ps_7_3_windows_2022 - displayName: 'PowerShell 7.3 - Windows 2022' - imageName: 'windows-2022' - - - template: jobs/testContainer.yaml - parameters: - name: ps_7_3_ubuntu_22_04 - displayName: 'PowerShell 7.3 - ubuntu-22.04' - imageName: mcr.microsoft.com/powershell - imageTag: 7.3-ubuntu-22.04 - -# Release pipeline -- stage: Release - displayName: Release - dependsOn: [ 'Test', 'Analysis' ] - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v0.')) - jobs: - - job: - displayName: Live - pool: - vmImage: $(imageName) - variables: - isPreRelease: $[contains(variables['Build.SourceBranchName'], '-B')] - steps: - - # Download module from build - - task: DownloadPipelineArtifact@2 - displayName: 'Download module' - inputs: - artifact: PSDocs - path: $(Build.SourcesDirectory)/out/modules/PSDocs - - # Install pipeline dependencies - - powershell: ./scripts/pipeline-deps.ps1 - displayName: 'Install dependencies' - - # Install pipeline dependencies and build module - - powershell: Invoke-Build Release -ApiKey $(apiKey) - displayName: 'Publish module' diff --git a/.azure-pipelines/jobs/test.yaml b/.azure-pipelines/jobs/test.yaml deleted file mode 100644 index 745be48..0000000 --- a/.azure-pipelines/jobs/test.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Azure DevOps -# CI job for running VM pipelines - -parameters: - name: '' - displayName: '' - buildConfiguration: 'Release' - imageName: '' - coverage: 'false' - publishResults: 'true' - -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - pool: - vmImage: ${{ parameters.imageName }} - variables: - COVERAGE: ${{ parameters.coverage }} - PUBLISHRESULTS: ${{ parameters.publishResults }} - skipComponentGovernanceDetection: true - steps: - - # Install pipeline dependencies - - powershell: ./scripts/pipeline-deps.ps1 - displayName: 'Install dependencies' - - # Download module - - task: DownloadPipelineArtifact@2 - displayName: 'Download module' - inputs: - artifact: PSDocs - path: $(Build.SourcesDirectory)/out/modules/PSDocs - - # Build module - - powershell: Invoke-Build TestModule -Configuration ${{ parameters.buildConfiguration }} -Build $(Build.BuildNumber) - env: - COVERAGE: ${{ parameters.coverage }} - displayName: 'Test module' - - # Pester test results - - task: PublishTestResults@2 - displayName: 'Publish Pester results' - inputs: - testRunTitle: 'Pester on ${{ parameters.imageName }}' - testRunner: NUnit - testResultsFiles: 'reports/pester-unit.xml' - mergeTestResults: true - platform: ${{ parameters.name }} - configuration: ${{ parameters.buildConfiguration }} - publishRunAttachments: true - condition: and(succeededOrFailed(), eq(variables['PUBLISHRESULTS'], 'true')) - - # Generate Code Coverage report - - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4 - displayName: 'Code coverage report generator' - inputs: - reports: 'reports/pester-coverage.xml' - targetdir: 'reports/coverage' - sourcedirs: 'src/PSDocs' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;SonarQube;Badges' - tag: $(Build.BuildNumber) - condition: eq(variables['COVERAGE'], 'true') - - # Publish Code Coverage report - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Pester code coverage' - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: 'reports/coverage/Cobertura.xml' - reportDirectory: 'reports/coverage' - condition: eq(variables['COVERAGE'], 'true') diff --git a/.azure-pipelines/jobs/testContainer.yaml b/.azure-pipelines/jobs/testContainer.yaml deleted file mode 100644 index 490fb4e..0000000 --- a/.azure-pipelines/jobs/testContainer.yaml +++ /dev/null @@ -1,76 +0,0 @@ -# Azure DevOps -# CI job for running container pipelines - -parameters: - name: '' - displayName: '' - buildConfiguration: 'Release' - vmImage: 'ubuntu-22.04' - imageName: '' - imageTag: '' - coverage: 'false' - publishResults: 'true' - -jobs: -- job: ${{ parameters.name }} - displayName: ${{ parameters.displayName }} - pool: - vmImage: ${{ parameters.vmImage }} - container: - image: '${{ parameters.imageName }}:${{ parameters.imageTag }}' - env: - COVERAGE: ${{ parameters.coverage }} - PUBLISHRESULTS: ${{ parameters.publishResults }} - variables: - COVERAGE: ${{ parameters.coverage }} - PUBLISHRESULTS: ${{ parameters.publishResults }} - skipComponentGovernanceDetection: true - steps: - - # Install pipeline dependencies - - powershell: ./scripts/pipeline-deps.ps1 - displayName: 'Install dependencies' - - # Download module - - task: DownloadPipelineArtifact@2 - displayName: 'Download module' - inputs: - artifact: PSDocs - path: $(Build.SourcesDirectory)/out/modules/PSDocs - - # Build module - - powershell: Invoke-Build TestModule -Configuration ${{ parameters.buildConfiguration }} -Build $(Build.BuildNumber) - displayName: 'Test module' - - # Pester test results - - task: PublishTestResults@2 - displayName: 'Publish Pester results' - inputs: - testRunTitle: 'Pester on ${{ parameters.imageTag }}' - testRunner: NUnit - testResultsFiles: 'reports/pester-unit.xml' - mergeTestResults: true - platform: ${{ parameters.imageTag }} - configuration: ${{ parameters.buildConfiguration }} - publishRunAttachments: true - condition: and(succeededOrFailed(), eq(variables['PUBLISHRESULTS'], 'true')) - - # Generate Code Coverage report - - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4 - displayName: 'Code coverage report generator' - inputs: - reports: 'reports/pester-coverage.xml' - targetdir: 'reports/coverage' - sourcedirs: 'src/PSDocs' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;SonarQube;Badges' - tag: $(Build.BuildNumber) - condition: eq(variables['COVERAGE'], 'true') - - # Publish Code Coverage report - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Pester code coverage' - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: 'reports/coverage/Cobertura.xml' - reportDirectory: 'reports/coverage' - condition: eq(variables['COVERAGE'], 'true')