Skip to content

Commit 8a30343

Browse files
committed
Update azure-pipelines-1.yml for Azure Pipelines
1 parent dbdf92c commit 8a30343

1 file changed

Lines changed: 122 additions & 122 deletions

File tree

azure-pipelines-1.yml

Lines changed: 122 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -13,150 +13,150 @@ pool:
1313

1414

1515
stages:
16-
# - stage: Build
17-
# displayName: Build stage
18-
# jobs:
19-
# - job: Build
20-
# steps:
16+
- stage: Build
17+
displayName: Build stage
18+
jobs:
19+
- job: Build
20+
steps:
2121

22-
# - task: DownloadSecureFile@1
23-
# displayName: 'download STAG backendend'
24-
# inputs:
25-
# secureFile: 'BACKEND_ENV_FILE_STAG' # string. Required. Secure File.
22+
- task: DownloadSecureFile@1
23+
displayName: 'download STAG backendend'
24+
inputs:
25+
secureFile: 'BACKEND_ENV_FILE_STAG' # string. Required. Secure File.
2626

27-
# - task: CopyFiles@2
28-
# displayName: 'copy STAG backendend'
29-
# inputs:
30-
# SourceFolder: '$(Agent.TempDirectory)'
31-
# Contents: BACKEND_ENV_FILE_STAG
32-
# TargetFolder: './backend'
27+
- task: CopyFiles@2
28+
displayName: 'copy STAG backendend'
29+
inputs:
30+
SourceFolder: '$(Agent.TempDirectory)'
31+
Contents: BACKEND_ENV_FILE_STAG
32+
TargetFolder: './backend'
3333

34-
# - script: mv ./backend/BACKEND_ENV_FILE_STAG ./backend/.env
35-
# displayName: 'rename STAG .env'
36-
# - task: DownloadSecureFile@1
37-
# displayName: 'download STAG frontend'
38-
# inputs:
39-
# secureFile: 'FRONTEND_ENV_FILE_STAG' # string. Required. Secure File.
34+
- script: mv ./backend/BACKEND_ENV_FILE_STAG ./backend/.env
35+
displayName: 'rename STAG .env'
36+
- task: DownloadSecureFile@1
37+
displayName: 'download STAG frontend'
38+
inputs:
39+
secureFile: 'FRONTEND_ENV_FILE_STAG' # string. Required. Secure File.
4040

41-
# - task: CopyFiles@2
42-
# displayName: 'copy STAG frontend'
43-
# inputs:
44-
# SourceFolder: '$(Agent.TempDirectory)'
45-
# Contents: FRONTEND_ENV_FILE_STAG
46-
# TargetFolder: './frontend'
41+
- task: CopyFiles@2
42+
displayName: 'copy STAG frontend'
43+
inputs:
44+
SourceFolder: '$(Agent.TempDirectory)'
45+
Contents: FRONTEND_ENV_FILE_STAG
46+
TargetFolder: './frontend'
4747

48-
# - script: mv ./frontend/FRONTEND_ENV_FILE_STAG ./frontend/.env
49-
# displayName: 'rename STAG .env'
48+
- script: mv ./frontend/FRONTEND_ENV_FILE_STAG ./frontend/.env
49+
displayName: 'rename STAG .env'
5050

51-
# - script: ls -a ./frontend
52-
# displayName: 'ls'
51+
- script: ls -a ./frontend
52+
displayName: 'ls'
5353

54-
# - script: ls -Rn
55-
# displayName: 'ls'
54+
- script: ls -Rn
55+
displayName: 'ls'
5656

5757

58-
# - task: NodeTool@0
59-
# inputs:
60-
# versionSpec: '12.20.1'
61-
# displayName: 'Install Node.js'
58+
- task: NodeTool@0
59+
inputs:
60+
versionSpec: '12.20.1'
61+
displayName: 'Install Node.js'
6262

63-
# - task: Bash@3
64-
# inputs:
65-
# targetType: 'inline'
66-
# script: |
67-
# node -v
68-
# npm -v
69-
# npm install
70-
# npm run build
63+
- task: Bash@3
64+
inputs:
65+
targetType: 'inline'
66+
script: |
67+
node -v
68+
npm -v
69+
npm install
70+
npm run build
7171
72-
# - task: ArchiveFiles@2
73-
# displayName: 'Archive files'
74-
# inputs:
75-
# rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
76-
# includeRootFolder: false
77-
# archiveType: zip
78-
# archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
79-
# replaceExistingArchive: true
80-
# - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
81-
# artifact: drop
72+
- task: ArchiveFiles@2
73+
displayName: 'Archive files'
74+
inputs:
75+
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
76+
includeRootFolder: false
77+
archiveType: zip
78+
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
79+
replaceExistingArchive: true
80+
- upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
81+
artifact: drop
8282

8383

84-
# - deployment: VMDeploy
85-
# dependsOn: Build
86-
# displayName: Web deploy
87-
# environment:
88-
# name: STAGING
89-
# resourceType: VirtualMachine
90-
# strategy:
91-
# runOnce:
92-
# preDeploy:
93-
# steps:
94-
# - download: 'current'
95-
# artifact: 'drop'
84+
- deployment: VMDeploy
85+
dependsOn: Build
86+
displayName: Web deploy
87+
environment:
88+
name: STAGING
89+
resourceType: VirtualMachine
90+
strategy:
91+
runOnce:
92+
preDeploy:
93+
steps:
94+
- download: 'current'
95+
artifact: 'drop'
9696

