-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworsica_bash_common_uc.sh
378 lines (358 loc) · 15.7 KB
/
worsica_bash_common_uc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
CREDENTIALS=""
function get_nextcloud_credentials_from_file {
CREDENTIALS_FILE="/usr/local/worsica_web_products/nc-credentials"
if [[ -f ${CREDENTIALS_FILE} ]] ; then
CREDENTIALS=$(cat ${CREDENTIALS_FILE})
echo "[worsica_bash_common_uc.sh] [get_nextcloud_credentials_from_file] [SUCCESS] Found nextcloud credentials (${CREDENTIALS_FILE})"
else
echo "[worsica_bash_common_uc.sh] [get_nextcloud_credentials_from_file] [FAILURE] Error, no credentials found, abort. (${CREDENTIALS_FILE})"
exit 1
fi
}
#affect the ROI_SIMULATION_FOLDER and PATH_TO_PRODUCTS
WORSICA_FOLDER_PATH=$(pwd)
ROI_SIMULATION_FOLDER=""
ROI_SIMULATION_FOLDER_SIM=""
PATH_TO_PRODUCTS=""
PATH_TO_PRODUCTS_SIM=""
function set_path_to_products {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
ROI_SIMULATION_FOLDER="$1/user$2/roi$3/userchosen$4"
PATH_TO_PRODUCTS="${WORSICA_FOLDER_PATH}/${ROI_SIMULATION_FOLDER}"
#echo "[worsica_bash_common_uc.sh] [set_path_to_products] Register PATH_TO_PRODUCTS=${PATH_TO_PRODUCTS}"
}
function set_path_to_products_sim {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
ROI_SIMULATION_FOLDER_SIM="$1/user$2/roi$3/simulation$4"
PATH_TO_PRODUCTS_SIM="${WORSICA_FOLDER_PATH}/${ROI_SIMULATION_FOLDER_SIM}"
#echo "[worsica_bash_common_uc.sh] [set_path_to_products_sim] Register PATH_TO_PRODUCTS=${PATH_TO_PRODUCTS}"
}
#get path, when calling this function from an external script bash
function get_path_to_products {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_path_to_products $1 $2 $3 $4
echo PATH_TO_PRODUCTS
}
function get_roi_simulation_folder {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_path_to_products $1 $2 $3 $4
echo ROI_SIMULATION_FOLDER
}
function get_path_to_products_sim {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_path_to_products_sim $1 $2 $3 $4
echo ${PATH_TO_PRODUCTS_SIM}
}
function get_roi_simulation_folder_sim {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_path_to_products_sim $1 $2 $3 $4
echo ROI_SIMULATION_FOLDER_SIM
}
#affect the NEXTCLOUD_PATH_TO_PRODUCTS
NEXTCLOUD_WEBDAV_PATH="remote.php/dav/files/worsicaAdmin"
NEXTCLOUD_REMOTE_PATH="http://nextcloud/${NEXTCLOUD_WEBDAV_PATH}"
NEXTCLOUD_PATH_TO_REPOSITORY="${NEXTCLOUD_REMOTE_PATH}/repository_images"
NEXTCLOUD_PATH_TO_PRODUCTS=""
function set_nextcloud_path_to_products {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_path_to_products $1 $2 $3 $4
NEXTCLOUD_PATH_TO_PRODUCTS="${NEXTCLOUD_REMOTE_PATH}/${ROI_SIMULATION_FOLDER}"
#echo "[worsica_bash_common_uc.sh] [set_nextcloud_path_to_products] Register NEXTCLOUD_PATH_TO_PRODUCTS=${NEXTCLOUD_PATH_TO_PRODUCTS}"
}
function set_nextcloud_path_to_products_sim {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_path_to_products_sim $1 $2 $3 $4
NEXTCLOUD_PATH_TO_PRODUCTS="${NEXTCLOUD_REMOTE_PATH}/${ROI_SIMULATION_FOLDER_SIM}"
#echo "[worsica_bash_common_uc.sh] [set_nextcloud_path_to_products] Register NEXTCLOUD_PATH_TO_PRODUCTS=${NEXTCLOUD_PATH_TO_PRODUCTS}"
}
#get nextcloud path, when calling this function from an external script bash
function get_nextcloud_path_to_products {
#$1 SERVICE
#$2 USER_ID
#$3 ROI_ID
#$4 USERCHOSEN_ID
set_nextcloud_path_to_products $1 $2 $3 $4
echo PATH_TO_PRODUCTS
}
function create_folder {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${SIMULATION_STATE}
get_nextcloud_credentials_from_file
set_nextcloud_path_to_products $1 $2 $3 $4
echo "[worsica_bash_common_uc.sh] [create_folder] $1-user$2-roi$3-uc$4 state: $5"
echo "============================START============================"
echo "[worsica_bash_common_uc.sh] [create_folder] Check if folder exists"
if cd "${PATH_TO_PRODUCTS}" ; then
echo "[worsica_bash_common_uc.sh] [create_folder] Found folder, no need to create"
else
echo "[worsica_bash_common_uc.sh] [create_folder] [FAILURE] Folder does not exist"
echo "[worsica_bash_common_uc.sh] [create_folder] Create folder ${PATH_TO_PRODUCTS}"
if mkdir -p "${PATH_TO_PRODUCTS}" ; then
echo "[worsica_bash_common_uc.sh] [create_folder] [SUCCESS] Created folder, change directory"
cd "${PATH_TO_PRODUCTS}"
echo $(pwd)
else
echo "[worsica_bash_common_uc.sh] [create_folder] [FAILURE] Unable to create folder"
exit 1
fi
fi
echo "[worsica_bash_common_uc.sh] [create_folder] Check if nextcloud folder exists"
CURL_STATUS=$(curl -u ${CREDENTIALS} -X PROPFIND ${NEXTCLOUD_PATH_TO_PRODUCTS} -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
echo $CURL_STATUS
if [[ $CURL_STATUS -eq 200 ]] || [[ $CURL_STATUS -eq 207 ]] ; then
echo "[worsica_bash_common_uc.sh] [create_folder] [SUCCESS] Nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS} folder exists"
else
#create folders inside nextcloud
#create the workspace folder, then the simulation folder
echo "[worsica_bash_common_uc.sh] [create_folder] Nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS} folder does not exist"
CURL_STATUS=$(curl -u ${CREDENTIALS} -X MKCOL "${NEXTCLOUD_REMOTE_PATH}/$1" -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
echo $CURL_STATUS
if [[ $CURL_STATUS -eq 201 ]] || [[ $CURL_STATUS -eq 405 ]] ; then
echo "[worsica_bash_common_uc.sh] [create_folder] Nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS}/$1 folder does not exist"
CURL_STATUS=$(curl -u ${CREDENTIALS} -X MKCOL "${NEXTCLOUD_REMOTE_PATH}/$1/user$2" -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
echo $CURL_STATUS
if [[ $CURL_STATUS -eq 201 ]] || [[ $CURL_STATUS -eq 405 ]] ; then
echo "[worsica_bash_common_uc.sh] [create_folder] Nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS}/$1/user$2 folder does not exist"
CURL_STATUS=$(curl -u ${CREDENTIALS} -X MKCOL "${NEXTCLOUD_REMOTE_PATH}/$1/user$2/roi$3" -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
echo $CURL_STATUS
if [[ $CURL_STATUS -eq 201 ]] || [[ $CURL_STATUS -eq 405 ]] ; then
echo "[worsica_bash_common_uc.sh] [create_folder] Nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS}/$1/user$2/roi$3 folder does not exist"
CURL_STATUS=$(curl -u ${CREDENTIALS} -X MKCOL "${NEXTCLOUD_REMOTE_PATH}/$1/user$2/roi$3/userchosen$4" -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
echo $CURL_STATUS
if [[ $CURL_STATUS -eq 201 ]] || [[ $CURL_STATUS -eq 405 ]] ; then
echo "[worsica_bash_common_uc.sh] [create_folder] [SUCCESS] Created nextcloud folder ${NEXTCLOUD_PATH_TO_PRODUCTS}, change directory"
else
echo "[worsica_bash_common_uc.sh] [create_folder] [FAILURE] Unable to create nextcloud folder /userchosen$4 in ${NEXTCLOUD_REMOTE_PATH}/$1/user$2/roi$3"
exit 1
fi
else
echo "[worsica_bash_common_uc.sh] [create_folder] [FAILURE] Unable to create nextcloud folder /roi$3 in ${NEXTCLOUD_REMOTE_PATH}/$1/user$2"
exit 1
fi
else
echo "[worsica_bash_common_uc.sh] [create_folder] [FAILURE] Unable to create nextcloud folder /user$2 in ${NEXTCLOUD_REMOTE_PATH}/$1"
exit 1
fi
else
echo "[worsica_bash_common_uc.sh] [create_folder] [FAILURE] Unable to create nextcloud folder /$1 in ${NEXTCLOUD_REMOTE_PATH}"
exit 1
fi
fi
}
function upload_file {
#$1 source
#$2 destination (nextcloud)
#upload_file ${IMAGESET_NAME}.zip '${NEXTCLOUD_PATH_TO_REPOSITORY}/${IMAGESET_NAME}.zip'
#states: 201 (CREATED), 204
#(STATUS=$(curl -u ${CREDENTIALS} -T w1a.log 'http://nextcloud/remote.php/dav/files/worsicaAdmin/w1a.log' -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)'); echo $STATUS; if [ $STATUS -eq 201 ]; then echo 'OK'; else echo 'Fail'; fi)
get_nextcloud_credentials_from_file
echo "[worsica_bash_common_uc.sh] [upload_file] Uploading $1 to $2";
CURL_STATUS=$(curl --max-time 60 -u ${CREDENTIALS} -T $1 $2 -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
echo $CURL_STATUS
if [[ $CURL_STATUS -eq 201 ]] || [[ $CURL_STATUS -eq 204 ]]; then
echo "[worsica_bash_common_uc.sh] [upload_file] [SUCCESS] Uploaded to nextcloud $1 to $2"
else
echo "[worsica_bash_common_uc.sh] [upload_file] [FAILURE] Fail upload to nextcloud $1 to $2"
exit 1
fi
}
function download_file {
#$1 source (nextcloud)
#$2 destination
#download_file ${f} ${PATH_TO_PRODUCTS}/${f2}
#states: 200 (OK), 404
#(STATUS=$(curl -u ${CREDENTIALS} -kL 'http://nextcloud/remote.php/dav/files/worsicaAdmin/w2.log' -w '<http_code>%{http_code}</http_code>' -o w2.log | grep -oP '(?<=<http_code>).*?(?=</http_code>)'); echo $STATUS; if [ $STATUS -eq 200 ]; then echo 'OK'; else echo 'Fail'; fi)
get_nextcloud_credentials_from_file
echo "[worsica_bash_common_uc.sh] [download_file] Downloading $1 to $2";
CURL_STATUS=$(curl --max-time 60 -u ${CREDENTIALS} -kL $1 -o $2 -w '<http_code>%{http_code}</http_code>' | grep -oP '(?<=<http_code>).*?(?=</http_code>)')
if [[ $CURL_STATUS -eq 200 ]] ; then
echo "[worsica_bash_common_uc.sh] [download_file] [SUCCESS] Downloaded $1 to $2";
else
echo "[worsica_bash_common_uc.sh] [download_file] [FAILURE] Failed downloading $1 to $2. File does not exist or a problem occured with the download.";
rm -rf $2 #remove the file from host, it will output trash
exit 1
fi
}
#$1 is full nextcloud path ${NEXTCLOUD_PATH_TO_PRODUCTS}
function list_files_nextcloud {
get_nextcloud_credentials_from_file
LF=$(curl -u ${CREDENTIALS} -X PROPFIND $1)
echo $LF | grep -oP '(?<=<d:href>).*?(?=</d:href>)'
}
#load the processing state from nextcloud
function pull_processing {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESET_NAME}
TAR_FILE_PREFIX=$1-user$2-roi$3-uc$4-$5
set_nextcloud_path_to_products $1 $2 $3 $4
echo "[worsica_bash_common_uc.sh] [pull_processing] Check for final products ${TAR_FILE_PREFIX}"
LIST_FILES=$(list_files_nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS})
f2="${TAR_FILE_PREFIX}-final-products.zip"
if [[ ${LIST_FILES} == *${f2}* ]]; then
echo "[worsica_bash_common_uc.sh] [pull_processing] $f2 found, downloading tar ..."
download_file ${NEXTCLOUD_PATH_TO_PRODUCTS}/$f2 ${WORSICA_FOLDER_PATH}/$f2
cd ${WORSICA_FOLDER_PATH}
unzip -o ${WORSICA_FOLDER_PATH}/$f2
rm -rf $f2
else
echo "[worsica_bash_common_uc.sh] [pull_processing] $f2 not found, skip ..."
fi
#done
}
#load the processing state from nextcloud
function pull_processing_sim {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESET_NAME}
TAR_FILE_PREFIX=$1-user$2-roi$3-s$4-$5
set_nextcloud_path_to_products_sim $1 $2 $3 $4
echo "[worsica_bash_common_uc.sh] [pull_processing_sim] Check for final products ${TAR_FILE_PREFIX}"
LIST_FILES=$(list_files_nextcloud ${NEXTCLOUD_PATH_TO_PRODUCTS})
f2="${TAR_FILE_PREFIX}-final-products.zip"
if [[ ${LIST_FILES} == *${f2}* ]]; then
echo "[worsica_bash_common_uc.sh] [pull_processing_sim] $f2 found, downloading tar ..."
download_file ${NEXTCLOUD_PATH_TO_PRODUCTS}/$f2 ${WORSICA_FOLDER_PATH}/$f2
cd ${WORSICA_FOLDER_PATH}
unzip -o ${WORSICA_FOLDER_PATH}/$f2
rm -rf $f2
else
echo "[worsica_bash_common_uc.sh] [pull_processing_sim] $f2 not found, skip ..."
fi
#done
}
#load the processing state from nextcloud
function remove_multiple_processing {
#$1 is ${IMAGESETS_NAME} string by comma joined
#$2 is ${PATH_TO_PRODUCTS}
echo "[worsica_bash_common_uc.sh] [remove_multiple_processing] Remove multiple imagesets $1"
#IFS=','
for i in $(echo $1 | sed "s/,/ /g") ; do #`echo "$1"`; do
echo "[worsica_bash_common_uc.sh] [remove_multiple_processing] Remove $2/$i"
rm -rf $2/$i
done
}
function pull_multiple_processing {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESETS_NAME} string by comma joined
echo "[worsica_bash_common_uc.sh] [pull_multiple_processing] Pull multiple imagesets"
#IFS=','
for i in $(echo $5 | sed "s/,/ /g") ; do # `echo "$5"`; do
echo "[worsica_bash_common_uc.sh] [pull_multiple_processing] Pull $i"
pull_processing $1 $2 $3 $4 $i
done
}
function push_processing {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESET_NAME}
#upload workspace to nextcloud as tar gz
#upload_folder ${PATH_TO_PRODUCTS} '${NEXTCLOUD_PATH_TO_PRODUCTS}'
set_nextcloud_path_to_products $1 $2 $3 $4
TAR_FILE_PREFIX=$1-user$2-roi$3-uc$4-$5
cd ${WORSICA_FOLDER_PATH}
TAR_FILE_FINAL_PRODUCTS=${TAR_FILE_PREFIX}-final-products.zip
echo "[worsica_bash_common_uc.sh] [push_processing] Tar ${TAR_FILE_FINAL_PRODUCTS}"
if (zip -r ${TAR_FILE_FINAL_PRODUCTS} ${ROI_SIMULATION_FOLDER}/$5); then
echo "[worsica_bash_common_uc.sh] [push_processing] Upload tar ${TAR_FILE_FINAL_PRODUCTS} to nextcloud"
upload_file ${WORSICA_FOLDER_PATH}/${TAR_FILE_FINAL_PRODUCTS} ${NEXTCLOUD_PATH_TO_PRODUCTS}/${TAR_FILE_FINAL_PRODUCTS}
rm -rf ${ROI_SIMULATION_FOLDER}/$5
rm -rf ${TAR_FILE_FINAL_PRODUCTS}
else
echo "[worsica_bash_common_uc.sh] [push_processing] Files/folders not found to tar ${TAR_FILE_FINAL_PRODUCTS} to nextcloud, moving on"
fi
}
function push_processing_sim {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESET_NAME}
#upload workspace to nextcloud as tar gz
#upload_folder ${PATH_TO_PRODUCTS} '${NEXTCLOUD_PATH_TO_PRODUCTS}'
set_nextcloud_path_to_products_sim $1 $2 $3 $4
TAR_FILE_PREFIX=$1-user$2-roi$3-s$4-$5
cd ${WORSICA_FOLDER_PATH}
TAR_FILE_FINAL_PRODUCTS=${TAR_FILE_PREFIX}-final-products.zip
echo "[worsica_bash_common_uc.sh] [push_processing] Tar ${TAR_FILE_FINAL_PRODUCTS}"
if (zip -r ${TAR_FILE_FINAL_PRODUCTS} ${ROI_SIMULATION_FOLDER_SIM}/$5); then
echo "[worsica_bash_common_uc.sh] [push_processing] Upload tar ${TAR_FILE_FINAL_PRODUCTS} to nextcloud"
upload_file ${WORSICA_FOLDER_PATH}/${TAR_FILE_FINAL_PRODUCTS} ${NEXTCLOUD_PATH_TO_PRODUCTS}/${TAR_FILE_FINAL_PRODUCTS}
rm -rf ${ROI_SIMULATION_FOLDER_SIM}/$5
rm -rf ${TAR_FILE_FINAL_PRODUCTS}
else
echo "[worsica_bash_common_uc.sh] [push_processing] Files/folders not found to tar ${TAR_FILE_FINAL_PRODUCTS} to nextcloud, moving on"
fi
}
function pull_imageset {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESET_NAME}
set_path_to_products $1 $2 $3 $4
echo "[worsica_bash_common_uc.sh] [pull_imageset] Download the imageset from the ${NEXTCLOUD_PATH_TO_REPOSITORY}/$5.zip to the ${PATH_TO_PRODUCTS}/$5.zip"
LIST_FILES=$(list_files_nextcloud ${NEXTCLOUD_PATH_TO_REPOSITORY})
#download_file ${NEXTCLOUD_PATH_TO_REPOSITORY}/${f2} ${PATH_TO_PRODUCTS}/${f2}
f2="$5.zip"
#for f in $(list_files_nextcloud ${NEXTCLOUD_PATH_TO_REPOSITORY}); do
# f2=${f#/${NEXTCLOUD_WEBDAV_PATH}/repository_images/}
# echo $f2
if [[ ${LIST_FILES} == *${f2}* ]]; then
echo "[worsica_bash_common_uc.sh] [pull_imageset] $f2 found, downloading zip..."
download_file ${NEXTCLOUD_PATH_TO_REPOSITORY}/$f2 ${PATH_TO_PRODUCTS}/$f2
else
echo "[worsica_bash_common_uc.sh] [pull_imageset] $f2 not found, skip..."
fi
#done
}
#store the processing state to nextcloud
function push_imageset {
#$1 is ${SERVICE}
#$2 is ${USER_ID}
#$3 is ${ROI_ID}
#$4 is ${USERCHOSEN_ID}
#$5 is ${IMAGESET_NAME}
set_path_to_products $1 $2 $3 $4
echo "[worsica_bash_common_uc.sh] [push_imageset] Upload $5.zip"
upload_file ${PATH_TO_PRODUCTS}/$5.zip ${NEXTCLOUD_PATH_TO_REPOSITORY}/$5.zip
echo "[worsica_bash_common_uc.sh] [push_imageset] Remove zip and sha1 files on host side"
#rm -rf ${PATH_TO_PRODUCTS}/${IMAGESET_NAME}.zip.sha1 ${PATH_TO_PRODUCTS}/${IMAGESET_NAME}.zip
rm -rf ${PATH_TO_PRODUCTS}/$5.zip
}