Change gitlab deploy pod tag to be unh-ri2-pod1
[kuberef.git] / deploy.sh
1 #!/bin/bash
2
3 # SPDX-FileCopyrightText: 2021 Ericsson AB and others
4 #
5 # SPDX-License-Identifier: Apache-2.0
6
7 set -o errexit
8 set -o nounset
9 if [ "${DEBUG:-false}" == "true" ]; then
10     set -o xtrace
11 fi
12
13 # Script for end to end RI-2 deployment using Infra engine and BMRA.
14 # Please refer to README for detailed information.
15
16 # Get path information
17 CURRENTPATH=$(git rev-parse --show-toplevel)
18 export CURRENTPATH
19
20 # shellcheck source=./functions.sh
21 source "$CURRENTPATH/functions.sh"
22 # shellcheck source=./deploy.env
23 source "$CURRENTPATH/deploy.env"
24
25 # ---------------------------------------------------------------------
26 # check installation and runtime prerequisites
27 # ---------------------------------------------------------------------
28 check_prerequisites
29
30 # ---------------------------------------------------------------------
31 # creates a virtual environment for installation of dependencies
32 # ---------------------------------------------------------------------
33 creates_virtualenv
34
35 # ---------------------------------------------------------------------
36 # bootstrap install prerequisites
37 # ---------------------------------------------------------------------
38 run_playbook bootstrap
39
40 # ---------------------------------------------------------------------
41 # Create jump VM from which the installation is performed
42 # ---------------------------------------------------------------------
43 run_playbook jump-vm
44
45 # ---------------------------------------------------------------------
46 # Create BMRA config based on IDF and PDF
47 # ---------------------------------------------------------------------
48 run_playbook bmra-config
49
50 # ---------------------------------------------------------------------
51 # Copy files needed by Infra engine & BMRA in the jumphost VM
52 # ---------------------------------------------------------------------
53 copy_files_jump
54
55 # ---------------------------------------------------------------------
56 # Provision remote hosts
57 # Setup networking (Adapt according to your network setup)
58 # ---------------------------------------------------------------------
59 if [[ "$DEPLOYMENT" == "full" ]]; then
60     provision_hosts_baremetal
61     setup_network
62 fi
63
64 # ---------------------------------------------------------------------
65 # Provision k8s cluster (currently BMRA)
66 # ---------------------------------------------------------------------
67 provision_k8s_baremetal
68
69 # ---------------------------------------------------------------------
70 # Copy kubeconfig to desired location
71 # ---------------------------------------------------------------------
72 copy_k8s_config
73