Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build #342

Merged
merged 5 commits into from
Jul 14, 2020
Merged

Build #342

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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/)
Expand Down
60 changes: 26 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'

Expand All @@ -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
Expand All @@ -201,55 +206,35 @@ 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:
displayName: 'macOS TFS 2017'
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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion build/integrationTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'

Expand Down