-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathazure-pipeline.yml
82 lines (73 loc) · 2.31 KB
/
azure-pipeline.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
# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
stages:
- stage: Build
pool:
name: Default
demands:
- agent.name -equals ANUROOP-JOY
jobs:
- job: Build
displayName: "Angular App Build"
workspace:
clean: all
steps:
- task: NodeTool@0
inputs:
versionSpec: "16.x"
displayName: "Install Node.js"
- task: Npm@1
inputs:
command: "install"
displayName: "Npm Install"
- task: Npm@1
inputs:
command: custom
customCommand: "run build"
displayName: "Build Angular app"
- task: Npm@1
inputs:
command: custom
customCommand: "run test"
displayName: "Test Angular app"
- task: Npm@1
inputs:
command: custom
customCommand: "run lint"
displayName: "Lint Angular app"
- script: |
mkdir $(Build.ArtifactStagingDirectory)\\dist
xcopy "dist\\sample-app" $(Build.ArtifactStagingDirectory)\\dist /E/H/C
displayName: Copy dist contents
- task: PublishBuildArtifacts@1
displayName: "Publish Artifact"
- stage: Deploy
dependsOn: Build
condition: succeeded('Build')
variables:
- group: SECRET-DEV
- group: VGRP-DEV
pool:
name: Default
demands:
- agent.name -equals ANUROOP-JOY
jobs:
- deployment: Deploy
displayName: Deploy to Azure
environment: DEV
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2
displayName: "Deploy Angular app"
inputs:
azureSubscription: $(azureSubscription)
scriptType: batch
scriptLocation: inlineScript
inlineScript: |
az storage blob upload-batch --overwrite -d $web --account-name $(storageAccount) --account-key $(accountkey) -s "$(Agent.BuildDirectory)\\drop\\dist"