blob: 4abddd64f42dc327e25603a7517726538607583d [file] [log] [blame]
stark, steven6754bc12019-09-19 15:43:00 -07001#!/bin/bash
2# Copyright 2019 AT&T Intellectual Property. All rights reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16set -x
17
18BUILD_NAME=$1
19KUBECONFIG=$2
20NFS_SERVER_IP=$3
21OOM_BRANCH=$4
22BUILD_DIR=$5
23CHART_VERSION=$6
24OOM_OVERRIDES=$7
25
26pushd .
27
28cd $BUILD_DIR
29
30export KUBECONFIG="$KUBECONFIG"
31kubectl get nodes
32
33COUNTER=0
34until [ $COUNTER -ge 10 ]; do
35
36echo "overriding default storage class for AKS"
37kubectl delete sc default
38sleep 1
39cat <<EOF | kubectl apply -f -
40apiVersion: storage.k8s.io/v1
41kind: StorageClass
42metadata:
43 annotations:
44 storageclass.beta.kubernetes.io/is-default-class: "false"
45 labels:
46 kubernetes.io/cluster-service: "true"
47 name: default
48provisioner: kubernetes.io/no-provisioner
49reclaimPolicy: Delete
50volumeBindingMode: Immediate
51EOF
52
53if [ $? -eq 0 ]; then
54 COUNTER=10
55else
56 COUNTER=$((COUNTER +1))
57fi
58
59sleep 5
60done
61
62git clone -b "$OOM_BRANCH" http://gerrit.onap.org/r/oom --recurse-submodules
63
64#mv requirements.yaml oom/kubernetes/onap/
65cd oom/kubernetes
66
67ls -l
68
69helmpid=`ps -ef | grep -v grep | grep helm | awk '{print $2}'`
70if [ ! -z $helmpid ]; then
71 kill $helmpid
72fi
73
74helm init
75echo "initializing tiller..."
76sleep 3
77
78helm serve &
79echo "started helm..."
80sleep 3
81
82helm repo add local http://127.0.0.1:8879
83helm repo add stable "https://kubernetes-charts.storage.googleapis.com/"
84
85cp -R helm/plugins/ ~/.helm
86
87make all
88if [ $? -ne 0 ]; then
89 echo "Failed building helm charts, exiting..."
90 exit 1
91fi
92
93make onap
94if [ $? -ne 0 ]; then
95 echo "Failed building helm charts, exiting..."
96 exit 1
97fi
98
99TEMPLATE_OVERRIDES="-f onap/resources/overrides/onap-all.yaml -f onap/resources/overrides/openstack.yaml --timeout 900"
100if [ -f "$BUILD_DIR/integration-override.yaml" ]; then
101 TEMPLATE_OVERRIDES="$TEMPLATE_OVERRIDES -f $BUILD_DIR/integration-override.yaml"
102fi
103
104helm repo remove stable
105build_name=`echo "$BUILD_NAME" | tr '[:upper:]' '[:lower:]'`
106helm deploy "$build_name" local/onap --version v"$CHART_VERSION" "$OOM_OVERRIDES" --namespace onap "$TEMPLATE_OVERRIDES"
107
108kubectl get pods --namespace onap
109
110popd