Switch to Python Virtual Environment
[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 errexit
12 set -o nounset
13 if [ "${DEBUG:-false}" == "true" ]; then
14     set -o xtrace
15 fi
16
17 # Script for end to end RI-2 deployment using Infra engine and BMRA.
18 # Please refer to README for detailed information.
19
20 # Get path information
21 CURRENTPATH=$(git rev-parse --show-toplevel)
22 export CURRENTPATH
23
24 # shellcheck source=./functions.sh
25 source "$CURRENTPATH/functions.sh"
26
27 # ---------------------------------------------------------------------
28 # check installation and runtime prerequisites
29 # ---------------------------------------------------------------------
30 check_prerequisites
31
32 # shellcheck source=./deploy.env
33 source "$CURRENTPATH/deploy.env"
34
35 # ---------------------------------------------------------------------
36 # creates a virtual environment for installation of dependencies
37 # ---------------------------------------------------------------------
38 creates_virtualenv
39
40 # ---------------------------------------------------------------------
41 # bootstrap install prerequisites
42 # ---------------------------------------------------------------------
43 run_playbook bootstrap
44
45 # ---------------------------------------------------------------------
46 # Create jump VM from which the installation is performed
47 # ---------------------------------------------------------------------
48 run_playbook jump-vm
49
50 # ---------------------------------------------------------------------
51 # Create BMRA config based on IDF and PDF
52 # ---------------------------------------------------------------------
53 run_playbook bmra-config
54
55 # ---------------------------------------------------------------------
56 # Copy files needed by Infra engine & BMRA in the jumphost VM
57 # ---------------------------------------------------------------------
58 copy_files_jump
59
60 # ---------------------------------------------------------------------
61 # Provision remote hosts
62 # Setup networking (Adapt according to your network setup)
63 # ---------------------------------------------------------------------
64 if [[ "$DEPLOYMENT" == "full" ]]; then
65     provision_hosts
66     setup_network
67 fi
68
69 # ---------------------------------------------------------------------
70 # Provision k8s cluster (currently BMRA)
71 # ---------------------------------------------------------------------
72 provision_k8s
73
74 # ---------------------------------------------------------------------
75 # Copy kubeconfig to desired location
76 # ---------------------------------------------------------------------
77 copy_k8s_config
78