diff options
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 |
