summaryrefslogtreecommitdiffstats
path: root/mvn-phase-script.sh
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2018-02-19 23:57:20 -0500
committerLusheng Ji <lji@research.att.com>2018-02-20 00:00:28 -0500
commit7e99e115d213e3a4395fe56f1bfbeacc0a501e3b (patch)
treef8a3f21b1fa01fd6af2b2920404913d422854a05 /mvn-phase-script.sh
parent967cc9add2fe92799be0488fd262e38e79b61f58 (diff)
Fix for SONAR reporting
Change-Id: I853af6b231b4b2f4eff7492d4770ce6a3a7fd786 Signed-off-by: Lusheng Ji <lji@research.att.com> Issue-ID: DCAEGEN2-355
Diffstat (limited to 'mvn-phase-script.sh')
-rwxr-xr-xmvn-phase-script.sh66
1 files changed, 17 insertions, 49 deletions
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh
index 4f4b1fc..86c3554 100755
--- a/mvn-phase-script.sh
+++ b/mvn-phase-script.sh
@@ -20,72 +20,38 @@
set -ex
-
echo "running script: [$0] for module [$1] at stage [$2]"
MVN_PROJECT_MODULEID="$1"
MVN_PHASE="$2"
-
-
PROJECT_ROOT=$(dirname $0)
-FQDN="${MVN_PROJECT_GROUPID}.${MVN_PROJECT_ARTIFACTID}"
-if [ "$MVN_PROJECT_MODULEID" == "__" ]; then
- MVN_PROJECT_MODULEID=""
-fi
-
-if [[ "$MVN_PROJECT_VERSION" == *SNAPSHOT ]]; then
- echo "=> for SNAPSHOT artifact build"
- MVN_DEPLOYMENT_TYPE='SNAPSHOT'
-else
- echo "=> for STAGING/RELEASE artifact build"
- MVN_DEPLOYMENT_TYPE='STAGING'
-fi
-echo "MVN_DEPLOYMENT_TYPE is [$MVN_DEPLOYMENT_TYPE]"
-
-
-TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-
# expected environment variables
if [ -z "${MVN_NEXUSPROXY}" ]; then
echo "MVN_NEXUSPROXY environment variable not set. Cannot proceed"
- exit
-fi
-MVN_NEXUSPROXY_HOST=$(echo "$MVN_NEXUSPROXY" |cut -f3 -d'/' | cut -f1 -d':')
-echo "=> Nexus Proxy at $MVN_NEXUSPROXY_HOST, $MVN_NEXUSPROXY"
-
-if [ -z "$WORKSPACE" ]; then
- WORKSPACE=$(pwd)
+ exit 1
fi
-
if [ -z "$SETTINGS_FILE" ]; then
echo "SETTINGS_FILE environment variable not set. Cannot proceed"
- exit
+ exit 2
fi
-
-
-
-# mvn phase in life cycle
-MVN_PHASE="$2"
+set +e
+if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \
+ "$MVN_RAWREPO_BASEURL_DOWNLOAD"/org.onap.dcaegen2.utils/releases/scripts/mvn-phase-lib.sh; then
+ cp "${PROJECT_ROOT}"/scripts/mvn-phase-lib.sh "${PROJECT_ROOT}/mvn-phase-lib.sh"
+fi
+source "${PROJECT_ROOT}"/mvn-phase-lib.sh
-echo "MVN_PROJECT_MODULEID is [$MVN_PROJECT_MODULEID]"
-echo "MVN_PHASE is [$MVN_PHASE]"
-echo "MVN_PROJECT_GROUPID is [$MVN_PROJECT_GROUPID]"
-echo "MVN_PROJECT_ARTIFACTID is [$MVN_PROJECT_ARTIFACTID]"
-echo "MVN_PROJECT_VERSION is [$MVN_PROJECT_VERSION]"
-echo "MVN_NEXUSPROXY is [$MVN_NEXUSPROXY]"
-echo "MVN_RAWREPO_BASEURL_UPLOAD is [$MVN_RAWREPO_BASEURL_UPLOAD]"
-echo "MVN_RAWREPO_BASEURL_DOWNLOAD is [$MVN_RAWREPO_BASEURL_DOWNLOAD]"
-MVN_RAWREPO_HOST=$(echo "$MVN_RAWREPO_BASEURL_UPLOAD" | cut -f3 -d'/' |cut -f1 -d':')
-echo "MVN_RAWREPO_HOST is [$MVN_RAWREPO_HOST]"
-echo "MVN_RAWREPO_SERVERID is [$MVN_RAWREPO_SERVERID]"
-echo "MVN_DOCKERREGISTRY_DAILY is [$MVN_DOCKERREGISTRY_DAILY]"
-echo "MVN_DOCKERREGISTRY_RELEASE is [$MVN_DOCKERREGISTRY_RELEASE]"
+# This is the base for where "deploy" will upload
+# MVN_NEXUSPROXY is set in the pom.xml
+REPO=$MVN_NEXUSPROXY/content/sites/raw/$MVN_PROJECT_GROUPID
-source "${PROJECT_ROOT}"/mvn-phase-lib.sh
+TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
+export BUILD_NUMBER="${TIMESTAMP}"
+shift 2
# Customize the section below for each project
case $MVN_PHASE in
@@ -93,7 +59,7 @@ clean)
echo "==> clean phase script"
clean_templated_files
clean_tox_files
- rm -rf ./venv-* ./*.wgn ./site
+ rm -rf ./venv-* ./*.wgn ./site logs
;;
generate-sources)
echo "==> generate-sources phase script"
@@ -104,6 +70,8 @@ compile)
;;
test)
echo "==> test phase script"
+ mkdir logs
+ run_tox_test
;;
package)
echo "==> package phase script"