From 01f82294e6b8b5e061bdb7e9350b0941a8a3cee6 Mon Sep 17 00:00:00 2001 From: Jack Blower Date: Sat, 20 Jul 2024 22:38:36 +0100 Subject: [PATCH] fix: cache and downloads --- .../azure/azure-pipelines-javaspring-k8s.yml | 2 ++ .../azure/templates/steps/build/build-java.yml | 14 +++++++++----- .../deploy/deploy-post-deploy-tests-karate.yml | 2 +- .../deploy/deploy-post-deploy-tests-serenity.yml | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml b/build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml index 114b313d..64c9a05d 100644 --- a/build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml +++ b/build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml @@ -479,6 +479,8 @@ stages: runOnce: deploy: steps: + - download: none + - checkout: self - checkout: templates diff --git a/build/azDevOps/azure/templates/steps/build/build-java.yml b/build/azDevOps/azure/templates/steps/build/build-java.yml index d77287e0..f9aaccf3 100644 --- a/build/azDevOps/azure/templates/steps/build/build-java.yml +++ b/build/azDevOps/azure/templates/steps/build/build-java.yml @@ -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 diff --git a/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-karate.yml b/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-karate.yml index 6befe40f..b8738354 100644 --- a/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-karate.yml +++ b/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-karate.yml @@ -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... diff --git a/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-serenity.yml b/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-serenity.yml index 61dbfe4c..cda6d005 100644 --- a/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-serenity.yml +++ b/build/azDevOps/azure/templates/steps/deploy/deploy-post-deploy-tests-serenity.yml @@ -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...