Skip to content

Commit

Permalink
fix: cache and downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvenSpellmaker committed Jul 20, 2024
1 parent c1e4150 commit 01f8229
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ stages:
runOnce:
deploy:
steps:
- download: none

- checkout: self

- checkout: templates
Expand Down
14 changes: 9 additions & 5 deletions build/azDevOps/azure/templates/steps/build/build-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,20 @@ steps:
NVD_CACHE_FILE="${DATE}-${HOUR_BY_FOUR}"
echo "echoing to a file '${{ parameters.repo_root_dir }}/.nvd-cache' with value '${NVD_CACHE_FILE}'"
echo "${NVD_CACHE_FILE}" > ${{ parameters.repo_root_dir }}/.nvd-cache
echo "echoing to a file '${{ parameters.repo_root_dir }}/.nvd-cache-day' with value '${DATE}'"
echo "echoing to a file '${{ parameters.repo_root_dir }}/.nvd-cache-full' with value '${NVD_CACHE_FILE}'"
# Partial (slow) download lasts 24 hours
echo "${DATE}" > ${{ parameters.repo_root_dir }}/.nvd-cache-day
# Full Cache is 4 hours, so use the by four computed variable
echo "${NVD_CACHE_FILE}" > ${{ parameters.repo_root_dir }}/.nvd-cache-full
displayName: Set NVD Cache Variable

- task: Cache@2
inputs:
key: 'nvd | "$(Agent.OS)" | ${{ parameters.repo_root_dir }}/.nvd-cache'
key: '${{ parameters.repo_root_dir }}/.nvd-cache-day | ${{ parameters.repo_root_dir }}/.nvd-cache-full'
restoreKeys: |
nvd | "$(Agent.OS)"
nvd
${{ parameters.repo_root_dir }}/.nvd-cache
path: "${{ parameters.vulnerability_scan_database_directory }}"
displayName: Cache NVD Datatbase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
inputs:
buildType: 'current'
artifact: "${{ parameters.functional_test_artefact_name }}-$(BUILD_ATTEMPT_NUMBER)"
targetPath: ${{ parameters.functional_test_artefact_name }}
targetPath: ${{ parameters.functional_test_artefact_download_location }}
displayName: "Download: Post-Deploy Test Artefacts"

# Files downloaded from artefacts seem to lose their permissions...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
inputs:
buildType: 'current'
artifact: "${{ parameters.functional_test_artefact_name }}-$(BUILD_ATTEMPT_NUMBER)"
targetPath: ${{ parameters.functional_test_artefact_name }}
targetPath: ${{ parameters.functional_test_artefact_download_location }}
displayName: "Download: Post-Deploy Test Artefacts"

# Files downloaded from artefacts seem to lose their permissions...
Expand Down

0 comments on commit 01f8229

Please sign in to comment.