Skip to content

Commit

Permalink
Fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored and kilasuit committed Aug 28, 2024
1 parent 5cd23a0 commit 7d7c962
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 49 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
for more information).
- Updated pipeline file `RequiredModules.ps1` to latest pipeline pattern.
- Updated pipeline file `build.yaml` to latest pipeline pattern.
- Updated pipeline file `azure-pipelines.yml` to use correct images (hosted runners)
and correct task for artifacts.
- AzDevOpsProject
- Added a validate set to the parameter `SourceControlType` to (for now)
limit the parameter to the values `Git` and `Tfvc`.
Expand Down
98 changes: 49 additions & 49 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,35 @@ trigger:
include:
- main
paths:
exclude:
- CHANGELOG.md
include:
- source/*
tags:
include:
- "v*"
exclude:
- "*-*"

variables:
buildFolderName: output
buildArtifactName: output

stages:
- stage: Build
jobs:
- job: Package_Module
displayName: 'Package Module'
pool:
vmImage: 'ubuntu 16.04'
vmImage: 'windows-latest'
steps:
- task: GitVersion@5
name: gitVersion
displayName: 'Evaluate Next Version'
inputs:
runtime: 'core'
configFilePath: 'GitVersion.yml'

- pwsh: |
dotnet tool install --global GitVersion.Tool
$gitVersionObject = dotnet-gitversion | ConvertFrom-Json
$gitVersionObject.PSObject.Properties.ForEach{
Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'."
Write-Host -Object "##vso[task.setvariable variable=$($_.Name);]$($_.Value)"
}
Write-Host -Object "##vso[build.updatebuildnumber]$($gitVersionObject.FullSemVer)"
displayName: Calculate ModuleVersion (GitVersion)
- task: PowerShell@2
name: package
displayName: 'Build & Package Module'
Expand All @@ -34,14 +40,14 @@ stages:
arguments: '-ResolveDependency -tasks pack'
pwsh: true
env:
ModuleVersion: $(gitVersion.NuGetVersionV2)

- task: PublishBuildArtifacts@1
ModuleVersion: $(NuGetVersionV2)
- task: PublishPipelineArtifact@1
displayName: 'Publish Build Artifact'
inputs:
pathToPublish: 'output/'
artifactName: 'output'
publishLocation: 'Container'
targetPath: '$(buildFolderName)/'
artifact: $(buildArtifactName)
publishLocation: 'pipeline'
parallel: true

- stage: Test
dependsOn: Build
Expand All @@ -52,13 +58,12 @@ stages:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PowerShell@2
name: test
displayName: 'Run HQRM Test'
Expand All @@ -73,20 +78,20 @@ stages:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'HQRM'

- job: test_unit_linux
condition: succeededOrFailed()
displayName: 'Linux - Unit Tests'
timeoutInMinutes: 0
pool:
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'

- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
Expand Down Expand Up @@ -123,15 +128,14 @@ stages:
displayName: 'Windows (PowerShell Core) - Unit Tests'
timeoutInMinutes: 0
pool:
vmImage: 'windows-2019'
vmImage: 'windows-latest'
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'

- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
Expand Down Expand Up @@ -173,15 +177,14 @@ stages:
# This sets environment variable $env:CONFIGURATION.
configuration: Integration
pool:
vmImage: 'windows-2019'
vmImage: 'windows-latest'
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'

- task: PowerShell@2
name: configureWinRM
Expand Down Expand Up @@ -222,15 +225,14 @@ stages:
displayName: 'Windows (Windows PowerShell) - Unit Tests'
timeoutInMinutes: 0
pool:
vmImage: 'windows-2019'
vmImage: 'windows-latest'
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'

- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
Expand Down Expand Up @@ -272,13 +274,12 @@ stages:
pool:
vmImage: 'macos-latest'
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'

- powershell: |
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
Expand Down Expand Up @@ -327,15 +328,14 @@ stages:
- job: Deploy_Module
displayName: 'Deploy Module'
pool:
vmImage: 'ubuntu 16.04'
vmImage: 'ubuntu-latest'
steps:
- task: DownloadBuildArtifacts@0
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PowerShell@2
name: publishRelease
displayName: 'Publish Release'
Expand Down

0 comments on commit 7d7c962

Please sign in to comment.