blob: f51fa1cadec32829393cb5b61c6d3cc2ecece1ec [file] [log] [blame]
efiacor9b532682019-11-06 11:08:54 +00001#!/bin/bash
2# ============LICENSE_START=======================================================
3# Copyright (C) 2019 Nordix Foundation.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19
20set -ex
21
22echo "running script: [$0] for module [$1] at stage [$2]"
23
24MVN_PROJECT_MODULEID="$1"
25MVN_PHASE="$2"
26PROJECT_ROOT=$(dirname $0)
27
28
29echo "MVN_RELEASE_TAG is set to [$MVN_RELEASE_TAG]"
30RELEASE_TAG=${MVN_RELEASE_TAG:-R6}
31if [[ "$RELEASE_TAG" != "R1" ]]; then
32 RELEASE_TAGGED_DIR="${RELEASE_TAG}/"
33else
34 RELEASE_TAGGED_DIR=""
35fi
36
37
38if [[ ! -f "${PROJECT_ROOT}/mvn-phase-lib.sh" ]]; then
39 if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \
40 "$MVN_RAWREPO_BASEURL_DOWNLOAD"/org.onap.dcaegen2.utils/${RELEASE_TAGGED_DIR}scripts/mvn-phase-lib.sh; then
41 echo "Fail to download mvn-phase-lib.sh"
42 exit 1
43 fi
44fi
45
46source ./mvn-phase-lib.sh
47
48# Customize the section below for each project
49case ${MVN_PHASE} in
50clean)
51 echo "==> clean phase script"
52 clean_templated_files
53 clean_tox_files
54 rm -rf ./venv-* ./*.wgn
55 ;;
56generate-sources)
57 echo "==> generate-sources phase script"
58 ;;
59compile)
60 echo "==> compile phase script"
61 ;;
62test)
63 echo "==> test phase script"
64 run_tox_test
65 ;;
66package)
67 echo "==> package phase script"
68 ;;
69install)
70 echo "==> install phase script"
71 ;;
72deploy)
73 echo "==> deploy phase script"
74 # below segments are example of how to deploy various artifacts
75 # copy the ones suitable for your repo
76
77 # build docker image from Docker file (under root of repo) and push to registry
78 build_and_push_docker
79 ;;
80*)
81 echo "==> unprocessed phase"
82 ;;
83esac
84