Apex: Removes calling apex ci scripts for build/test/deploy 61/40861/1
authorTim Rozet <trozet@redhat.com>
Fri, 1 Sep 2017 15:01:27 +0000 (11:01 -0400)
committerTim Rozet <trozet@redhat.com>
Fri, 1 Sep 2017 15:01:27 +0000 (11:01 -0400)
We dont need to use the apex/ci directory anymore and the ci scripts
should be in releng.  A follow up patch will remove the ci/clean script
usage.

Change-Id: Ib2c7bd3d2dfee360bb13b42852ff2010a691a018
Signed-off-by: Tim Rozet <trozet@redhat.com>
jjb/apex/apex-build.sh
jjb/apex/apex-deploy.sh
jjb/apex/apex-unit-test.sh

index 58d9f1a..ad94ba3 100755 (executable)
@@ -28,8 +28,10 @@ fi
 BUILD_DIRECTORY=${WORKSPACE}/build
 
 # start the build
-cd $WORKSPACE/ci
-./build.sh $BUILD_ARGS
+pushd ${BUILD_DIRECTORY}
+make clean
+popd
+python3 apex/build.py $BUILD_ARGS
 RPM_VERSION=$(grep Version: $WORKSPACE/build/rpm_specs/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
 # list the contents of BUILD_OUTPUT directory
 echo "Build Directory is ${BUILD_DIRECTORY}/../.build"
index ce9544b..b3bc141 100755 (executable)
@@ -37,7 +37,7 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
   # Settings for deploying from git workspace
   DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy"
   NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network"
-  DEPLOY_CMD="${WORKSPACE}/ci/deploy.sh"
+  DEPLOY_CMD="opnfv-deploy"
   CLEAN_CMD="${WORKSPACE}/ci/clean.sh"
   RESOURCES="${WORKSPACE}/.build/"
   CONFIG="${WORKSPACE}/build"
@@ -48,6 +48,11 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
   # Ensure artifacts were downloaded and extracted correctly
   # TODO(trozet) add verification here
 
+  # Install dev build
+  mkdir -p ~/tmp
+  mv -f .build ~/tmp/
+  sudo pip3 install --upgrade --force-reinstall .
+  mv -f ~/tmp/.build .
 else
   DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/"
   NETWORK_SETTINGS_DIR="/etc/opnfv-apex/"
@@ -65,7 +70,10 @@ fi
 
 # Install Dependencies
 # Make sure python34 dependencies are installed
-for dep_pkg in epel-release python34 python34-PyYAML python34-setuptools; do
+dependencies="epel-release python34 python34-devel libvirt-devel python34-pip \
+ansible python34-PyYAML python34-jinja2 python34-setuptools python-tox ansible"
+
+for dep_pkg in $dependencies; do
   if ! rpm -q ${dep_pkg} > /dev/null; then
     if ! sudo yum install -y ${dep_pkg}; then
       echo "Failed to install ${dep_pkg}"
@@ -74,31 +82,12 @@ for dep_pkg in epel-release python34 python34-PyYAML python34-setuptools; do
   fi
 done
 
-# Make sure jinja2 is installed
-for python_pkg in jinja2; do
-  if ! python3.4 -c "import $python_pkg"; then
-    echo "$python_pkg package not found for python3.4, attempting to install..."
-    if ! sudo easy_install-3.4 $python_pkg; then
-      echo -e "Failed to install $python_pkg package for python3.4"
-      exit 1
-    fi
-  fi
-done
-
 if [[ "$JOB_NAME" =~ "virtual" ]]; then
   # Make sure ipxe-roms-qemu package is updated to latest.
   # This package is needed for multi virtio nic PXE boot in virtual environment.
   sudo yum update -y ipxe-roms-qemu
-  if [ -z ${PYTHONPATH:-} ]; then
-    export PYTHONPATH=${WORKSPACE}/lib/python
-  else
-    export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
-  fi
 fi
 
-# set env vars to deploy cmd
-DEPLOY_CMD="BASE=${BASE} IMAGES=${IMAGES} LIB=${LIB} ${DEPLOY_CMD}"
-
 if [ "$OPNFV_CLEAN" == 'yes' ]; then
   if sudo test -e '/root/inventory/pod_settings.yaml'; then
     clean_opts='-i /root/inventory/pod_settings.yaml'
@@ -106,7 +95,7 @@ if [ "$OPNFV_CLEAN" == 'yes' ]; then
     clean_opts=''
   fi
 
-  sudo BASE=${BASE} LIB=${LIB} ${CLEAN_CMD} ${clean_opts}
+  sudo ${CLEAN_CMD} ${clean_opts}
 fi
 
 if echo ${DEPLOY_SCENARIO} | grep ipv6; then
index abcddca..3112c9d 100755 (executable)
@@ -8,9 +8,24 @@ echo "--------------------------------------------------------------------------
 echo
 
 
-pushd ci/ > /dev/null
-./test.sh
-popd
+pushd build/ > /dev/null
+for pkg in yamllint rpmlint iproute epel-release python34-devel python34-nose python34-PyYAML python-pep8 python34-mock python34-pip; do
+  if ! rpm -q ${pkg} > /dev/null; then
+    if ! sudo yum install -y ${pkg}; then
+      echo "Failed to install ${pkg} package..."
+      exit 1
+    fi
+  fi
+done
+
+# Make sure coverage is installed
+if ! python3 -c "import coverage" &> /dev/null; then sudo pip3 install coverage; fi
+
+make rpmlint
+make python-pep8-check
+make yamllint
+make python-tests
+popd > /dev/null
 
 echo "--------------------------------------------------------"
 echo "Unit Tests Done!"