aboutsummaryrefslogtreecommitdiffstats
path: root/deployment
diff options
context:
space:
mode:
authorGary Wu <gary.wu@futurewei.com>2019-06-27 07:19:36 -0700
committerGary Wu <gary.wu@futurewei.com>2019-06-27 07:30:31 -0700
commit17314cd2c1e0ae88cc460d96e3731a72dd3a37d9 (patch)
tree42230b9d06670df66573039315f7d97d355efabe /deployment
parent5ee1c3899f07e6eb22f73ed39588ea73c4599038 (diff)
Add integration and oom branch params in deploy.sh
Issue-ID: INT-1117 Signed-off-by: Gary Wu <gary.wu@futurewei.com> Change-Id: I47d33ffeeb739a6f6fe3b768ccfd147add1de254
Diffstat (limited to 'deployment')
-rwxr-xr-xdeployment/heat/onap-rke/scripts/deploy.sh29
1 files changed, 22 insertions, 7 deletions
diff --git a/deployment/heat/onap-rke/scripts/deploy.sh b/deployment/heat/onap-rke/scripts/deploy.sh
index d26916e87..30997706d 100755
--- a/deployment/heat/onap-rke/scripts/deploy.sh
+++ b/deployment/heat/onap-rke/scripts/deploy.sh
@@ -13,17 +13,26 @@ stack_name="onap"
portal_hostname="portal.api.simpledemo.onap.org"
full_deletion=false
+# default branch for cloning integration repo
+integration_gerrit_branch=$(git rev-parse --abbrev-ref HEAD)
+# default branch for cloning oom repo
+# by default, assume oom branch is the same as integration branch
+oom_gerrit_branch=$(git rev-parse --abbrev-ref HEAD)
+
if [ -z "$WORKSPACE" ]; then
- export WORKSPACE=`git rev-parse --show-toplevel`
+ export WORKSPACE=$(git rev-parse --show-toplevel)
fi
+
usage() {
- echo "Usage: $0 [ -n <number of VMs {2-15}> ][ -s <stack name> ][ -m <manifest> ][ -d <domain> ][ -r ][ -q ] <env>" 1>&2;
+ echo "Usage: $0 [ -n <number of VMs {2-15}> ][ -s <stack name> ][ -m <manifest> ][ -d <domain> ][ -i <integration_branch> ][ -o <oom_branch> ][ -r ][ -q ] <env>" 1>&2;
echo "n: Set the number of VM's that will be installed. This number must be between 2 and 15" 1>&2;
echo "s: Set the name to be used for stack. This name will be used for naming of resources" 1>&2;
echo "d: Set the base domain name to be used in portal UI URLs" 1>&2;
- echo "m: The docker manifest to apply; must be either \"docker-manifest-staging.csv\" or \"docker-manifest.csv\"." 1>&2;
+ echo "m: The docker manifest to apply; can only \"docker-manifest-staging.csv\"." 1>&2;
+ echo "i: Set the branch of integration repo to clone." 1>&2;
+ echo "o: Set the branch of oom repo to clone." 1>&2;
echo "r: Delete all resources relating to ONAP within enviroment." 1>&2;
echo "q: Quiet Delete of all ONAP resources." 1>&2;
@@ -31,7 +40,7 @@ usage() {
}
-while getopts ":n:s:d:m:rq" o; do
+while getopts ":n:s:d:m:i:o:rq" o; do
case "${o}" in
n)
if [[ ${OPTARG} =~ ^[0-9]+$ ]];then
@@ -65,6 +74,12 @@ while getopts ":n:s:d:m:rq" o; do
usage
fi
;;
+ i)
+ integration_gerrit_branch=${OPTARG}
+ ;;
+ o)
+ oom_gerrit_branch=${OPTARG}
+ ;;
r)
echo "The following command will delete all information relating to onap within your enviroment"
read -p "Are you certain this is what you want? (type y to confirm):" answer
@@ -109,9 +124,9 @@ set -x
SSH_KEY=~/.ssh/onap_key
-if ! hash openstack jq
+if ! hash openstack jq java
then
- echo "ERROR: Required commands not found; please install openstack CLI and jq."
+ echo "ERROR: Required commands not found; please install openstack CLI, jq, java."
exit 2
fi
@@ -140,7 +155,7 @@ for n in $(seq 1 5); do
./scripts/gen-onap-oom-yaml.sh $vm_num > onap-oom.yaml~
fi
- if ! openstack stack create -t ./onap-oom.yaml~ -e $ENV_FILE~ $stack_name --parameter docker_manifest=$docker_manifest --parameter portal_hostname=$portal_hostname; then
+ if ! openstack stack create -t ./onap-oom.yaml~ -e $ENV_FILE~ $stack_name --parameter integration_gerrit_branch=$integration_gerrit_branch --parameter oom_gerrit_branch=$oom_gerrit_branch --parameter docker_manifest=$docker_manifest --parameter portal_hostname=$portal_hostname; then
break
fi