-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |