blob: 9402c898c30c6d168a33ab1e359b78aa61095a0b [file] [log] [blame]
Ladue, David (dl3158)64292312017-08-23 11:27:58 -04001#!/bin/bash
2
Lusheng Ji7bb22602017-09-11 22:52:13 +00003# ================================================================================
Lusheng Jia6f91ef2018-02-12 11:03:36 -05004# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
Lusheng Ji7bb22602017-09-11 22:52:13 +00005# ================================================================================
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
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
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=========================================================
18#
19# ECOMP is a trademark and service mark of AT&T Intellectual Property.
20
21set -ex
22
23
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040024echo "running script: [$0] for module [$1] at stage [$2]"
25
Lusheng Ji7bb22602017-09-11 22:52:13 +000026MVN_PROJECT_MODULEID="$1"
27MVN_PHASE="$2"
Lusheng Ji1ee28592018-03-28 02:39:54 -040028PROJECT_ROOT=$(dirname $0)
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040029
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040030
Lusheng Ji1ee28592018-03-28 02:39:54 -040031echo "MVN_RELEASE_TAG is set to [$MVN_RELEASE_TAG]"
vv770dd06365a2021-03-09 15:55:41 +000032RELEASE_TAG=${MVN_RELEASE_TAG:-R9}
Lusheng Ji1ee28592018-03-28 02:39:54 -040033if [ "$RELEASE_TAG" != "R1" ]; then
34 RELEASE_TAGGED_DIR="${RELEASE_TAG}/"
Lusheng Ji7bb22602017-09-11 22:52:13 +000035else
Lusheng Ji1ee28592018-03-28 02:39:54 -040036 RELEASE_TAGGED_DIR=""
Lusheng Ji7bb22602017-09-11 22:52:13 +000037fi
Michal Jagielloaa6f2f22021-01-15 13:04:54 +000038
vv770d9522fea2021-02-17 17:44:01 +000039#source "${PROJECT_ROOT}"/mvn-phase-lib.sh
40if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \
41 "$MVN_RAWREPO_BASEURL_DOWNLOAD"/org.onap.dcaegen2.utils/${RELEASE_TAGGED_DIR}scripts/mvn-phase-lib.sh; then
42 echo "Fail to download mvn-phase-lib.sh"
43 exit 1
44fi
Lusheng Ji7bb22602017-09-11 22:52:13 +000045
46
Michal Jagielloaa6f2f22021-01-15 13:04:54 +000047source ./mvn-phase-lib.sh
Lusheng Ji7bb22602017-09-11 22:52:13 +000048
49
50# Customize the section below for each project
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040051case $MVN_PHASE in
52clean)
53 echo "==> clean phase script"
Lusheng Ji7bb22602017-09-11 22:52:13 +000054 clean_templated_files
55 clean_tox_files
56 rm -rf ./venv-* ./*.wgn
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040057 ;;
58generate-sources)
59 echo "==> generate-sources phase script"
Lusheng Ji7bb22602017-09-11 22:52:13 +000060 expand_templates
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040061 ;;
62compile)
63 echo "==> compile phase script"
64 ;;
65test)
66 echo "==> test phase script"
Lusheng Ji1ee28592018-03-28 02:39:54 -040067 run_tox_test
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040068 ;;
69package)
70 echo "==> package phase script"
71 ;;
72install)
73 echo "==> install phase script"
74 ;;
75deploy)
76 echo "==> deploy phase script"
Lusheng Ji7bb22602017-09-11 22:52:13 +000077
78 # below segments are example of how to deploy various artifacts
79 # copy the ones suitable for your repo, and remove the "if false" statement
80
81 # build docker image from Docker file (under root of repo) and push to registry
Lusheng Ji7bb22602017-09-11 22:52:13 +000082 build_and_push_docker
Lusheng Ji7bb22602017-09-11 22:52:13 +000083
84 # upload all yaml file under the root of repo
Ladue, David (dl3158)64292312017-08-23 11:27:58 -040085 ;;
86*)
87 echo "==> unprocessed phase"
88 ;;
89esac
Lusheng Ji7bb22602017-09-11 22:52:13 +000090