From 6e5b8ffba0c7247226d7392c38d5a26a60bc08cf Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 28 Jul 2023 13:21:19 +0200 Subject: [PATCH] artifacts: don't keep deb-tar's .tar after uploading to OCI - they won't ever be used after this, and just accumulate trash for no reason --- lib/functions/artifacts/artifacts-obtain.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/functions/artifacts/artifacts-obtain.sh b/lib/functions/artifacts/artifacts-obtain.sh index f7dadeb733..4bc2c574b2 100644 --- a/lib/functions/artifacts/artifacts-obtain.sh +++ b/lib/functions/artifacts/artifacts-obtain.sh @@ -364,6 +364,12 @@ function upload_artifact_to_oci() { display_alert "Pushing to OCI" "'${artifact_final_file}' -> '${artifact_full_oci_target}'" "info" oras_push_artifact_file "${artifact_full_oci_target}" "${artifact_final_file}" "${artifact_name} - ${artifact_version} - ${artifact_version_reason} - type: ${artifact_type}" + + # If this is a deb-tar, delete the .tar after the upload. We won't ever need it again. + if [[ "${artifact_type}" == "deb-tar" ]]; then + display_alert "Deleting deb-tar after OCI deploy" "deb-tar: ${artifact_final_file_basename}" "warn" # @TODO + run_host_command_logged rm -fv "${artifact_final_file}" + fi } function is_artifact_available_in_local_cache() {