Adding .gitlab-ci.yml for GitLab
[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 # Source env variables & functions
23 # shellcheck source=./deploy.env
24 source "$CURRENTPATH/deploy.env"
25 # shellcheck source=./functions.sh
26 source "$CURRENTPATH/functions.sh"
27
28 # ---------------------------------------------------------------------
29 # check installation and runtime prerequisites
30 # ---------------------------------------------------------------------
31 check_prerequisites
32
33 # ---------------------------------------------------------------------
34 # bootstrap install prerequisites
35 # ---------------------------------------------------------------------
36 ansible-playbook -i "$CURRENTPATH"/inventory/localhost.ini \
37     "$CURRENTPATH"/playbooks/bootstrap.yaml
38
39 # ---------------------------------------------------------------------
40 # Create jump VM from which the installation is performed
41 # ---------------------------------------------------------------------
42 ansible-playbook -i "$CURRENTPATH"/inventory/localhost.ini \
43     "$CURRENTPATH"/playbooks/jump-vm.yaml
44
45 # ---------------------------------------------------------------------
46 # Create BMRA config based on IDF and PDF
47 # ---------------------------------------------------------------------
48 ansible-playbook -i "$CURRENTPATH"/inventory/localhost.ini \
49     "$CURRENTPATH"/playbooks/bmra-config.yaml
50
51 # ---------------------------------------------------------------------
52 # Copy files needed by Infra engine & BMRA in the jumphost VM
53 # ---------------------------------------------------------------------
54 copy_files_jump
55
56 # ---------------------------------------------------------------------
57 # Provision remote hosts
58 # ---------------------------------------------------------------------
59 provision_hosts
60
61 # ---------------------------------------------------------------------
62 # Setup networking (Adapt according to your network setup)
63 # ---------------------------------------------------------------------
64 setup_network
65
66 # ---------------------------------------------------------------------
67 # Provision k8s cluster (currently BMRA)
68 # ---------------------------------------------------------------------
69 provision_k8s