forked from microsoftgraph/microsoft-graph-explorer-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
71 lines (60 loc) · 2.11 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
pool:
vmImage: 'vs2017-win2016'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install'
- script: |
npm run lint
displayName: 'Runs linting checks'
- script: |
npm test -- --coverage
displayName: 'Runs tests'
- script: |
npm run build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
env:
REACT_APP_CLIENT_ID: $(REACT_APP_STAGING_CLIENT_ID)
displayName: 'Build staging assets'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: 'coverage/clover.xml'
reportDirectory: 'coverage'
- task: DeleteFiles@1
inputs:
contents: node_modules
displayName: 'Delete node_modules'
- task: AzureRmWebAppDeployment@3
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
inputs:
azureSubscription: 'Graph-Explorer-ARM'
WebAppName: 'graphTryIt-staging'
Package: '$(System.DefaultWorkingDirectory)'
GenerateWebConfig: true
WebConfigParameters: '-Handler iisnode -NodeStartFile server.js -appType node'
displayName: 'Deploy to staging'
- task: AzureFileCopy@2
inputs:
sourcePath: 'build'
azureConnectionType: 'ConnectedServiceNameARM'
azureSubscription: 'arm-connection'
destination: 'azureBlob'
storage: 'graphstagingblobstorage'
containerName: 'staging/vendor/bower_components/explorer-v2/build'
cleanTargetBeforeCopy: true
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
displayName: 'Deploy to -tst'
- task: AzureRmWebAppDeployment@3
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
azureSubscription: 'Graph-Explorer-ARM'
WebAppName: 'graphTryIt'
Package: '$(System.DefaultWorkingDirectory)'
GenerateWebConfig: true
WebConfigParameters: '-Handler iisnode -NodeStartFile server.js -appType node'
displayName: 'Deploy to production'