- if [[ -n ${ARCHIVE_ARTIFACTS:-} ]] ; then
- # Handle multiple search extensions as separate values to '-p|--pattern'
- # "arg1 arg2" -> (-p arg1 -p arg2)
- pattern_opts=()
- for arg in $ARCHIVE_ARTIFACTS; do
- pattern_opts+=("-p" "$arg")
- done
- echo "INFO: archiving workspace using pattern(s): $ARCHIVE_ARTIFACTS"
- lftools deploy archives "${pattern_opts[@]}" \
- "$nexus_url" "$nexus_path" "$WORKSPACE"
- else
- echo "INFO: archiving workspace"
- lftools deploy archives "$nexus_url" "$nexus_path" "$WORKSPACE"
- fi
- echo "INFO: archiving logs"
+ echo "INFO: archiving workspace using pattern(s): ${pattern_opts:-}"
+ # shellcheck disable=SC2086
+ lftools deploy archives ${pattern_opts:-} "$nexus_url" "$nexus_path" "$WORKSPACE"
+
+ echo "INFO: archiving logs to Nexus"