Created
January 29, 2019 07:11
-
-
Save oliver-nh/4c0c804ad51d40f2efad12ec1a37f434 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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 | |
pool: | |
vmImage: 'Ubuntu-16.04' | |
trigger: none | |
pr: | |
- master | |
steps: | |
- task: NodeTool@0 | |
inputs: | |
versionSpec: '8.x' | |
displayName: 'Install Node.js' | |
- script: | | |
npm install -g @angular/cli ionic@latest wait-on | |
npm install | |
displayName: 'Install Dependencies' | |
- script: | | |
npm run lint | |
displayName: 'Lint' | |
- script: | | |
npm run test:ci | |
displayName: 'Middleware Unit Tests' | |
workingDirectory: '$(System.DefaultWorkingDirectory)/middleware' | |
- script: | | |
npm run test:ci | |
displayName: 'Frontend Unit Tests' | |
workingDirectory: '$(System.DefaultWorkingDirectory)/frontend' | |
# - script: | | |
# npm start & npm run cypress-mock-server & wait-on http-get://localhost:4200/ http://localhost:8080 && npm run test:e2e | |
# displayName: 'Cypress Tests' | |
# workingDirectory: '$(System.DefaultWorkingDirectory)/frontend' | |
- task: PublishTestResults@2 | |
inputs: | |
testResultsFiles: '**/junit.xml' | |
testRunTitle: 'Publish Test Results' | |
condition: succeededOrFailed() | |
- task: PublishCodeCoverageResults@1 | |
inputs: | |
codeCoverageTool: Cobertura | |
summaryFileLocation: '$(System.DefaultWorkingDirectory)/frontend/coverage/*coverage.xml' | |
reportDirectory: '$(System.DefaultWorkingDirectory)/frontend/coverage' | |
- task: PublishCodeCoverageResults@1 | |
inputs: | |
codeCoverageTool: Cobertura | |
summaryFileLocation: '$(System.DefaultWorkingDirectory)/middleware/coverage/*coverage.xml' | |
reportDirectory: '$(System.DefaultWorkingDirectory)/middleware/coverage' | |
- script: | | |
npm run build:prod | |
displayName: 'Build' | |
- task: ArchiveFiles@1 | |
displayName: 'Archive files' | |
inputs: | |
rootFolder: 'dist' | |
includeRootFolder: false | |
- task: CopyFiles@2 | |
displayName: 'Prepare Artifact' | |
inputs: | |
SourceFolder: '$(Build.ArtifactStagingDirectory)' | |
Contents: '$(Build.BuildId).zip' | |
TargetFolder: '$(Build.ArtifactStagingDirectory)' | |
- task: PublishBuildArtifacts@1 | |
displayName: 'Publish Artifact' | |
inputs: | |
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | |
# - task: AzureRmWebAppDeployment@3 | |
# inputs: | |
# azureSubscription: 'Example-Sub' | |
# WebAppName: 'example-app' | |
# DeployToSlotFlag: true | |
# ResourceGroupName: 'example-app' | |
# Package: '$(System.DefaultWorkingDirectory)' | |
# Debug: true | |
# GenerateWebConfig: true | |
# Package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' | |
# SlotName: pr | |
# - task: AzureAppServiceManage@0 | |
# inputs: | |
# azureSubscription: 'Example-Sub' | |
# WebAppName: 'example-app' | |
# ResourceGroupName: 'example-app' | |
# SourceSlot: staging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment