build_inf_prepare_jenkins: fix for py27 venv and mock_overlay
[pti/rtp.git] / scripts / build_inf.sh
index e8bd658..b5f4846 100755 (executable)
@@ -80,6 +80,7 @@ echo_cmd () {
 #########################################################################
 
 DRYRUN=""
+YP_ARGS="-s"
 
 while getopts "w:b:e:r:unh" OPTION; do
     case ${OPTION} in
@@ -88,6 +89,7 @@ while getopts "w:b:e:r:unh" OPTION; do
             ;;
         n)
             DRYRUN="-n"
+            YP_ARGS=""
             ;;
         h)
             help_info
@@ -108,6 +110,7 @@ WORKSPACE_YP=${WORKSPACE}/workspace_yocto
 WORKSPACE_CENTOS=${WORKSPACE}/workspace_centos
 SCRIPT_YP=${SCRIPTS_DIR}/build_inf_yocto/build_inf_yocto.sh
 SCRIPT_CENTOS=${SCRIPTS_DIR}/build_inf_centos/build_inf_centos.sh
+SCRIPT_CENTOS_PRE=${SCRIPTS_DIR}/build_inf_centos/build_inf_prepare_jenkins.sh
 
 prepare_workspace () {
     msg_step="Create workspace for the multi-os builds"
@@ -122,16 +125,46 @@ prepare_workspace () {
     echo_step_end
 }
 
+# debug for CI Jenkins build
+get_debug_info () {
+    msg_step="Get debug info for CI Jenkins build"
+    echo_step_start
+
+    echo_info "=== Get env ==="
+    env
+    echo_info "==============="
+
+    set -x
+    df -h
+    groups
+    uname -a
+    cat /etc/*release
+    lscpu
+    free -h
+    rpm -qa|grep mock
+    mock --debug-config
+    docker version
+    set +x
+
+    echo_step_end
+}
+
 
 #########################################################################
 # Main process
 #########################################################################
 
 prepare_workspace
-
-${SCRIPT_CENTOS} -w ${WORKSPACE_CENTOS} ${DRYRUN}
+if [ "$CI" = "true" ]; then
+    get_debug_info
+fi
 
 # dry-run is not supported yet for CentOS build
 if [ -z "${DRYRUN}" ]; then
-    ${SCRIPT_YP} -w ${WORKSPACE_YP} ${DRYRUN}
+    if [ "$CI" = "true" ]; then
+        ${SCRIPT_CENTOS_PRE} -w ${WORKSPACE_CENTOS} || true
+    fi
+    ${SCRIPT_CENTOS} -w ${WORKSPACE_CENTOS} ${DRYRUN} || true
 fi
+
+${SCRIPT_YP} -w ${WORKSPACE_YP} ${DRYRUN} ${YP_ARGS}