Skip to content

Instantly share code, notes, and snippets.

@NenoLoje
Last active October 28, 2019 18:09
Show Gist options
  • Save NenoLoje/81694bac764f6d49ac6231a4bd31c7e0 to your computer and use it in GitHub Desktop.
Save NenoLoje/81694bac764f6d49ac6231a4bd31c7e0 to your computer and use it in GitHub Desktop.
[Azure Pipelines] Sample Pipeline #1 for node.js app, build stage only (from code.talks 2019 demo)
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: 'windows-latest' # or: 'ubuntu-latest'
steps:
- task: UseNode@1
displayName: 'Use Node.js 8.10.0'
inputs:
version: '8.10.0'
- task: Npm@1
displayName: 'Install application dependencies'
inputs:
command: 'install'
workingDir: 'Application'
- task: Npm@1
displayName: 'Install test dependencies'
inputs:
command: 'install'
workingDir: 'Tests'
- task: Gulp@1
displayName: 'Run unit tests'
inputs:
gulpFile: 'Tests/gulpfile.js'
targets: 'unittest'
gulpjs: 'Tests/node_modules/gulp/bin/gulp.js'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Unit Tests'
- task: ArchiveFiles@2
displayName: 'Archive application'
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/Application'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.StagingDirectory)/Application/$(Build.BuildId).zip'
- publish: '$(Build.StagingDirectory)/Application'
displayName: 'Publish artifact: Application'
artifact: 'Application'
- publish: '$(Build.SourcesDirectory)/Tests'
displayName: 'Publish artifact: Tests'
artifact: 'Tests'
- publish: '$(Build.SourcesDirectory)/armTemplates'
displayName: 'Publish artifact: ArmTemplates'
artifact: 'ArmTemplates'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment