@@ -261,19 +261,27 @@ runs:
261
261
read module image <<< "$(echo ${proj} | grep -oE '[^/]+/[^/]+$' | sed 's/\// /g')"
262
262
[[ $image == "*" ]] && warning "Nothing to analyze in ${proj}" && echo "::warning file=$(realpath "$0")::Nothing to analyze" && exit 0
263
263
264
- info "Start analyzing module \"${module}\" image \"${image}\"..."
265
- send "svace analyze --quiet --svace-dir ${proj}"
266
- success "Analysis completed successfully!"
267
-
268
- info "Start archiving module \"${module}\" image \"${image}\"..."
269
- send "cd ${proj} && tar -czf ${image}.tar.gz .svace-dir && rm -rf .svace-dir"
270
- info "Archiving completed successfuly!"
264
+ if [[ -d "${proj}/.svace-dir" ]]; then
265
+ info "Start analyzing module \"${module}\" image \"${image}\"..."
266
+ send "svace analyze --quiet --svace-dir ${proj}"
267
+ success "Analysis completed successfully!"
268
+
269
+ info "Start archiving module \"${module}\" image \"${image}\"..."
270
+ send "cd ${proj} && tar -czf ${image}.tar.gz .svace-dir && rm -rf .svace-dir"
271
+ info "Archiving completed successfuly!"
272
+ else
273
+ warning "Nothing to analyze! Couldn't find \".svace-dir\" in \"${proj}\""
274
+ fi
271
275
272
- info "Start importing module \"${module}\" image \"${image}\"..."
273
- upload_to_svacer "${module}/${image}" "${CI_COMMIT_REF_NAME}" "${proj}/${image}.tar.gz"
274
- success "Import completed successfuly!"
276
+ if [[ -f "${proj}/${image}.tar.gz" ]]
277
+ info "Start importing module \"${module}\" image \"${image}\"..."
278
+ upload_to_svacer "${module}/${image}" "${CI_COMMIT_REF_NAME}" "${proj}/${image}.tar.gz"
279
+ success "Import completed successfuly!"
280
+ else
281
+ warning "Nothing to import! Couldn't find \"${image}.tar.gz\" in \"${proj}\""
282
+ fi
275
283
276
- info "Cleaning up imported artifacts..."
284
+ info "Cleaning up artifacts..."
277
285
send "rm -rf /${proj}"
278
286
send "find /${SVACE_ANALYZE_DIR}/${CI_COMMIT_HASH} -type d -empty -delete"
279
287
info "Cleanup completed successfully"
0 commit comments