Skip to content

Commit

Permalink
Added VSTS config to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
lipkau committed Oct 3, 2018
1 parent dbfa39a commit b80a5d8
Showing 1 changed file with 193 additions and 0 deletions.
193 changes: 193 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
resources:
- repo: self
clean: true


phases:
- phase: Phase_1
displayName: Build Module

condition: succeeded()
queue:
name: Hosted VS2017

steps:
- powershell: |
. ./Tools/setup.ps1
Invoke-Build -Task ShowInfo
displayName: Setup
- powershell: 'Invoke-Build -Task Clean, Build'
displayName: Build

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Built Module'
inputs:
PathtoPublish: Release
ArtifactName: Release


- phase: Phase_2
displayName: Test Module on Windows (PSv5)

dependsOn: Phase_1
condition: succeeded()
queue:
name: Hosted VS2017

steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: Release
downloadPath: '$(Build.SourcesDirectory)'

- powershell: |
. ./Tools/setup.ps1
Invoke-Build -Task ShowInfo
displayName: Setup
- powershell: 'Invoke-Build -Task Test'
displayName: Test

- task: PublishTestResults@2
displayName: 'Publish Test Results **/Test*.xml'
inputs:
testRunner: NUnit
testResultsFiles: '**/Test*.xml'
condition: succeededOrFailed()


- phase: Phase_3
displayName: Test Module on Ubuntu

dependsOn: Phase_1
condition: succeeded()
queue:
name: Hosted Ubuntu 1604

steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: Release
downloadPath: '$(Build.SourcesDirectory)'


- powershell: |
. ./Tools/setup.ps1
Invoke-Build -Task ShowInfo
displayName: Setup
- powershell: 'Invoke-Build -Task Test'
displayName: Test

- task: PublishTestResults@2
displayName: 'Publish Test Results **/Test*.xml'
inputs:
testRunner: NUnit
testResultsFiles: '**/Test*.xml'
condition: succeededOrFailed()


- phase: Phase_4
displayName: Test Module on macOS

dependsOn: Phase_1
condition: succeeded()
queue:
name: Hosted macOS

steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: Release
downloadPath: '$(Build.SourcesDirectory)'

- powershell: |
. ./Tools/setup.ps1
Invoke-Build -Task ShowInfo
displayName: Setup
- powershell: 'Invoke-Build -Task Test'
displayName: Test

- task: PublishTestResults@2
displayName: 'Publish Test Results **/Test*.xml'
inputs:
testRunner: NUnit
testResultsFiles: '**/Test*.xml'
condition: succeededOrFailed()


- phase: Phase_5
displayName: Test Module on Windows (PSv6)

dependsOn: Phase_1
condition: succeeded()
queue:
name: Hosted VS2017

steps:
- script: 'choco install powershell-core --yes'
displayName: 'Install Powershell v6'

- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: Release
downloadPath: '$(Build.SourcesDirectory)'

- powershell: |
$Env:Path = [Environment]::GetEnvironmentVariable('Path',[EnvironmentVariableTarget]::Machine)
pwsh -command ". ./Tools/setup.ps1; Invoke-Build -Task ShowInfo"
displayName: Setup
- powershell: |
$Env:Path = [Environment]::GetEnvironmentVariable('Path',[EnvironmentVariableTarget]::Machine)
pwsh -command "Invoke-Build -Task Test"
displayName: Test
- task: PublishTestResults@2
displayName: 'Publish Test Results **/Test-*.xml'
inputs:
testRunner: NUnit
testResultsFiles: '**/Test-*.xml'
condition: succeededOrFailed()


- phase: Phase_6
displayName: Deploy Module

dependsOn:
- Phase_2
- Phase_3
- Phase_4
- Phase_5
condition: succeeded()
queue:
name: Hosted VS2017

#Your build pipeline references a secret variable named ‘ghPAT’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references a secret variable named ‘psgPAT’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972

steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: Release
downloadPath: '$(Build.SourcesDirectory)'

- powershell: |
Add-Content (Join-Path $Home ".git-credentials") "https://$(ghPAT):[email protected]`n"
git config --global credential.helper "store --file ~/.git-credentials"
git config --global user.email "[email protected]"
git config --global user.name "AtlassianPS automation"
. ./Tools/setup.ps1
Invoke-Build -Task ShowInfo
displayName: Setup
- powershell: 'Invoke-Build -Task Deploy -PSGalleryAPIKey $(psgPAT) -GithubAccessToken $(ghPAT)'
displayName: Deploy

0 comments on commit b80a5d8

Please sign in to comment.