Fix for staging override deployment
Issue-ID: INT-1217
Change-Id: I35f14f04b6e11b22747c9fb71d11ad4d3c1ddcf9
Signed-off-by: Brian Freeman <bf1936@att.com>
diff --git a/deployment/heat/onap-rke/nfs_vm_entrypoint.sh b/deployment/heat/onap-rke/nfs_vm_entrypoint.sh
index bb0c80a..ed1897a 100644
--- a/deployment/heat/onap-rke/nfs_vm_entrypoint.sh
+++ b/deployment/heat/onap-rke/nfs_vm_entrypoint.sh
@@ -225,7 +225,12 @@
fi
# Deploy ONAP
-helm deploy dev local/onap -f ~/oom/kubernetes/onap/resources/environments/public-cloud.yaml -f ~/integration-override.yaml --namespace $NAMESPACE --verbose
+if [ ! -z "__additional_override__" ]; then
+ helm deploy dev local/onap -f ~/oom/kubernetes/onap/resources/environments/public-cloud.yaml -f ~/integration-override.yaml -f __additional_override__ --namespace $NAMESPACE –verbose
+else
+ helm deploy dev local/onap -f ~/oom/kubernetes/onap/resources/environments/public-cloud.yaml -f ~/integration-override.yaml --namespace $NAMESPACE –verbose
+fi
+
# re-install original helm deploy plugin
rsync -avt ~/oom/kubernetes/helm/plugins ~/.helm/
diff --git a/deployment/heat/onap-rke/onap-oom.yaml b/deployment/heat/onap-rke/onap-oom.yaml
index 7773497..2daf30a 100644
--- a/deployment/heat/onap-rke/onap-oom.yaml
+++ b/deployment/heat/onap-rke/onap-oom.yaml
@@ -233,6 +233,7 @@
template:
get_file: nfs_vm_entrypoint.sh
params:
+ __additional_override__ : { get_param: additional_override}
__nfs_volume_id__: { get_resource: nfs_volume }
__docker_proxy__: { get_param: docker_proxy }
__apt_proxy__: { get_param: apt_proxy }
diff --git a/deployment/heat/onap-rke/scripts/deploy.sh b/deployment/heat/onap-rke/scripts/deploy.sh
index 5bb2f0a..935e694 100755
--- a/deployment/heat/onap-rke/scripts/deploy.sh
+++ b/deployment/heat/onap-rke/scripts/deploy.sh
@@ -25,8 +25,9 @@
usage() {
- echo "Usage: $0 [ -n <number of VMs {2-15}> ][ -s <stack name> ][ -d <domain> ][ -i <integration_branch> ][ -o <oom_branch> ][ -r ][ -q ] <env>" 1>&2;
+ echo "Usage: $0 [-b staging] [ -n <number of VMs {2-15}> ][ -s <stack name> ][ -d <domain> ][ -i <integration_branch> ][ -o <oom_branch> ][ -r ][ -q ] <env>" 1>&2;
+ echo "b: branch for staging image override This must be staging to trigger staging image override." 1>&2;
echo "n: Number of worker VMs to deploy. This number must be between 2 and 15." 1>&2;
echo "s: Stack name. This name will be used for naming of resources." 1>&2;
echo "d: Base domain name to be used in portal UI URLs." 1>&2;
@@ -39,8 +40,15 @@
}
-while getopts ":n:s:d:i:o:rq" o; do
+while getopts ":b:n:s:d:i:o:rq" o; do
case "${o}" in
+ b)
+ if [[ ! ${OPTARG} =~ ^[0-9]+$ ]];then
+ branch=${OPTARG}
+ else
+ branch=master
+ fi
+ ;;
n)
if [[ ${OPTARG} =~ ^[0-9]+$ ]];then
if [ ${OPTARG} -ge 2 -a ${OPTARG} -le 15 ]; then
@@ -147,8 +155,12 @@
./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 integration_gerrit_branch=$integration_gerrit_branch --parameter oom_gerrit_branch=$oom_gerrit_branch --parameter portal_hostname=$portal_hostname; then
- break
+ if [ "$branch" == "staging" ] ; 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 portal_hostname=$portal_hostname --parameter additional_override="~/integration/deployment/heat/onap-rke/staging-image-override.yaml" ; then
+ break
+ else
+ 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 portal_hostname=$portal_hostname; then
+ break
fi
while [ "CREATE_IN_PROGRESS" == "$(openstack stack show -c stack_status -f value $stack_name)" ]; do