File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ stages:
320
320
functional_test_project_type : " ${{ variables.functional_test_project_type }}"
321
321
322
322
- bash : |
323
- echo "Setting variable 'BUILD_ATTEMPT_NUMBER' with value '$(System.JobAttempt)"
323
+ echo "Setting variable 'BUILD_ATTEMPT_NUMBER' with value '$(System.JobAttempt)' "
324
324
echo "##vso[task.setvariable variable=BUILD_ATTEMPT_NUMBER;isOutput=true]$(System.JobAttempt)"
325
325
name: build_attempt_number
326
326
displayName: "Output: Set Job Attempt Output Variable"
@@ -341,7 +341,7 @@ stages:
341
341
- name : Environment.ShortName
342
342
value : dev
343
343
- name : BUILD_ATTEMPT_NUMBER
344
- value : " $[ dependencies .Build.ApiBuild.outputs['build_attempt_number.BUILD_ATTEMPT_NUMBER'] ]"
344
+ value : " $[ stageDependencies .Build.ApiBuild.outputs['build_attempt_number.BUILD_ATTEMPT_NUMBER'] ]"
345
345
jobs :
346
346
- deployment : AppInfraDev
347
347
container : terraform_custom
@@ -568,7 +568,7 @@ stages:
568
568
- name : Environment.ShortName
569
569
value : prod
570
570
- name : BUILD_ATTEMPT_NUMBER
571
- value : " $[ dependencies .Build.ApiBuild.outputs['build_attempt_number.BUILT_ATTEMPT_NUMBER '] ]"
571
+ value : " $[ stageDependencies .Build.ApiBuild.outputs['build_attempt_number.BUILD_ATTEMPT_NUMBER '] ]"
572
572
jobs :
573
573
- deployment : AppInfraProd
574
574
container : terraform_custom
Original file line number Diff line number Diff line change @@ -25,6 +25,31 @@ steps:
25
25
path : " ${{ parameters.project_root_dir }}/${{ parameters.maven_cache_directory }}"
26
26
displayName : Cache Maven packages (${{ parameters.project_type }})
27
27
28
+ - ${{ if eq(parameters.vulnerability_scan, true) }} :
29
+ - task : Bash@3
30
+ script : |
31
+ DATE="$(date "+%F")"
32
+ HOUR="$(date "+%H")"
33
+
34
+ # NVD Cache lasts 4 hours (240 mins) and so cache based on the hour's time
35
+ # in 24 hours. E.g. 0-3 are 0, 1-4 are 1, 20-23 are 5 etc..
36
+ HOUR_BY_FOUR="$(( ${HOUR} / 4 ))"
37
+
38
+ NVD_CACHE_FILE="${DATE}-${HOUR_BY_FOUR}"
39
+
40
+ echo "echoing to a file '${{ parameters.repo_root_dir }}/.nvd-cache' with value ''"
41
+ echo "${NVD_CACHE_FILE}" >> ${{ parameters.repo_root_dir }}/.nvd-cache
42
+ displayName : Set NVD Cache Variable
43
+
44
+ - task : Cache@2
45
+ inputs :
46
+ key : ' nvd | "$(Agent.OS)" | ${{ parameters.repo_root_dir }}/.nvd-cache'
47
+ restoreKeys : |
48
+ nvd | "$(Agent.OS)"
49
+ nvd
50
+ path : " ${{ parameters.repo_root_dir }}"
51
+ displayName : Cache NVD Datatbase
52
+
28
53
- task : Bash@3
29
54
inputs :
30
55
filePath : " ${{ parameters.pipeline_scripts_directory }}/build-maven-install.bash"
You can’t perform that action at this time.
0 commit comments