Update BMRA to v2.1
[kuberef.git] / deploy.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) Ericsson AB and others
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 set -o xtrace
12 set -o errexit
13 set -o nounset
14
15 # Script for end to end RI-2 deployment using Infra engine and BMRA.
16 # Please refer to README for detailed information.
17
18 # Get path information
19 CURRENTPATH=$(git rev-parse --show-toplevel)
20 export CURRENTPATH
21
22 # shellcheck source=./functions.sh
23 source "$CURRENTPATH/functions.sh"
24
25 # ---------------------------------------------------------------------
26 # check installation and runtime prerequisites
27 # ---------------------------------------------------------------------
28 check_prerequisites
29
30 # shellcheck source=./deploy.env
31 source "$CURRENTPATH/deploy.env"
32
33 # ---------------------------------------------------------------------
34 # bootstrap install prerequisites
35 # ---------------------------------------------------------------------
36 run_playbook bootstrap
37
38 # ---------------------------------------------------------------------
39 # Create jump VM from which the installation is performed
40 # ---------------------------------------------------------------------
41 run_playbook jump-vm
42
43 # ---------------------------------------------------------------------
44 # Create BMRA config based on IDF and PDF
45 # ---------------------------------------------------------------------
46 run_playbook bmra-config
47
48 # ---------------------------------------------------------------------
49 # Copy files needed by Infra engine & BMRA in the jumphost VM
50 # ---------------------------------------------------------------------
51 copy_files_jump
52
53 # ---------------------------------------------------------------------
54 # Provision remote hosts
55 # Setup networking (Adapt according to your network setup)
56 # ---------------------------------------------------------------------
57 if [[ "$DEPLOYMENT" == "full" ]]; then
58     provision_hosts
59     setup_network
60 fi
61
62 # ---------------------------------------------------------------------
63 # Provision k8s cluster (currently BMRA)
64 # ---------------------------------------------------------------------
65 provision_k8s
66
67 # ---------------------------------------------------------------------
68 # Copy kubeconfig to desired location
69 # ---------------------------------------------------------------------
70 copy_k8s_config
71