3 # ================================================================================
4 # Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
23 echo "running script: [$0] for module [$1] at stage [$2]"
25 MVN_PROJECT_MODULEID="$1"
27 PROJECT_ROOT=$(dirname $0)
30 echo "MVN_RELEASE_TAG is set to [$MVN_RELEASE_TAG]"
31 RELEASE_TAG=${MVN_RELEASE_TAG:-R9}
32 if [ "$RELEASE_TAG" != "R1" ]; then
33 RELEASE_TAGGED_DIR="${RELEASE_TAG}/"
37 if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \
38 "$MVN_RAWREPO_BASEURL_DOWNLOAD"/org.onap.dcaegen2.utils/${RELEASE_TAGGED_DIR}scripts/mvn-phase-lib.sh; then
39 echo "Fail to download mvn-phase-lib.sh"
42 source "${PROJECT_ROOT}"/mvn-phase-lib.sh
45 TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
46 export BUILD_NUMBER="${TIMESTAMP}"
51 echo "==> clean phase script"
54 rm -rf ./venv-* ./*.wgn ./site ./coverage.xml ./xunit-results.xml
57 echo "==> generate-sources phase script"
61 echo "==> compile phase script"
64 echo "==> test phase script"
65 case $MVN_PROJECT_MODULEID in
66 dcae-services-policy-sync)
69 TOXINIS=$(find . -name "tox.ini")
70 for TOXINI in "${TOXINIS[@]}"; do
71 DIR=$(echo "$TOXINI" | rev | cut -f2- -d'/' | rev)
73 rm -rf ./venv-tox ./.tox
75 source ./venv-tox/bin/activate
76 pip install pip==20.3.4
77 pip install --upgrade argparse
82 rm -rf ./venv-tox ./.tox
88 echo "==> package phase script"
91 echo "==> install phase script"
92 case $MVN_PROJECT_MODULEID in
94 upload_files_of_extension sh
99 echo "==> deploy phase script"
101 case $MVN_PROJECT_MODULEID in
102 cm-container|healthcheck-container|tls-init-container|consul-loader-container|multisite-init-container|dcae-k8s-cleanup-container|dcae-services-policy-sync)
103 build_and_push_docker
106 echo "====> unknown mvn project module"
111 echo "==> unprocessed phase"