X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-infra%2F00-Kubernetes%2Fbin%2Fdeploy-stack.sh;fp=ric-infra%2F00-Kubernetes%2Fbin%2Fdeploy-stack.sh;h=fd350b6632bc50373ce1d981467c0ef30ea2cdb5;hb=ea83d035d863452d738abca47b966defb9a35456;hp=0000000000000000000000000000000000000000;hpb=7f1e409379856025977fc8a6ea04ddb215f21a13;p=it%2Fdep.git diff --git a/ric-infra/00-Kubernetes/bin/deploy-stack.sh b/ric-infra/00-Kubernetes/bin/deploy-stack.sh new file mode 100755 index 00000000..fd350b66 --- /dev/null +++ b/ric-infra/00-Kubernetes/bin/deploy-stack.sh @@ -0,0 +1,315 @@ +#!/bin/bash +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +set -e + +stack_name="ric" +full_deletion=false + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +set -a +RCS="$(find $DIR/../etc -type f -maxdepth 1)" +for RC in $RCS; do + echo "reading in values in $RC" + source $RC +done +set +a + + +if [ -z "$__RUNRICENV_GERRIT_HOST__" ]; then + export __RUNRICENV_GERRIT_HOST__=$gerrithost +fi +if [ -z "$__RUNRICENV_GERRIT_IP__" ]; then + export __RUNRICENV_GERRIT_IP__=$gerritip +fi +if [ -z "$__RUNRICENV_DOCKER_HOST__" ]; then + export __RUNRICENV_DOCKER_HOST__=$dockerregistry +fi +if [ -z "$__RUNRICENV_DOCKER_IP__" ]; then + export __RUNRICENV_DOCKER_IP__=$dockerip +fi +if [ -z "$__RUNRICENV_DOCKER_PORT__" ]; then + export __RUNRICENV_DOCKER_PORT__=$dockerport +fi +if [ -z "$__RUNRICENV_DOCKER_USER__" ]; then + export __RUNRICENV_DOCKER_USER__=$dockeruser +fi +if [ -z "$__RUNRICENV_DOCKER_PASS__" ]; then + export __RUNRICENV_DOCKER_PASS__=$dockerpassword +fi +if [ -z "$__RUNRICENV_DOCKER_CERT__" ]; then + export __RUNRICENV_DOCKER_CERT__=$dockercert +fi +if [ -z "$__RUNRICENV_HELMREPO_HOST__" ]; then + export __RUNRICENV_HELMREPO_HOST__=$helmrepo +fi +if [ -z "$__RUNRICENV_HELMREPO_PORT__" ]; then + export __RUNRICENV_HELMREPO_PORT__=$helmport +fi +if [ -z "$__RUNRICENV_HELMREPO_IP__" ]; then + export __RUNRICENV_HELMREPO_IP__=$helmip +fi +if [ -z "$__RUNRICENV_HELMREPO_USER__" ]; then + export __RUNRICENV_HELMREPO_USER__=$helmuser +fi +if [ -z "$__RUNRICENV_HELMREPO_PASS__" ]; then + export __RUNRICENV_HELMREPO_PASS__=$helmpassword +fi +if [ -z "$__RUNRICENV_HELMREPO_CERT__" ]; then + export __RUNRICENV_HELMREPO_CERT__=$helmcert +fi + + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi +HEAT_DIR="$WORKSPACE/ric-infra/00-Kubernetes/heat" +BIN_DIR="$WORKSPACE/ric-infra/00-Kubernetes/bin" +ETC_DIR="$WORKSPACE/ric-infra/00-Kubernetes/etc" +ENV_DIR="$WORKSPACE/ric-infra/00-Kubernetes/heat/env" + + +cd $BIN_DIR + + +openstack --version > /dev/null +if [ $? -eq 0 ]; then + echo "OK openstack CLI installed" +else + echo "Must run in an envirnment with openstack cli" + exit 1 +fi + +if [ -z "$OS_USERNAME" ]; then + echo "Must source the Openstack RC file for the target installation tenant" + exit 1 +fi + + +usage() { + echo "Usage: $0 [ -n ][ -s ]