-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular-azure-blob-storage.yml
88 lines (77 loc) · 2.28 KB
/
angular-azure-blob-storage.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
trigger:
branches:
include:
- release/*
paths:
exclude:
- infrastructure/*
- pipelines/*
variables:
buildPlatform: "Any CPU"
buildConfiguration: "Release"
azureSubscription: "<subscription>"
blobStorageAccountName: "<accont-name>"
blobContainerName: "<container-name>"
pool:
name: Azure Pipelines
demands: npm
vmImage: windows-2019
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
command: install
- task: Npm@1
displayName: 'npm run lint'
inputs:
command: custom
customCommand: 'run lint'
- task: Npm@1
displayName: 'npm run test'
inputs:
command: custom
customCommand: 'run test'
- task: Npm@1
displayName: 'npm run build'
inputs:
command: custom
customCommand: 'run build-prod'
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: dist'
inputs:
targetPath: dist
artifact: dist
- stage: Deploy
displayName: 'Deployment'
dependsOn: ['Build']
jobs:
- deployment: 'Deployment'
displayName: 'Deploy'
environment: 'dev'
workspace:
clean: all
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2
displayName: Clean Blob Storage Container
inputs:
azureSubscription: ${{ variables.azureSubscription }}
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
az storage blob delete-batch --account-name ${{ variables.blobStorageAccountName }} --source '${{ variables.blobContainerName }}'
- task: AzureFileCopy@3
displayName: 'AzureBlob File Copy'
inputs:
SourcePath: '$(Pipeline.Workspace)\dist'
CopyFilesInParallel: true
azureSubscription: ${{ variables.azureSubscription }}
Destination: AzureBlob
storage: ${{ variables.blobStorageAccountName }}
ContainerName: ${{ variables.blobContainerName }}