aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/rancher/oom_entrypoint.sh
blob: 551f40450bf6ee98efb6b2993605c1fa0c10d060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
#############################################################################
#
# Copyright © 2018 Amdocs.
#
# 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.
#
#############################################################################
#
# This installation is for a rancher managed install of kubernetes
# after this run the standard oom install
# this installation can be run on amy ubuntu 16.04 VM or physical host
# https://wiki.onap.org/display/DW/ONAP+on+Kubernetes
# source from https://jira.onap.org/browse/OOM-715
# Michael O'Brien
#
# Amsterdam
#     Rancher 1.6.10, Kubernetes 1.7.7, Kubectl 1.7.7, Helm 2.3.0, Docker 1.12
# master
#     Rancher 1.6.14, Kubernetes 1.8.10, Kubectl 1.8.10, Helm 2.8.2, Docker 17.03
# run as root - because of the logout that would be required after the docker user set

usage() {
cat <<EOF
Usage: $0 [PARAMs]
-u                  : Display usage
-b [branch]         : branch = master or amsterdam (required)
-s [server]         : server = IP or DNS name (required)
-e [environment]    : use the default (onap)
EOF
}

install_rancher_and_onap() {
  echo "Running rancher install first - 20 min"
  # the curl commands are until OOM-710 is merged
  wget https://jira.onap.org/secure/attachment/11558/oom_rancher_setup.sh
  sudo chmod 777 oom_rancher_setup.sh
  sudo ./oom_rancher_setup.sh -b $BRANCH -s $SERVER -e $ENVIRON
  echo "Running oom install - 45-90 min"
  wget https://jira.onap.org/secure/attachment/11608/cd.sh
  sudo chmod 777 cd.sh
  wget https://jira.onap.org/secure/attachment/11124/aaiapisimpledemoopenecomporg.cer
  if [ "$BRANCH" == "amsterdam" ]; then
    wget https://jira.onap.org/secure/attachment/11218/onap-parameters-amsterdam.yaml
    sudo cp onap-parameters-amsterdam.yaml onap-parameters.yaml
  else
    wget https://jira.onap.org/secure/attachment/11414/values.yaml
  fi
  wget https://jira.onap.org/secure/attachment/11126/aai-cloud-region-put.json
  sudo ./cd.sh -b $BRANCH -e $ENVIRON
}

BRANCH=master
SERVER=
ENVIRON=onap

while getopts ":b:s:e:u:" PARAM; do
  case $PARAM in
    u)
      usage
      exit 1
      ;;
    b)
      BRANCH=${OPTARG}
      ;;
    e)
      ENVIRON=${OPTARG}
      ;;
    s)
      SERVER=${OPTARG}
      ;;
    ?)
      usage
      exit
      ;;
  esac
done

if [[ -z $SERVER ]]; then
  usage
  exit 1
fi

install_rancher_and_onap $BRANCH $SERVER $ENVIRON