summaryrefslogtreecommitdiffstats
path: root/xci/files
diff options
context:
space:
mode:
Diffstat (limited to 'xci/files')
-rwxr-xr-xxci/files/xci-destroy-env.sh2
-rw-r--r--xci/files/xci-lib.sh (renamed from xci/files/install-lib.sh)74
2 files changed, 73 insertions, 3 deletions
diff --git a/xci/files/xci-destroy-env.sh b/xci/files/xci-destroy-env.sh
index 97b76c7c..3de21795 100755
--- a/xci/files/xci-destroy-env.sh
+++ b/xci/files/xci-destroy-env.sh
@@ -21,6 +21,8 @@ rm -rf /opt/stack
# HOME is normally set by sudo -H
rm -rf ${HOME}/.config/openstack
rm -rf ${HOME}/.ansible
+# Wipe repos
+rm -rf ${XCI_CACHE}/repos
# bifrost installs everything on venv so we need to look there if virtualbmc is not installed on the host.
if which vbmc &>/dev/null || { [[ -e ${XCI_VENV}/bifrost/bin/activate ]] && source ${XCI_VENV}/bifrost/bin/activate; }; then
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: