Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 3 | # ================================================================================ |
Lusheng Ji | a6f91ef | 2018-02-12 11:03:36 -0500 | [diff] [blame] | 4 | # Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 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 | # ECOMP is a trademark and service mark of AT&T Intellectual Property. |
| 20 | |
| 21 | set -ex |
| 22 | |
| 23 | |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 24 | echo "running script: [$0] for module [$1] at stage [$2]" |
| 25 | |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 26 | MVN_PROJECT_MODULEID="$1" |
| 27 | MVN_PHASE="$2" |
Lusheng Ji | 1ee2859 | 2018-03-28 02:39:54 -0400 | [diff] [blame] | 28 | PROJECT_ROOT=$(dirname $0) |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 29 | |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 30 | |
Lusheng Ji | 1ee2859 | 2018-03-28 02:39:54 -0400 | [diff] [blame] | 31 | echo "MVN_RELEASE_TAG is set to [$MVN_RELEASE_TAG]" |
vv770d | d06365a | 2021-03-09 15:55:41 +0000 | [diff] [blame] | 32 | RELEASE_TAG=${MVN_RELEASE_TAG:-R9} |
Lusheng Ji | 1ee2859 | 2018-03-28 02:39:54 -0400 | [diff] [blame] | 33 | if [ "$RELEASE_TAG" != "R1" ]; then |
| 34 | RELEASE_TAGGED_DIR="${RELEASE_TAG}/" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 35 | else |
Lusheng Ji | 1ee2859 | 2018-03-28 02:39:54 -0400 | [diff] [blame] | 36 | RELEASE_TAGGED_DIR="" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 37 | fi |
Michal Jagiello | aa6f2f2 | 2021-01-15 13:04:54 +0000 | [diff] [blame] | 38 | |
vv770d | 9522fea | 2021-02-17 17:44:01 +0000 | [diff] [blame] | 39 | #source "${PROJECT_ROOT}"/mvn-phase-lib.sh |
| 40 | if ! 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 |
| 44 | fi |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 45 | |
| 46 | |
Michal Jagiello | aa6f2f2 | 2021-01-15 13:04:54 +0000 | [diff] [blame] | 47 | source ./mvn-phase-lib.sh |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 48 | |
| 49 | |
| 50 | # Customize the section below for each project |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 51 | case $MVN_PHASE in |
| 52 | clean) |
| 53 | echo "==> clean phase script" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 54 | clean_templated_files |
| 55 | clean_tox_files |
| 56 | rm -rf ./venv-* ./*.wgn |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 57 | ;; |
| 58 | generate-sources) |
| 59 | echo "==> generate-sources phase script" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 60 | expand_templates |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 61 | ;; |
| 62 | compile) |
| 63 | echo "==> compile phase script" |
| 64 | ;; |
| 65 | test) |
| 66 | echo "==> test phase script" |
Lusheng Ji | 1ee2859 | 2018-03-28 02:39:54 -0400 | [diff] [blame] | 67 | run_tox_test |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 68 | ;; |
| 69 | package) |
| 70 | echo "==> package phase script" |
| 71 | ;; |
| 72 | install) |
| 73 | echo "==> install phase script" |
| 74 | ;; |
| 75 | deploy) |
| 76 | echo "==> deploy phase script" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 77 | |
| 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 Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 82 | build_and_push_docker |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 83 | |
| 84 | # upload all yaml file under the root of repo |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 85 | ;; |
| 86 | *) |
| 87 | echo "==> unprocessed phase" |
| 88 | ;; |
| 89 | esac |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 90 | |