From 9a97f3377ec7c28b1b91c7992505b28745a85e05 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sat, 30 Dec 2023 15:01:47 +0100 Subject: cache update --- save_artifact.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'save_artifact.sh') diff --git a/save_artifact.sh b/save_artifact.sh index 195ed34..c28fd37 100755 --- a/save_artifact.sh +++ b/save_artifact.sh @@ -5,11 +5,21 @@ registry_user=mrcyjanek cache_name="$1" cache_key="$2" path_to_file_="$3" -xz --extreme --keep $path_to_file_ path_to_file="$3.xz" basename="$(basename $path_to_file)" + +if [[ ! -f "$path_to_file_" ]]; +then + echo "$(basename $path_to_file_) doesn't exist" + exit 0; +fi + +xz --extreme --keep $path_to_file_ + curl --user $registry_user:$PAT_SECRET_PACKAGE \ --upload-file "$path_to_file" \ - "https://git.mrcyjanek.net/api/packages/mrcyjanek/generic/monero_c/${cache_name}-${cache_key}/${basename}" + "https://git.mrcyjanek.net/api/packages/mrcyjanek/generic/monero_c/${cache_name}-${cache_key}/${basename}" &>/dev/null + +echo "cached $1 $2 $(basename $path_to_file_)" rm $path_to_file \ No newline at end of file -- cgit v1.2.3