-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline-generate-deployment-artifact.yml
79 lines (70 loc) · 1.85 KB
/
pipeline-generate-deployment-artifact.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
# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
pool:
vmImage: ubuntu-20.04
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
lfs: true
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
displayName: 'Use Python 3.8'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
npm install
npm run build
python webapp.py collectstatic
displayName: 'Install pip and npm dependencies and build project'
- task: CopyFiles@1
inputs:
SourceFolder: './'
Contents: |
**
!node_modules/**
!src/**
!datasets/**
!__pycache__/**
!train_*.py
!explain*.py
!data_preprocessing*.py
!*_test.py
!README.md
!.gitignore
!package*.json
!pipeline-*.yml
!static/index.html
!public/index.html
!build/index.html
TargetFolder: '$(build.artifactstagingdirectory)'
CleanTargetFolder: true
OverWrite: true
flattenFolders: false
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(build.artifactstagingdirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/publish.zip'
replaceExistingArchive: true
displayName: 'Zip Files'
- task: DeleteFiles@1
inputs:
SourceFolder: '$(build.artifactstagingdirectory)'
Contents: |
**
!*.zip
displayName: 'Delete Non Zip Files'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(build.artifactstagingdirectory) # dist or build files
ArtifactName: 'package'
publishLocation: 'Container'