forked from PLEXSolutions/readhook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassets.sh
executable file
·23 lines (18 loc) · 924 Bytes
/
assets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
declare -r repository=plexsolutions/readhook
declare -r -a assets=(basehook.so fullhook.so noophook.so nullhook.so)
declare tag=$1
# If no tag is given, use the jenkins release assets
if [[ "$tag" == "" ]]; then tag=jenkins; fi
process_asset()
{
# Delete the current asset (if it exists)
asset_id_from_release_tag_and_name=$(pv github asset-id-from-release-tag-and-name $repository $tag $1)
printf "asset-id-from-release-tag-and-name:\n$asset_id_from_release_tag_and_name\n"
delete_release_asset=$(pv github delete-release-asset $repository $asset_id_from_release_tag_and_name)
printf "delete-release-asset:\n$delete_release_asset\n"
upload_release_file_by_tag=$(pv github upload-release-file-by-tag $repository $tag dll/$1)
printf "upload-release-file-by-tag:\n$upload_release_file_by_tag\n"
}
# Process each asset in the list
for asset in ${assets[*]}; do process_asset $asset; done