hpcpack-web-portal/azure-pipelines.yaml

129 строки
3.4 KiB
YAML

# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
name: 0.2.$(Rev:r)
trigger:
batch: true
branches:
include:
- master
- release
paths:
exclude:
- README.md
- CONTRIBUTING.md
- LICENSE
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- CONTRIBUTING.md
- LICENSE
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm ci
displayName: 'Install npm Packages'
- script: |
npm run ci-test
displayName: 'Unit Test'
- task: PublishTestResults@2
inputs:
testResultsFiles: 'unit-test-result.xml'
failTaskOnFailedTests: true
displayName: 'Publish Unit Test Result'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: coverage/cobertura-coverage.xml
displayName: 'Publish Unit Test Code Coverage Result'
- script: |
npm run ci-e2e
displayName: 'E2E Test'
- script: |
npm run build-stg
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
displayName: 'Build'
- publish: 'dist/web-portal'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
artifact: WebPortal
displayName: 'Publish Build Result'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
command: 'pack'
packagesToPack: 'Microsoft.HPC.WebPortal.nuspec'
versioningScheme: 'byBuildNumber'
packDestination: '$(Build.ArtifactStagingDirectory)'
displayName: 'Make NuGet Package'
- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
command: 'push'
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.HPC.WebPortal.*.nupkg
nuGetFeedType: 'internal'
publishVstsFeed: '5e2011c9-a9d1-448b-9be7-9e9c97526134'
displayName: 'Publish NuGet Package'
# The deploy is blocked on issue:
# https://github.com/microsoft/azure-pipelines-tasks/issues/11158
#
# - stage: Deploy
# dependsOn: Build
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
# jobs:
# - job: Deploy
# pool:
# vmImage: windows-latest
# steps:
# - checkout: none
#
# - download: current
# artifact: WebPortal
#
# - task: AzureFileCopy@3
# inputs:
# SourcePath: '$(Pipeline.Workspace)/WebPortal'
# azureSubscription: $(Subscription)
# resourceGroup: $(ResourceGroup)
# storage: $(StorageAccount)
# Destination: 'AzureVMs'
# ResourceFilteringMethod: machineNames
# MachineNames: $(TargetHosts)
# vmsAdminUserName: $(TargetHosts.AdminUserName)
# vmsAdminPassword: $(TargetHosts.AdminPassword)
# TargetPath: $(TargetHosts.Path)
# CleanTargetBeforeCopy: true
# enableCopyPrerequisites: true
# displayName: 'Deploy to $(TargetHosts)'