Skip to content

Commit 470d189

Browse files
committed
Add app service deployment
1 parent 0f016ad commit 470d189

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed

Diff for: azure-pipelines.yml

+55-12
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,60 @@
66
trigger:
77
- master
88

9-
pool:
10-
vmImage: 'ubuntu-latest'
9+
pr: none
1110

12-
steps:
13-
- task: NodeTool@0
14-
inputs:
15-
versionSpec: '10.x'
16-
displayName: 'Install Node.js'
11+
variables:
12+
# Service connection as configured in project settings
13+
prodConnection: 'isabelProd'
1714

18-
- script: |
19-
npm install
20-
npm run build
21-
npm run test
22-
displayName: 'npm install and build'
15+
# App name
16+
prodApp: 'isabelProd'
17+
18+
stages:
19+
- stage: build
20+
displayName: 'Build'
21+
jobs:
22+
- job: build_test
23+
displayName: 'Build and test'
24+
pool:
25+
vmImage: 'Ubuntu-16.04'
26+
steps:
27+
- task: NodeTool@0
28+
inputs:
29+
versionSpec: '10.x'
30+
displayName: 'Install Node.js'
31+
- script: |
32+
npm install
33+
npm run build
34+
npm run test
35+
displayName: 'npm install, build, and test'
36+
- task: ArchiveFiles@2
37+
inputs:
38+
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
39+
includeRootFolder: false
40+
- task: PublishPipelineArtifact@0
41+
inputs:
42+
targetPath: '$(System.ArtifactsDirectory)'
43+
44+
45+
- stage: prod
46+
displayName: 'Prod'
47+
dependsOn: build
48+
jobs:
49+
- deployment: deployProd
50+
displayName: 'Deploy prod'
51+
environment: isabelProdEnv
52+
strategy:
53+
runOnce:
54+
deploy:
55+
steps:
56+
- task: DownloadPipelineArtifact@1
57+
inputs:
58+
downloadPath: '$(System.DefaultWorkingDirectory)'
59+
- task: AzureWebApp@1
60+
inputs:
61+
azureSubscription: $(prodConnection)
62+
appType: 'webAppLinux'
63+
appName: $(prodApp)
64+
runtimeStack: 'NODE|10.1'
65+
startUpCommand: 'npm run start'

0 commit comments

Comments
 (0)