diff options
author | stark, steven <steven.stark@att.com> | 2019-12-05 14:14:32 -0800 |
---|---|---|
committer | Brian Freeman <bf1936@att.com> | 2019-12-09 13:19:36 +0000 |
commit | f3519424a5c99b59e2b508dae510cdac27cc6dc5 (patch) | |
tree | 245c1f3fce046cd87751902853e8e45c85bfeb4d /deployment/aks/cloud.sh | |
parent | 48a45d1acc24778b9ba2620714815b6a0c034379 (diff) |
[INT] various updates to AKS deployment scripts
- Adding support for pluggable post-install scripts. See README.
- Adding pre_install check to validate the correct software is installed before attempting deployment.
- Updating AKS deploy command line to support azure cli 2.0.75.
Issue-ID: INT-1398
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: I1ff819e96a3f34c88580e90e8d6f2b79979a7a61
Diffstat (limited to 'deployment/aks/cloud.sh')
-rwxr-xr-x | deployment/aks/cloud.sh | 88 |
1 files changed, 59 insertions, 29 deletions
diff --git a/deployment/aks/cloud.sh b/deployment/aks/cloud.sh index ac471a91b..555ba12cc 100755 --- a/deployment/aks/cloud.sh +++ b/deployment/aks/cloud.sh @@ -17,6 +17,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" NO_PROMPT=0 NO_INSTALL=0 +NO_VALIDATE=0 +POST_INSTALL=0 OVERRIDE=0 OPENSTACK_CLI_POD="os-cli-0" @@ -38,6 +40,8 @@ while test $# -gt 0; do echo "-f, --no-prompt executes with no prompt for confirmation" echo "-n, --no-install don't install ONAP" echo "-o, --override create integration override for robot configuration" + echo "-d, --no-validate dont validate pre-reqs before executing deployment" + echo "-p, --post-install execute post-install scripts" echo "-h, --help provide brief overview of script" echo " " echo "This script deploys a cloud environment in Azure." @@ -62,6 +66,14 @@ while test $# -gt 0; do shift OVERRIDE=1 ;; + -d|--no-validate) + shift + NO_VALIDATE=1 + ;; + -p|--post-install) + shift + POST_INSTALL=1 + ;; *) echo "Unknown Argument. Try running with --help ." exit 0 @@ -69,6 +81,13 @@ while test $# -gt 0; do esac done +if [ $NO_VALIDATE = 0 ]; then + $DIR/pre_install.sh "$AKS_K8_VERSION" "$LOCATION" + if [ $? -ne 0 ]; then + exit 1 + fi +fi + cat <<EOF Here are the parameters to be used in this build: @@ -317,6 +336,7 @@ $DIR/util/create_openstack_cli.sh "$BUILD_DIR/kubeconfig" \ "$BUILD_DIR/openstack_rc" \ "$OPENSTACK_CLI_POD" + if [ $OVERRIDE = 1 ]; then $DIR/util/create_integration_override.sh "$BUILD_DIR" \ @@ -329,48 +349,21 @@ $DIR/util/create_integration_override.sh "$BUILD_DIR" \ fi + if [ $NO_INSTALL = 0 ]; then ### Starting OOM install ### echo "Installing ONAP..." $DIR/create_onap.sh "$BUILD" \ "$BUILD_DIR/kubeconfig" \ - "$NFS_PRIVATE_IP" \ "$OOM_BRANCH" \ "$BUILD_DIR" \ "$CHART_VERSION" \ "$OOM_OVERRIDES" -### Starting OOM install ### -echo "Configuring ONAP..." - -cat > "$BUILD_DIR/onap.conf" <<EOF -export CLLI=$CLLI -export CLOUD_OWNER=$CLOUD_OWNER -export CLOUD_REGION=$CLOUD_REGION -export OPENSTACK_IP=$DEVSTACK_PRIVATE_IP -export OPENSTACK_USER=$OPENSTACK_USER -export OPENSTACK_PASS=$OPENSTACK_PASS -export OPENSTACK_TENANT=$OPENSTACK_TENANT -export OPENSTACK_REGION=$OPENSTACK_REGION -export CUSTOMER=$CUSTOMER -export SUBSCRIBER=$SUBSCRIBER -export SERVICE_TYPE=$SERVICE_TYPE -export AZ=$AZ -export OE=$OE -export LOB=$LOB -export PLATFORM=$PLATFORM -export PROJECT=$PROJECT -export OS_ID=$OS_ID -export OS_TENANT_ROLE=$OS_TENANT_ROLE -export OS_KEYSTONE=$OS_KEYSTONE -export KUBECONFIG=$BUILD_DIR/kubeconfig -EOF - -$DIR/bootstrap_onap.sh "$BUILD_DIR/onap.conf" - fi + set +x cat > "$BUILD_DIR/deployment.notes" <<EOF @@ -422,3 +415,40 @@ $AKS_PUBLIC_IP_ADDRESS policy.api.simpledemo.onap.org EOF cat "$BUILD_DIR/deployment.notes" + + +if [ $POST_INSTALL = 1 ]; then + +echo "Executing post installation scripts..." +sleep 3 + +cat > "$BUILD_DIR/onap.conf" <<EOF +export CLLI=$CLLI +export CLOUD_OWNER=$CLOUD_OWNER +export CLOUD_REGION=$CLOUD_REGION +export OPENSTACK_IP=$DEVSTACK_PRIVATE_IP +export OPENSTACK_USER=$OPENSTACK_USER +export OPENSTACK_PASS=$OPENSTACK_PASS +export OPENSTACK_TENANT=$OPENSTACK_TENANT +export OPENSTACK_REGION=$OPENSTACK_REGION +export CUSTOMER=$CUSTOMER +export SUBSCRIBER=$SUBSCRIBER +export SERVICE_TYPE=$SERVICE_TYPE +export AZ=$AZ +export OE=$OE +export LOB=$LOB +export PLATFORM=$PLATFORM +export PROJECT=$PROJECT +export OS_ID=$OS_ID +export OS_TENANT_ROLE=$OS_TENANT_ROLE +export OS_KEYSTONE=$OS_KEYSTONE +export KUBECONFIG=$BUILD_DIR/kubeconfig +export NFS_PRIVATE_IP=$NFS_PRIVATE_IP +export DEVSTACK_PRIVATE_IP=$DEVSTACK_PRIVATE_IP +export PRIVATE_KEY=$PRIVATE_KEY +EOF + +$DIR/post_install.sh "$BUILD_DIR/onap.conf" "$DIR/cloud.conf" + +fi + |