-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipeline(backend part).yml
108 lines (99 loc) · 3.46 KB
/
azure-pipeline(backend part).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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# 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:
- main
pool:
name: Default
vmImage: ubuntu-latest
jobs:
- job: Build
displayName: 'Build Job'
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.19.0'
displayName: 'Install Node.js'
- script: |
npm install
npm run build --if-present
displayName: 'npm install and build'
- script: |
sudo apt-get -y install zip
displayName: 'Install zip'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/app.zip'
replaceExistingArchive: true
displayName: 'Archive build artifacts'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publish build artifacts'
- job: Deploy
displayName: 'Deploy Job'
dependsOn: Build
steps:
- task: DownloadBuildArtifacts@1
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: AzureWebApp@1
inputs:
azureSubscription: 'Free Trial(46dbdd8a-efee-4055-8cca-74f21476c43e)'
appType: 'webAppLinux'
appName: 'WepApp-CI-CD-mern-app'
package: '$(Build.ArtifactStagingDirectory)/**/*.zip'
- task: AzureAppServiceSettings@1
inputs:
azureSubscription: 'Free Trial(46dbdd8a-efee-4055-8cca-74f21476c43e)'
appName: 'WepApp-CI-CD-mern-app'
resourceGroupName: 'multi-instance-resource-group'
appSettings: |
[
{
"name": "DB_URL",
"value": "mongodb+srv://deepujain:Deepu@6387!@cluster0.ziwayyo.mongodb.net/?retryWrites=true&w=majority",
"slotSetting": false
},
{
"name": "PORT",
"value": "5000",
"slotSetting": false
},
{
"name": "SECRET",
"value": "12345678",
"slotSetting": false
},
{
"name": "SMTP_HOST",
"value": "deepujain",
"slotSetting": false
},
{
"name": "SMTP_PASS",
"value": "",
"slotSetting": false
},
{
"name": "SMTP_PORT",
"value": "1234",
"slotSetting": false
},
{
"name": "SMTP_USER",
"value": "deepu",
"slotSetting": false
}
]