97-
# - task: DownloadPipelineArtifact@2
98-
# inputs:
99-
# buildType: 'current'
100-
# project: # string. Required when source == specific. Project.
101-
# definition: # string. Alias: pipeline. Required when source == specific. Build pipeline.
102-
# specificBuildWithTriggering: false # boolean. Alias: preferTriggeringPipeline. Optional. Use when source == specific. When appropriate, download artifacts from the triggering build. Default: false.
103-
# buildVersionToDownload: 'latest' # 'latest' | 'latestFromBranch' | 'specific'. Alias: runVersion. Required when source == specific. Build version to download. Default: latest.
104-
# branchName: 'refs/heads/master' # string. Alias: runBranch. Required when source == specific && runVersion == latestFromBranch. Branch name. Default: refs/heads/master.
105-
# pipelineId: # string. Alias: runId | buildId. Required when source == specific && runVersion == specific. Build.
106-
# tags: # string. Optional. Use when source == specific && runVersion != specific. Build Tags.
107-
# allowPartiallySucceededBuilds: false # boolean. Optional. Use when source == specific && runVersion != specific. Download artifacts from partially succeeded builds. Default: false.
108-
# allowFailedBuilds: false # boolean. Optional. Use when source == specific && runVersion != specific. Download artifacts from failed builds. Default: false.
109-
# artifactName: drop
110-
# itemPattern: '**' # string. Alias: patterns. Matching patterns. Default: **.
111-
# targetPath: '$(Pipeline.Workspace)/drop'
97+
- task: DownloadPipelineArtifact@2
98+
inputs:
99+
buildType: 'current'
100+
project: # string. Required when source == specific. Project.
101+
definition: # string. Alias: pipeline. Required when source == specific. Build pipeline.
102+
specificBuildWithTriggering: false # boolean. Alias: preferTriggeringPipeline. Optional. Use when source == specific. When appropriate, download artifacts from the triggering build. Default: false.
103+
buildVersionToDownload: 'latest' # 'latest' | 'latestFromBranch' | 'specific'. Alias: runVersion. Required when source == specific. Build version to download. Default: latest.
104+
branchName: 'refs/heads/master' # string. Alias: runBranch. Required when source == specific && runVersion == latestFromBranch. Branch name. Default: refs/heads/master.
105+
pipelineId: # string. Alias: runId | buildId. Required when source == specific && runVersion == specific. Build.
106+
tags: # string. Optional. Use when source == specific && runVersion != specific. Build Tags.
107+
allowPartiallySucceededBuilds: false # boolean. Optional. Use when source == specific && runVersion != specific. Download artifacts from partially succeeded builds. Default: false.
108+
allowFailedBuilds: false # boolean. Optional. Use when source == specific && runVersion != specific. Download artifacts from failed builds. Default: false.
109+
artifactName: drop
110+
itemPattern: '**' # string. Alias: patterns. Matching patterns. Default: **.
111+
targetPath: '$(Pipeline.Workspace)/drop'
112112

113113

114-
# - script: echo initialize, cleanup, backup, install certs
114+
- script: echo initialize, cleanup, backup, install certs
115115

116-
# deploy:
117-
# steps:
118-
# - task: Bash@3
119-
# inputs:
120-
# targetType: 'inline'
121-
# script: |
122-
# Modify deployment script based on the app type
123-
# echo "Starting deployment script run"
116+
deploy:
117+
steps:
118+
- task: Bash@3
119+
inputs:
120+
targetType: 'inline'
121+
script: |
122+
Modify deployment script based on the app type
123+
echo "Starting deployment script run"
124124
125125
126-
# - task: ExtractFiles@1
127-
# inputs:
128-
# archiveFilePatterns: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
129-
# destinationFolder: '$(Pipeline.Workspace)/japp'
130-
# cleanDestinationFolder: true
131-
# overwriteExistingFiles: true
132-
# pathToSevenZipTool: # string. Path to 7z utility.
126+
- task: ExtractFiles@1
127+
inputs:
128+
archiveFilePatterns: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
129+
destinationFolder: '$(Pipeline.Workspace)/japp'
130+
cleanDestinationFolder: true
131+
overwriteExistingFiles: true
132+
pathToSevenZipTool: # string. Path to 7z utility.
133133

134-
# - task: DeleteFiles@1
135-
# inputs:
136-
# SourceFolder: '$(Pipeline.Workspace)/drop'
137-
# Contents: '$(Build.BuildId).zip'
134+
- task: DeleteFiles@1
135+
inputs:
136+
SourceFolder: '$(Pipeline.Workspace)/drop'
137+
Contents: '$(Build.BuildId).zip'
138138

139-
# - task: Bash@3
140-
# inputs:
141-
# targetType: 'inline'
142-
# script: |
143-
# pm2 restart index
144-
# sudo systemctl restart nginx
139+
- task: Bash@3
140+
inputs:
141+
targetType: 'inline'
142+
script: |
143+
pm2 restart index
144+
sudo systemctl restart nginx
145145
146146

147-
# routeTraffic:
148-
# steps:
149-
# - script: echo routing traffic
150-
# postRouteTraffic:
151-
# steps:
152-
# - script: echo health check post-route traffic
153-
# on:
154-
# failure:
155-
# steps:
156-
# - script: echo Restore from backup! This is on failure
157-
# success:
158-
# steps:
159-
# - script: echo Notify! This is on success
147+
routeTraffic:
148+
steps:
149+
- script: echo routing traffic
150+
postRouteTraffic:
151+
steps:
152+
- script: echo health check post-route traffic
153+
on:
154+
failure:
155+
steps:
156+
- script: echo Restore from backup! This is on failure
157+
success:
158+
steps:
159+
- script: echo Notify! This is on success
160160

161161

162162

@@ -169,7 +169,7 @@ stages:
169169

170170
- stage: Build_eu
171171
displayName: Build stage
172-
#dependsOn: Build
172+
dependsOn: Build
173173
jobs:
174174
- job: Build_eu
175175
steps:

0 commit comments

Comments
 (0)