echo "VERSION: ${VERSION}"
STAGING_REPO_ID=$(grep "$NEXUS_STAGING_URL" "$WORKSPACE/archives/staging-repo.txt" | awk '{print $1}')
BUNDLE_URL="${NEXUSURL}/${STAGING_REPO_ID}/org/opendaylight/integration/${KARAF_ARTIFACT}/${VERSION}/${KARAF_ARTIFACT}-${VERSION}.zip"
+# shellcheck disable=SC2129
echo STAGING_REPO_ID="$STAGING_REPO_ID" >> "$WORKSPACE/variables.prop"
echo BUNDLE_URL="$BUNDLE_URL" >> "$WORKSPACE/variables.prop"
echo KARAF_VERSION="$KARAF_VERSION" >> "$WORKSPACE/variables.prop"
if [[ $project =~ project.groupId ]] || [[ $project =~ odlparent ]]; then
continue
elif [[ $project =~ org.opendaylight ]]; then
- project=$(echo "${project/org.opendaylight./}")
- project_int_dist+=( "$(echo "${project/.//}" )" )
+ project=${project/org.opendaylight./}
+ project_int_dist+=("${project/.//}")
fi
done
# 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
git add "${VIEWS_AR_YAML_FILE}"
-mkdir -p ${WORKSPACE}/archives
-cp "${VIEWS_AR_YAML_FILE}" ${WORKSPACE}/archives
+mkdir -p "${WORKSPACE}/archives"
+cp "${VIEWS_AR_YAML_FILE}" "${WORKSPACE}/archives"