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 | # ================================================================================ |
vv770d | 5116f87 | 2022-04-25 21:14:50 +0000 | [diff] [blame] | 4 | # Copyright (c) 2017-2022 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 | |
vv770d | 5116f87 | 2022-04-25 21:14:50 +0000 | [diff] [blame] | 30 | source "${PROJECT_ROOT}"/mvn-phase-lib.sh |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 31 | |
| 32 | # Customize the section below for each project |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 33 | case $MVN_PHASE in |
| 34 | clean) |
| 35 | echo "==> clean phase script" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 36 | clean_templated_files |
| 37 | clean_tox_files |
| 38 | rm -rf ./venv-* ./*.wgn |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 39 | ;; |
| 40 | generate-sources) |
| 41 | echo "==> generate-sources phase script" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 42 | expand_templates |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 43 | ;; |
| 44 | compile) |
| 45 | echo "==> compile phase script" |
| 46 | ;; |
| 47 | test) |
| 48 | echo "==> test phase script" |
Lusheng Ji | 1ee2859 | 2018-03-28 02:39:54 -0400 | [diff] [blame] | 49 | run_tox_test |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 50 | ;; |
| 51 | package) |
| 52 | echo "==> package phase script" |
| 53 | ;; |
| 54 | install) |
| 55 | echo "==> install phase script" |
| 56 | ;; |
| 57 | deploy) |
| 58 | echo "==> deploy phase script" |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 59 | |
| 60 | # below segments are example of how to deploy various artifacts |
| 61 | # copy the ones suitable for your repo, and remove the "if false" statement |
| 62 | |
| 63 | # 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] | 64 | build_and_push_docker |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 65 | |
| 66 | # upload all yaml file under the root of repo |
Ladue, David (dl3158) | 6429231 | 2017-08-23 11:27:58 -0400 | [diff] [blame] | 67 | ;; |
| 68 | *) |
| 69 | echo "==> unprocessed phase" |
| 70 | ;; |
| 71 | esac |
Lusheng Ji | 7bb2260 | 2017-09-11 22:52:13 +0000 | [diff] [blame] | 72 | |