summaryrefslogtreecommitdiffstats
path: root/deploy.sh
blob: 7b230f15c9d20582a43cbff67a028a343d74d119 (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
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) Ericsson AB and others
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

set -o xtrace
set -o errexit
set -o nounset

# Script for end to end RI-2 deployment using Infra engine and BMRA.
# Please refer to README for detailed information.

# Get path information
CURRENTPATH=$(git rev-parse --show-toplevel)
export CURRENTPATH

# shellcheck source=./functions.sh
source "$CURRENTPATH/functions.sh"

# ---------------------------------------------------------------------
# check installation and runtime prerequisites
# ---------------------------------------------------------------------
check_prerequisites

# shellcheck source=./deploy.env
source "$CURRENTPATH/deploy.env"

# ---------------------------------------------------------------------
# bootstrap install prerequisites
# ---------------------------------------------------------------------
run_playbook bootstrap

# ---------------------------------------------------------------------
# Create jump VM from which the installation is performed
# ---------------------------------------------------------------------
run_playbook jump-vm

# ---------------------------------------------------------------------
# Create BMRA config based on IDF and PDF
# ---------------------------------------------------------------------
run_playbook bmra-config

# ---------------------------------------------------------------------
# Copy files needed by Infra engine & BMRA in the jumphost VM
# ---------------------------------------------------------------------
copy_files_jump

# ---------------------------------------------------------------------
# Provision remote hosts
# Setup networking (Adapt according to your network setup)
# ---------------------------------------------------------------------
if [[ "$DEPLOYMENT" == "full" ]]; then
    provision_hosts
    setup_network
fi

# ---------------------------------------------------------------------
# Provision k8s cluster (currently BMRA)
# ---------------------------------------------------------------------
provision_k8s

# ---------------------------------------------------------------------
# Copy kubeconfig to desired location
# ---------------------------------------------------------------------
copy_k8s_config