-
Notifications
You must be signed in to change notification settings - Fork 38
/
beta-build-prod.yml
102 lines (82 loc) · 2.71 KB
/
beta-build-prod.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
# 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:
- beta
pr: none
pool:
vmImage: "ubuntu-latest"
variables:
major: 1
minor: 0
##veracode connection Name
veracode: "Veracode"
veracodeAppProfile: "CDT.beta.template.webtools.website"
##sonarqube connection name and project name
SonarQubeConnection: "sonar"
SonarQubeProjectName: "CDT.beta.template.webtools.website"
name: $(major).$(minor)$(Rev:.r)
steps:
- script: |
echo '##vso[task.setvariable variable=REACT_APP_VERSION]$(Build.BuildNumber)'
displayName: set environment variable for subsequent steps
- task: NodeTool@0
inputs:
versionSpec: "18.x"
displayName: "Install Node.js"
- task: SonarQubePrepare@5
displayName: "SonarQube Prepare Analysis Configuration"
inputs:
SonarQube: "$(SonarQubeConnection)"
scannerMode: "CLI"
configMode: "manual"
cliProjectKey: "$(SonarQubeProjectName)"
cliProjectName: "$(SonarQubeProjectName)"
- task: Npm@1
inputs:
command: "install"
displayName: "npm install"
# - script: npm run test
# displayName: "npm test"
# env:
# CI: true
# - task: PublishCodeCoverageResults@1
# inputs:
# codeCoverageTool: 'Cobertura'
# summaryFileLocation: 'coverage/cobertura-coverage.xml'
# reportDirectory: 'coverage'
# displayName: 'Publish Code Coverage'
- script: npm run build
displayName: "npm build"
- task: CopyFiles@2
inputs:
Contents: "_site/**" # Pull the build directory
TargetFolder: "$(Build.ArtifactStagingDirectory)"
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)/_site" # build files
ArtifactName: "drop" # output artifact named drop
- task: ArchiveFiles@2
displayName: "Archive Build Folder"
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/_site"
archiveFile: "$(Build.ArtifactStagingDirectory)/app.zip"
includeRootFolder: false
- task: Veracode@3
displayName: "Veracode upload and scan: $(build.artifactstagingdirectory)"
inputs:
ConnectionDetailsSelection: "Endpoint"
AnalysisService: "$(veracode)"
veracodeAppProfile: "$(veracodeAppProfile)"
version: "$(build.buildNumber)"
filepath: "$(build.artifactstagingdirectory)/app.zip"
createProfile: true
maximumWaitTime: "360"
continueOnError: true
- task: SonarQubeAnalyze@5
displayName: Run code quality analysis
- task: SonarQubePublish@5
displayName: Publish code quality analysis
inputs:
pollingTimeoutSec: "300"