summaryrefslogtreecommitdiff
path: root/save_artifact.sh
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2023-12-30 15:01:47 +0100
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2023-12-30 15:01:47 +0100
commit9a97f3377ec7c28b1b91c7992505b28745a85e05 (patch)
tree7ec9428cfde0c775466e6baf81d0698e75965872 /save_artifact.sh
parenta3a9a532b36a00b392f5c408051f791166c7dbe8 (diff)
cache update
Diffstat (limited to 'save_artifact.sh')
-rwxr-xr-xsave_artifact.sh14
1 files changed, 12 insertions, 2 deletions
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