diff options
author | 2017-09-01 03:06:57 +0000 | |
---|---|---|
committer | 2017-09-01 03:07:12 +0000 | |
commit | bad9c3e070330ec6353b53213b320e7d67d9827c (patch) | |
tree | dbfec7bd61d9b58d3622e45124f65ea7c61565d3 /mvn-phase-script.sh | |
parent | a5d8ab5323db15bbff7bd4f17a96a5c1921369d6 (diff) |
Switch to Java template JJB
Issue-Id: DCAEGEN2-60
Change-Id: I927a4146599c37b39e7a56169e9273f82431a247
Signed-off-by: Lusheng Ji <lji@research.att.com>
Diffstat (limited to 'mvn-phase-script.sh')
-rwxr-xr-x | mvn-phase-script.sh | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh new file mode 100755 index 0000000..24c18bc --- /dev/null +++ b/mvn-phase-script.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +# ================================================================================ +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. + + +echo "running script: [$0] for module [$1] at stage [$2]" + +echo "=> Prepare environment " +#env + +TIMESTAMP=$(date +%C%y%m%dT%H%M%S) +export BUILD_NUMBER="${TIMESTAMP}" + +# 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 "=> Nexu Proxy at $MVN_NEXUSPROXY_HOST, $MVN_NEXUSPROXY" + + +# use the version text detect it is a SNAPSHOT build or STAGING build +if [[ "$MVN_PROJECT_VERSION" == *SNAPSHOT ]]; then + echo "=> for SNAPSHOT artifact build" +else + echo "=> for STAGING/RELEASE artifact build" +fi + + +# mvn phase in life cycle +MVN_PHASE="$2" + +case $MVN_PHASE in +clean) + echo "==> clean phase script" + ;; +generate-sources) + echo "==> generate-sources phase script" + ;; +compile) + echo "==> compile phase script" + ;; +test) + echo "==> test phase script" + ;; +package) + echo "==> package phase script" + ;; +install) + echo "==> install phase script" + ;; +deploy) + echo "==> deploy phase script" + ;; +*) + echo "==> unprocessed phase" + ;; +esac + |