X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=deploy.sh;h=b2426b30fc52ccd9cb6c488b2ae6298e6017171d;hb=cc9ec23c71f37a75f7f8ccb024aa416f273ef0de;hp=34f13e45c361aadb06394ef121d4a06c094ac2d4;hpb=45d640dd68ffee50a0d469a777b0fdc3546953a9;p=kuberef.git diff --git a/deploy.sh b/deploy.sh index 34f13e4..b2426b3 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,48 +1,73 @@ #!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) -# 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 + +# SPDX-FileCopyrightText: 2021 Ericsson AB and others +# +# SPDX-License-Identifier: Apache-2.0 + set -o errexit set -o nounset +if [ "${DEBUG:-false}" == "true" ]; then + set -o xtrace +fi # Script for end to end RI-2 deployment using Infra engine and BMRA. # Please refer to README for detailed information. # Get path information -DIRECTORY=$(readlink -f "$0") -CURRENTPATH=$(dirname "$DIRECTORY") +CURRENTPATH=$(git rev-parse --show-toplevel) +export CURRENTPATH -# Source env variables & functions -# shellcheck source=./deploy.env -source "$CURRENTPATH/deploy.env" # shellcheck source=./functions.sh source "$CURRENTPATH/functions.sh" +# shellcheck source=./deploy.env +source "$CURRENTPATH/deploy.env" -# Clean up leftovers -clean_up +# --------------------------------------------------------------------- +# check installation and runtime prerequisites +# --------------------------------------------------------------------- +check_prerequisites -# The next two functions require that you know your pxe network configuration -# and IP of resulting jumphost VM in advance. This IP/MAC info also then needs to -# be added in PDF & IDF files (not supported yet via this script) -# Create jumphost VM & setup PXE network -create_jump -setup_PXE_network +# --------------------------------------------------------------------- +# creates a virtual environment for installation of dependencies +# --------------------------------------------------------------------- +creates_virtualenv +# --------------------------------------------------------------------- +# 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 -provision_hosts - # Setup networking (Adapt according to your network setup) -setup_network +# --------------------------------------------------------------------- +if [[ "$DEPLOYMENT" == "full" ]]; then + provision_hosts_baremetal + setup_network +fi +# --------------------------------------------------------------------- # Provision k8s cluster (currently BMRA) -provision_k8s +# --------------------------------------------------------------------- +provision_k8s_baremetal + +# --------------------------------------------------------------------- +# Copy kubeconfig to desired location +# --------------------------------------------------------------------- +copy_k8s_config +