Update plugin version in k8s type file
[dcaegen2/platform/plugins.git] / mvn-phase-script.sh
1 #!/bin/bash
2
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
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 set -ex
20
21
22 echo "running script: [$0] for module [$1] at stage [$2]"
23
24 MVN_PROJECT_MODULEID="$1"
25 MVN_PHASE="$2"
26
27 PROJECT_ROOT=$(dirname $0)
28
29 set -e
30 RELEASE_TAG=${MVN_RELEASE_TAG:-R3}
31 if [ "$RELEASE_TAG" != "R1" ]; then
32   RELEASE_TAGGED_DIR="${RELEASE_TAG}/"
33 else
34   RELEASE_TAGGED_DIR="releases"
35 fi
36 if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \
37   "$MVN_RAWREPO_BASEURL_DOWNLOAD"/org.onap.dcaegen2.utils/${RELEASE_TAGGED_DIR}scripts/mvn-phase-lib.sh; then
38   echo "Fail to download mvn-phase-lib.sh"
39   exit 1
40 fi
41 source "${PROJECT_ROOT}"/mvn-phase-lib.sh
42
43
44 # Customize the section below for each project
45 case $MVN_PHASE in
46 clean)
47   echo "==> clean phase script"
48   clean_templated_files
49   clean_tox_files
50   rm -rf ./venv-* ./*.wgn ./site
51   ;;
52 generate-sources)
53   echo "==> generate-sources phase script"
54   expand_templates
55   ;;
56 compile)
57   echo "==> compile phase script"
58   ;;
59 test)
60   echo "==> test phase script"
61   run_tox_test
62   ;;
63 package)
64   echo "==> package phase script"
65   case $MVN_PROJECT_MODULEID in
66   cdap|dcae-policy|docker|relationships|k8s)
67     build_archives_for_wagons
68     build_wagons
69     ;;
70   *)
71     ;;
72   esac
73   ;;
74 install)
75   echo "==> install phase script"
76   ;;
77 deploy)
78   echo "==> deploy phase script"
79   case $MVN_PROJECT_MODULEID in
80   cdap|dcae-policy|docker|relationships|k8s)
81     upload_wagons_and_type_yamls
82     upload_wagon_archives
83     ;;
84   *)
85     ;;
86   esac
87   ;;
88 *)
89   echo "==> unprocessed phase"
90   ;;
91 esac