Fix tempest and plugins install by default

  * Disable .git folders drop

Change-Id: Iaff058bd0cdd40af77f2582afe794f3c9735c9f8
diff --git a/Dockerfile b/Dockerfile
index 2da265a..e928caa 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,7 +7,7 @@
     LANG=C.UTF-8 \
     LANGUAGE=$LANG \
     LOG_DIR='/root/tempest'
-SHELL ["/bin/bash", "-xec"]
+SHELL ["/bin/bash", "-o", "pipefail", "-xec"]
 USER root
 ADD data /var/lib/
 
diff --git a/extra/pre-build.sh b/extra/pre-build.sh
index 3f5071b..30c122c 100755
--- a/extra/pre-build.sh
+++ b/extra/pre-build.sh
@@ -4,14 +4,18 @@
 
 export GERRIT_NAME=${GERRIT_NAME:-mcp-jenkins}
 # Would delete all .git folders.
-# Keep in mine, you would not able to get any other version or history!
+# Keep in mind, you would not able to get any other version or history!
 # Will ignore 'tempest' itself bz of:
 # ```
 #   Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository.
 #   It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo.
 #   Project name tempest was given, but was not able to be found.
 # ```
-export RELEASE_BUILD=${RELEASE_BUILD:-true}
+# FIXME|TODO Disabled by default.
+# Currently, pip not able to install any package w\o .git directory.
+# Should it be re-writed to tgz install or whatever?
+#export RELEASE_BUILD=${RELEASE_BUILD:-true}
+RELEASE_BUILD=false
 #
 export TEMPEST_TAG="${TEMPEST_TAG:-mcp/queens}"
 export HORIZON_TAG="${HORIZON_TAG:-mcp/queens}"
@@ -38,11 +42,6 @@
     sed -i -e "s|tempest=.*|git+file:///var/lib/tempest@${TEMPEST_TAG}#egg=tempest|g" \
     openstack_requirements/upper-constraints.txt;
   #
-    if [ ! -d tempest ] ; then
-      git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest tempest
-      pushd tempest ; git checkout $TEMPEST_TAG; popd
-    fi
-  #
     if [ ! -d tempest-horizon-plugin ] ; then
       git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin
       pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; popd
@@ -93,9 +92,9 @@
       pushd tungsten-tempest-plugin; git checkout $TUNGSTEN_TAG; popd;
     fi
   #
-    if [ ! -d tungsten-tempest-plugin ] ; then
-      git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest
-      pushd tempest; git checkout $TEMPEST_TAG; popd
+    if [ ! -d tempest ] ; then
+      git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest tempest
+      pushd tempest ; git checkout $TEMPEST_TAG; popd
     fi
   #
     if [[ "$(echo ${RELEASE_BUILD} | tr [:upper:] [:lower:] )" == "true" ]]; then
@@ -106,12 +105,13 @@
   }
 
 function buildme(){
-  echo "=== Installing plugi-reqs"
+  echo "=== Installing plugins"
   plugins="tempest-horizon-plugin barbican-tempest-plugin designate-tempest-plugin heat-tempest-plugin ironic-tempest-plugin"
   plugins="${plugins} manila-tempest-plugin telemetry-tempest-plugin octavia-tempest-plugin patrole-tempest-plugin tungsten-tempest-plugin"
   for plugin in ${plugins}; do
+    echo "=== Installing plugin: ${plugin}"
     pushd /var/lib/${plugin}
-      pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt
+      pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt .
     popd
   done
   echo "=== Installing tempest itself"