summaryrefslogtreecommitdiffstats
path: root/mvn-phase-script.sh
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2017-09-21 05:42:28 +0000
committerLusheng Ji <lji@research.att.com>2017-09-21 05:42:28 +0000
commitd92d4485b1838c9942cba08458ceff29b0555206 (patch)
tree127a5020e62f5daa15c8dff3d5d1fc70750a07dd /mvn-phase-script.sh
parent93ed9de8d75d30ed52af08f054bae6f633df1328 (diff)
Use dcaegen2 as pom parent
Issue-Id: DCAEGEN2-103 Change-Id: I568ae97a2df0dfca099624810800e3e781f1aeb8 Signed-off-by: Lusheng Ji <lji@research.att.com>
Diffstat (limited to 'mvn-phase-script.sh')
-rwxr-xr-xmvn-phase-script.sh62
1 files changed, 15 insertions, 47 deletions
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh
index 5b183e2..14b1124 100755
--- a/mvn-phase-script.sh
+++ b/mvn-phase-script.sh
@@ -18,6 +18,7 @@
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+
set -ex
@@ -25,73 +26,38 @@ 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
+ exit 1
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)
-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"
+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
+TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
+export BUILD_NUMBER="${TIMESTAMP}"
-source "${PROJECT_ROOT}"/mvn-phase-lib.sh
-# Customize the section below for each project
+shift 2
+
case $MVN_PHASE in
clean)
echo "==> clean phase script"
clean_templated_files
clean_tox_files
- rm -rf ./venv-* ./*.wgn
+ rm -rf ./venv-* ./*.wgn ./site ./coverage.xml ./xunit-results.xml
;;
generate-sources)
echo "==> generate-sources phase script"
@@ -102,6 +68,9 @@ compile)
;;
test)
echo "==> test phase script"
+ set +e
+ run_tox_test
+ set -e
;;
package)
echo "==> package phase script"
@@ -125,7 +94,6 @@ deploy)
echo "====> unknown mvn project module"
;;
esac
-
;;
*)
echo "==> unprocessed phase"