-#!/bin/bash
+#!/bin/bash -l
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
# project.groupId is not set but IS inherited from project.parent.groupId
# else
# exclude project mailing list
-if [ ! -z "$ARTIFACT_ID" ]; then
+if [ -n "$ARTIFACT_ID" ]; then
grouplist=()
while IFS="" read -r p; do
GROUP=$(xmlstarlet sel\
-v "/x:project/x:parent/x:groupId"\
--else -o ""\
"$p" 2>/dev/null)
- if [ ! -z "${GROUP}" ]; then
+ if [ -n "${GROUP}" ]; then
# shellcheck disable=SC2207
grouplist+=($(echo "${GROUP}" | awk -F'.' '{ print $3 }'))
fi
BUILD_STATUS=$(awk '/\[INFO\] Remote staging finished/{flag=1;next}/Total time:/{flag=0}flag' $CONSOLE_LOG \
| grep '\] BUILD' | awk '{print $3}')
-if ([ ! -z "${NAME}" ] || [ ! -z "${ARTIFACT_ID}" ]) && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then
+# shellcheck disable=SC2235
+if ([ -n "${NAME}" ] || [ -n "${ARTIFACT_ID}" ]) && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then
# project search pattern should handle both scenarios
# 1. Full format: ODL :: $PROJECT :: $ARTIFACT_ID
# 2. Partial format: Building $ARTIFACT_ID