diff --git a/README.md b/README.md index 9a68f95c8..edc33ec7d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # VSTeam +[![Build Status](https://dev.azure.com/LoECDA/Team%20Module/_apis/build/status/MethodsAndPractices.vsteam?branchName=master)](https://dev.azure.com/LoECDA/Team%20Module/_build/latest?definitionId=62&branchName=master) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/DarqueWarrior/vsteam/blob/master/LICENSE) [![Documentation - VSTeam](https://img.shields.io/badge/Documentation-VSTeam-blue.svg)](https://github.com/DarqueWarrior/vsteam/blob/master/docs/readme.md) [![PowerShell Gallery - VSTeam](https://img.shields.io/badge/PowerShell%20Gallery-VSTeam-blue.svg)](https://www.powershellgallery.com/packages/VSTeam) @@ -29,30 +30,6 @@ Install this module from the [PowerShell Gallery](https://www.powershellgallery. [Change Log](CHANGELOG.md) -## Pipeline Status - -You can review the status of every stage of the pipeline below. - -| Stage | Status | -|-------------------------------------|------------------------------| -| Build | [![Build status](https://loecda.visualstudio.com/Team%20Module/_apis/build/status/CI)](https://loecda.visualstudio.com/Team%20Module/_build/latest?definitionId=52)| -| Linux Team Foundation Server 2017 | [![Environment status](https://loecda.vsrm.visualstudio.com/_apis/public/Release/badge/3e857acd-880f-4056-a46b-1de672ca55cc/1/7)](https://loecda.visualstudio.com/Team%20Module/_releases2?definitionId=1&view=mine&_a=releases) | -| macOS Team Foundation Server 2017 | [![Environment status](https://loecda.vsrm.visualstudio.com/_apis/public/Release/badge/3e857acd-880f-4056-a46b-1de672ca55cc/1/6)](https://loecda.visualstudio.com/Team%20Module/_releases2?definitionId=1&view=mine&_a=releases) | -| Windows Team Foundation Server 2017 | [![Environment status](https://loecda.vsrm.visualstudio.com/_apis/public/Release/badge/3e857acd-880f-4056-a46b-1de672ca55cc/1/2)](https://loecda.visualstudio.com/Team%20Module/_releases2?definitionId=1&view=mine&_a=releases) | -| Windows Team Foundation Server 2018 | [![Environment status](https://loecda.vsrm.visualstudio.com/_apis/public/Release/badge/3e857acd-880f-4056-a46b-1de672ca55cc/1/5)](https://loecda.visualstudio.com/Team%20Module/_releases2?definitionId=1&view=mine&_a=releases) | -| Windows Azure DevOps | [![Environment status](https://loecda.vsrm.visualstudio.com/_apis/public/Release/badge/3e857acd-880f-4056-a46b-1de672ca55cc/1/4)](https://loecda.visualstudio.com/Team%20Module/_releases2?definitionId=1&view=mine&_a=releases) | -| Publish to PowerShell Gallery | [![Environment status](https://loecda.vsrm.visualstudio.com/_apis/public/Release/badge/3e857acd-880f-4056-a46b-1de672ca55cc/1/1)](https://loecda.visualstudio.com/Team%20Module/_releases2?definitionId=1&view=mine&_a=releases) | - -The build for VSTeam is run on macOS, Linux and Windows to ensure there are no casing or other platform specific issues with the code. - -![Build](.github/images/build.png) - - On each platform unit tests are run. - - ![Unit Tests](.github/images/unittests.png) - -During the release the module is installed on macOS, Linux and Window and tested against [Azure DevOps Server](https://cda.ms/Bf) and [Azure DevOps](https://cda.ms/Bf) before being published to the PowerShell Gallery. - ## Module Dependencies - [SHiPS module](https://www.powershellgallery.com/packages/SHiPS/) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb5b90d2a..a8e592e9c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -154,7 +154,7 @@ stages: $manifest = Import-PowerShellDataFile .\$(Folder)\*.psd1 # Install each module - $manifest.RequiredModules | ForEach-Object { Install-Module -Name $_ -Repository PSGallery -F -Scope CurrentUser } + $manifest.RequiredModules | ForEach-Object { Install-Module -Name $_ -Repository PSGallery -Force -Scope CurrentUser -Verbose } workingDirectory: '$(Pipeline.Workspace)/Module' - task: PowerShell@2 @@ -165,6 +165,8 @@ stages: # Load the psd1 file so you can read the version $manifest = Import-PowerShellDataFile .\$(Folder)\*.psd1 + Write-Host "Package Version Number: $($manifest.ModuleVersion).$(Build.BuildId)" + Write-Host "##vso[task.setvariable variable=PACKAGE_VERSION;isOutput=false]$($manifest.ModuleVersion).$(Build.BuildId)" workingDirectory: '$(Pipeline.Workspace)/Module' @@ -174,7 +176,10 @@ stages: targetType: 'inline' script: | Install-Module -Name Trackyon.Nuget -Scope CurrentUser -Force -Verbose - ConvertTo-NuSpec -Path ./$(Folder)/VSTeam.psd1 + + Write-Host "Convert psd1 into a NuSpec" + + ConvertTo-NuSpec -Path ./$(Folder)/VSTeam.psd1 -Verbose workingDirectory: '$(Pipeline.Workspace)/Module' - task: NuGetCommand@2 @@ -201,24 +206,23 @@ stages: - template: build/integrationTests.yml parameters: - displayName: 'Linux TFS 2017' + displayName: 'Linux TFS 2018' os: 'Linux' - name: 'LinuxTFS2017' pool: 'ubuntu-16.04' - stop2017: 'true' - apiVersion: 'TFS2017' - depends: 'WindowsTFS2017' - account: 'http://sonarqube.eastus2.cloudapp.azure.com:8080/tfs/vsteam' + start2018: 'true' + stop2018: 'true' + name: 'LinuxTFS2018' + apiVersion: 'TFS2018' + account: 'http://winbldbox3.centralus.cloudapp.azure.com:8080/tfs/defaultcollection' - template: build/integrationTests.yml parameters: - displayName: 'Windows TFS 2017' + displayName: 'Windows AzD' os: 'Windows' - name: 'WindowsTFS2017' pool: 'windows-latest' - apiVersion: 'TFS2017' - depends: 'macOSTFS2017' - account: 'http://sonarqube.eastus2.cloudapp.azure.com:8080/tfs/vsteam' + name: 'windowsAzD' + apiVersion: 'VSTS' + account: 'tooltester' - template: build/integrationTests.yml parameters: @@ -226,30 +230,11 @@ stages: os: 'macOS' pool: 'macOS-latest' start2017: 'true' + stop2017: 'true' name: 'macOSTFS2017' apiVersion: 'TFS2017' account: 'http://sonarqube.eastus2.cloudapp.azure.com:8080/tfs/vsteam' - - template: build/integrationTests.yml - parameters: - displayName: 'Windows TFS 2018' - os: 'Windows' - pool: 'windows-latest' - start2018: 'true' - stop2018: 'true' - name: 'windowsTFS2018' - apiVersion: 'TFS2018' - account: 'http://winbldbox3.centralus.cloudapp.azure.com:8080/tfs/defaultcollection' - - - template: build/integrationTests.yml - parameters: - displayName: 'Windows AzD' - os: 'Windows' - pool: 'windows-latest' - name: 'windowsAzD' - apiVersion: 'VSTS' - account: 'tooltester' - - stage: Production displayName: PowerShell Gallery / GitHub Release dependsOn: Testing @@ -302,6 +287,13 @@ stages: packagesToPack: '$(Pipeline.Workspace)/Module/$(Folder)/VSTeam.nuspec' packDestination: '$(Pipeline.Workspace)/Module/$(Folder)' + - task: PublishPipelineArtifact@1 + displayName: 'Publish nupkg Artifact' + inputs: + targetPath: '$(Pipeline.Workspace)/Module/$(Folder)' + artifact: 'Package' + publishLocation: 'pipeline' + - task: NuGetCommand@2 displayName: 'Push Module' inputs: @@ -314,7 +306,7 @@ stages: displayName: 'Create GitHub Release' inputs: gitHubConnection: Darquewarrior - repositoryName: DarqueWarrior/vsteam + repositoryName: MethodsAndPractices/vsteam tagSource: manual tag: v$(PACKAGE_VERSION) addChangeLog: true diff --git a/build/integrationTests.yml b/build/integrationTests.yml index 3d75ec801..f453c9560 100644 --- a/build/integrationTests.yml +++ b/build/integrationTests.yml @@ -51,10 +51,12 @@ jobs: $pwd = ConvertTo-SecureString "$(PKG_PAT)" -AsPlainText -Force $creds = New-Object PSCredential($e, $pwd) - if(-not (Get-PSRepository | ? Name -eq $n)) { + if(-not (Get-PSRepository | Where-Object Name -eq $n)) { Register-PSRepository -Credential $creds -Name $n -SourceLocation $url -InstallationPolicy Trusted -Verbose } + Get-PSRepository + - task: PowerShell@2 displayName: 'Install VSTeam Module' inputs: @@ -69,6 +71,8 @@ jobs: $pwd = ConvertTo-SecureString "$(PKG_PAT)" -AsPlainText -Force $creds = New-Object PSCredential($e, $pwd) + Get-PSRepository + Install-Module -Name VSTeam -Repository $n -Credential $creds -MaximumVersion $b -MinimumVersion $b -Force -Scope CurrentUser -Verbose workingDirectory: '$(Pipeline.Workspace)/Test'