update link to upper-constraints.txt
[dcaegen2.git] / mvn-phase-script.sh
1 #!/bin/bash
2
3 # ===========LICENSE_START========================================================
4 # ================================================================================
5 # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=========================================================
19 #
20 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
21
22 set -ex
23
24
25 echo "running script: [$0] for module [$1] at stage [$2]"
26
27 MVN_PROJECT_MODULEID="$1"
28 MVN_PHASE="$2"
29 PROJECT_ROOT=$(dirname $0)
30
31 # expected environment variables
32 if [ -z "${MVN_NEXUSPROXY}" ]; then
33     echo "MVN_NEXUSPROXY environment variable not set.  Cannot proceed"
34     exit 1
35 fi
36 if [ -z "$SETTINGS_FILE" ]; then
37     echo "SETTINGS_FILE environment variable not set.  Cannot proceed"
38     exit 2
39 fi
40
41
42
43
44 source "${PROJECT_ROOT}"/mvn-phase-lib.sh 
45
46
47 # Customize the section below for each project
48 case $MVN_PHASE in
49 clean)
50   echo "==> clean phase script"
51   clean_templated_files
52   clean_tox_files
53   rm -rf ./venv-* ./*.wgn ./site
54   ;;
55 generate-sources)
56   echo "==> generate-sources phase script"
57   expand_templates
58   ;;
59 compile)
60   echo "==> compile phase script"
61   ;;
62 test)
63   echo "==> test phase script"
64   ;;
65 package)
66   echo "==> package phase script"
67   ;;
68 install)
69   echo "==> install phase script"
70   ;;
71 deploy)
72   echo "==> deploy phase script"
73   case $MVN_PROJECT_MODULEID in
74   platformdoc)
75     set -x
76     CURDIR=$(pwd)
77     virtualenv ./venv-doc
78     source ./venv-doc/bin/activate
79     pip install --no-cache-dir --upgrade pip
80     pip install --no-cache-dir --upgrade 'mkdocs==0.16.3' mkdocs-material
81     pip freeze
82
83     mkdocs build
84     build_and_push_docker
85     deactivate
86     rm -rf ./venv-doc
87
88     # build docker image from Docker file (under module dir) and push to registry
89     build_and_push_docker
90     ;;
91   *)
92     echo "====> unknown mvn project module"
93     ;;
94   esac
95   ;;
96 *)
97   echo "==> unprocessed phase"
98   ;;
99 esac
100