diff options
| author | Czarek Nakamoto <cyjan@mrcyjanek.net> | 2023-12-30 15:01:47 +0100 |
|---|---|---|
| committer | Czarek Nakamoto <cyjan@mrcyjanek.net> | 2023-12-30 15:01:47 +0100 |
| commit | 9a97f3377ec7c28b1b91c7992505b28745a85e05 (patch) | |
| tree | 7ec9428cfde0c775466e6baf81d0698e75965872 /save_artifact.sh | |
| parent | a3a9a532b36a00b392f5c408051f791166c7dbe8 (diff) | |
cache update
Diffstat (limited to 'save_artifact.sh')
| -rwxr-xr-x | save_artifact.sh | 14 |
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 |
