blob: 958874403a7565cf45eb1cd435b2e1ee9b76caaf [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
stark, stevenf3519422019-12-05 14:14:32 -080020OOM_BRANCH=$3
21BUILD_DIR=$4
22CHART_VERSION=$5
23OOM_OVERRIDES=$6
stark, stevend5d74c72020-04-21 15:28:13 -070024MASTER_PASSWORD=$7
stark, steven6754bc12019-09-19 15:43:00 -070025
26pushd .
27
28cd $BUILD_DIR
29
30export KUBECONFIG="$KUBECONFIG"
31kubectl get nodes
32
stark, steven6754bc12019-09-19 15:43:00 -070033echo "overriding default storage class for AKS"
34kubectl delete sc default
35sleep 1
stark, steven0e111712020-01-29 17:01:48 -080036cat > "$BUILD_DIR/tmp-sc.yaml" <<EOF
stark, steven6754bc12019-09-19 15:43:00 -070037apiVersion: storage.k8s.io/v1
38kind: StorageClass
39metadata:
40 annotations:
41 storageclass.beta.kubernetes.io/is-default-class: "false"
42 labels:
43 kubernetes.io/cluster-service: "true"
44 name: default
45provisioner: kubernetes.io/no-provisioner
46reclaimPolicy: Delete
47volumeBindingMode: Immediate
48EOF
49
stark, steven0e111712020-01-29 17:01:48 -080050kubectl replace -f "$BUILD_DIR/tmp-sc.yaml" --force
stark, steven6754bc12019-09-19 15:43:00 -070051
52git clone -b "$OOM_BRANCH" http://gerrit.onap.org/r/oom --recurse-submodules
53
54#mv requirements.yaml oom/kubernetes/onap/
55cd oom/kubernetes
56
57ls -l
58
59helmpid=`ps -ef | grep -v grep | grep helm | awk '{print $2}'`
60if [ ! -z $helmpid ]; then
61 kill $helmpid
62fi
63
64helm init
65echo "initializing tiller..."
66sleep 3
67
68helm serve &
69echo "started helm..."
70sleep 3
71
72helm repo add local http://127.0.0.1:8879
73helm repo add stable "https://kubernetes-charts.storage.googleapis.com/"
74
75cp -R helm/plugins/ ~/.helm
76
stark, stevend5d74c72020-04-21 15:28:13 -070077make all -e SKIP_LINT=TRUE
stark, steven6754bc12019-09-19 15:43:00 -070078if [ $? -ne 0 ]; then
79 echo "Failed building helm charts, exiting..."
80 exit 1
81fi
82
stark, stevend5d74c72020-04-21 15:28:13 -070083make onap -e SKIP_LINT=TRUE
stark, steven6754bc12019-09-19 15:43:00 -070084if [ $? -ne 0 ]; then
85 echo "Failed building helm charts, exiting..."
86 exit 1
87fi
88
89TEMPLATE_OVERRIDES="-f onap/resources/overrides/onap-all.yaml -f onap/resources/overrides/openstack.yaml --timeout 900"
90if [ -f "$BUILD_DIR/integration-override.yaml" ]; then
91 TEMPLATE_OVERRIDES="$TEMPLATE_OVERRIDES -f $BUILD_DIR/integration-override.yaml"
92fi
93
94helm repo remove stable
95build_name=`echo "$BUILD_NAME" | tr '[:upper:]' '[:lower:]'`
stark, stevend5d74c72020-04-21 15:28:13 -070096helm deploy "$build_name" local/onap --version v"$CHART_VERSION" --set "global.masterPassword=$MASTER_PASSWORD" "$OOM_OVERRIDES" --namespace onap "$TEMPLATE_OVERRIDES"
stark, steven6754bc12019-09-19 15:43:00 -070097
98kubectl get pods --namespace onap
99
100popd