-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
42 lines (40 loc) · 1.87 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Scope the validations to main and PRs to main
trigger:
- main
pr:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: npm install
displayName: 'Install dependencies'
- script: npm run test
displayName: 'Build and run tests'
# Remove devDependency before deploy to not upload them
- script: npm prune --production
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
displayName: 'Remove devDependencies'
- task: ArchiveFiles@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
verbose: true
displayName: Create deployment zip file for azure functions
- task: AzureFunctionApp@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
azureSubscription: 'webhint-telemetry'
appType: 'functionApp'
appName: 'webhint-telemetry'
package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
appSettings: '-APPINSIGHTS_INSTRUMENTATIONKEY $(APPINSIGHTS_INSTRUMENTATIONKEY) -AzureWebJobsStorage $(AzureWebJobsStorage) -RESULT_INSTRUMENTATION_KEY $(RESULT_INSTRUMENTATION_KEY) -APPID $(APPID) -X_API_KEY $(X_API_KEY) -FUNCTIONS_EXTENSION_VERSION $(FUNCTIONS_EXTENSION_VERSION) -FUNCTIONS_WORKER_RUNTIME $(FUNCTIONS_WORKER_RUNTIME) -WEBSITE_ENABLE_SYNC_UPDATE_SITE $(WEBSITE_ENABLE_SYNC_UPDATE_SITE) -WEBSITE_NODE_DEFAULT_VERSION $(WEBSITE_NODE_DEFAULT_VERSION) -WEBSITES_ENABLE_APP_SERVICE_STORAGE $(WEBSITES_ENABLE_APP_SERVICE_STORAGE) -WEBSITE_RUN_FROM_PACKAGE $(WEBSITE_RUN_FROM_PACKAGE)'
deploymentMethod: 'auto'
displayName: Deploy telemetry functions