summaryrefslogtreecommitdiffstats
path: root/xci/files
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-05-23 08:39:23 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-05-23 08:39:24 +0000
commit7ca9b324879cc2af1bdf57d8bd9bc3b465732d57 (patch)
treed4ee183095f36a5d668aef0c86ba210ab28d52bc /xci/files
parenta06ba78723d03b116b8408f01e3cd88811a81cc1 (diff)
parente42290346c8f4c152e1043c6c39cad1159664151 (diff)
Merge changes from topic 'move-sourcing-files'
* changes: xci: Move the rest of functions to xci-lib.sh xci: file: xci-lib.sh: Avoid sourcing xci-lib.sh twice xci: Move sourcing of configuration files to the install-lib.sh
Diffstat (limited to 'xci/files')
-rw-r--r--xci/files/xci-lib.sh (renamed from xci/files/install-lib.sh)74
1 files changed, 71 insertions, 3 deletions
diff --git a/xci/files/install-lib.sh b/xci/files/xci-lib.sh
index af86be41..7af0f236 100644
--- a/xci/files/install-lib.sh
+++ b/xci/files/xci-lib.sh
@@ -7,9 +7,24 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-# NOTE(hwoarang): Most parts of this this file were taken from the
-# bifrost repository (scripts/install-deps.sh). This script contains all
-# the necessary distro specific code to install ansible and it's dependencies.
+# Avoid double sourcing the file
+[[ -n ${XCI_LIB_SOURCED:-} ]] && return 0 || export XCI_LIB_SOURCED=1
+
+function bootstrap_xci_env() {
+ # Declare our virtualenv
+ export XCI_VENV=${XCI_PATH}/venv/
+
+ # source user vars
+ source $XCI_PATH/xci/config/user-vars
+ # source pinned versions
+ source $XCI_PATH/xci/config/pinned-versions
+ # source flavor configuration
+ source "$XCI_PATH/xci/config/${XCI_FLAVOR}-vars"
+ # source installer configuration
+ source "$XCI_PATH/xci/installer/${INSTALLER_TYPE}/env" &>/dev/null || true
+ # source xci configuration
+ source $XCI_PATH/xci/config/env-vars
+}
function install_ansible() {
set -eu
@@ -200,4 +215,57 @@ collect_xci_logs() {
sudo -H -E bash -c 'chown ${SUDO_UID}:${SUDO_GID} -R ${LOG_PATH}/'
}
+submit_bug_report() {
+ cd ${XCI_PATH}
+ echo ""
+ echo "-------------------------------------------------------------------------"
+ echo "Oh nooooo! The XCI deployment failed miserably :-("
+ echo ""
+ echo "If you need help, please choose one of the following options"
+ echo "* #opnfv-pharos @ freenode network"
+ echo "* opnfv-tech-discuss mailing list (https://lists.opnfv.org/mailman/listinfo/opnfv-tech-discuss)"
+ echo " - Please prefix the subject with [XCI]"
+ echo "* https://jira.opnfv.org (Release Engineering project)"
+ echo ""
+ echo "Do not forget to submit the following information on your bug report:"
+ echo ""
+ git diff --quiet && echo "releng-xci tree status: clean" || echo "releng-xci tree status: local modifications"
+ echo "opnfv/releng-xci version: $(git rev-parse HEAD)"
+ echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION"
+ echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION"
+ echo "xci flavor: $XCI_FLAVOR"
+ echo "xci installer: $INSTALLER_TYPE"
+ echo "xci scenario: $DEPLOY_SCENARIO"
+ echo "Environment variables:"
+ env | grep --color=never '\(OPNFV\|XCI\|INSTALLER_TYPE\|OPENSTACK\|SCENARIO\|ANSIBLE\)'
+ echo "-------------------------------------------------------------------------"
+}
+
+log_xci_information() {
+ local scenario_version scenario_sha
+
+ cd ${XCI_SCENARIOS_CACHE}/${DEPLOY_SCENARIO}
+ scenario_sha=$(git rev-parse HEAD)
+ scenario_version=$(git describe --exact 2>/dev/null || echo "master")
+ cd -
+ echo "Info: Starting XCI Deployment"
+ echo "Info: Deployment parameters"
+ echo "-------------------------------------------------------------------------"
+ echo "OPNFV scenario: $DEPLOY_SCENARIO"
+ echo "Scenario version: ${scenario_version} (sha: ${scenario_sha})"
+ echo "xci flavor: $XCI_FLAVOR"
+ echo "xci installer: $INSTALLER_TYPE"
+ echo "infra deployment: $INFRA_DEPLOYMENT"
+ echo "opnfv/releng-xci version: $(git rev-parse HEAD)"
+ [[ "$INFRA_DEPLOYMENT" == "bifrost" ]] && echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION"
+ [[ "$INSTALLER_TYPE" == "osa" ]] && echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION"
+ [[ "$INSTALLER_TYPE" == "kubespray" ]] && echo "kubespray version: $KUBESPRAY_VERSION"
+ echo "-------------------------------------------------------------------------"
+}
+
+exit_trap() {
+ submit_bug_report
+ collect_xci_logs
+}
+
# vim: set ts=4 sw=4 expandtab: