Merge "Fix shellcheck for scripts directory"
authorAnil Belur <abelur@linuxfoundation.org>
Mon, 6 Mar 2017 05:24:29 +0000 (05:24 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 6 Mar 2017 05:24:29 +0000 (05:24 +0000)
jjb/autorelease/include-raw-autorelease-release-versions.sh
jjb/include-raw-deploy-archives.sh
jjb/integration/include-raw-integration-deploy-openstack-run-test.sh

index 1ad25e4b51ddb1d58c984b1c8cca16f43704c25f..94880a56dfdd68bed559872ce6681e2f0f817401 100644 (file)
 # RELEASE_TAG=Beryllium-SR1  # Example
 # RELEASE_BRANCH=stable/beryllium  # Example
 
+LFTOOLS_DIR="$WORKSPACE/.venv-lftools"
+if [ ! -d "$LFTOOLS_DIR" ]
+then
+    virtualenv $LFTOOLS_DIR
+    source $LFTOOLS_DIR/bin/activate
+    pip install --upgrade pip
+    pip freeze
+    pip install lftools
+fi
+source "$LFTOOLS_DIR/bin/activate"
+
 # Directory to put git format-patches
 PATCH_DIR=`pwd`/patches
 
 echo $RELEASE_TAG
-./scripts/version.sh release $RELEASE_TAG
+lftools version release $RELEASE_TAG
 git submodule foreach "git commit -am \"Release $RELEASE_TAG\" || true"
 git commit -am "Release $RELEASE_TAG"
 
@@ -35,4 +46,3 @@ tar cvzf all-bundles.tar.gz `find $PATCH_DIR -type f -print0 \
                                 | egrep -e ':.*Git bundle.*' \
                                 | cut -d: -f1`
 rm $PATCH_DIR/*.bundle
-
index 53d2991a54f02308ff1581b09ba1af72cde8722c..c6a6328b4b28afcfc55f7f6f7ec5092b453e989c 100644 (file)
@@ -70,16 +70,17 @@ cat > deploy-archives.xml <<EOF
 </project>
 EOF
 
-mkdir -p $ARCHIVES_DIR
-mkdir -p $WORKSPACE/archives
-if [ ! -z "${{ARCHIVE_ARTIFACTS}}" ]; then
-    pushd $WORKSPACE
+mkdir -p "$ARCHIVES_DIR"
+mkdir -p "$WORKSPACE/archives"
+if [ ! -z "$ARCHIVE_ARTIFACTS" ]; then
+    pushd "$WORKSPACE"
     shopt -s globstar  # Enable globstar to copy archives
-    archive_artifacts=$(echo ${{ARCHIVE_ARTIFACTS}})
-    for f in $archive_artifacts; do
+    for f in $ARCHIVE_ARTIFACTS; do
+        [[ -e $f ]] || continue  # handle the case of no files to archive
         echo "Archiving $f"
-        mkdir -p $WORKSPACE/archives/$(dirname $f)
-        mv $f $WORKSPACE/archives/$f
+        dir=$(dirname "$f")
+        mkdir -p "$WORKSPACE/archives/$dir"
+        mv "$f" "$WORKSPACE/archives/$f"
     done
     shopt -u globstar  # Disable globstar once archives are copied
     popd
index 27b548ead83db84364cfe60ab33c39f8ffa01e74..28aa092afd02dd8ad259957f99b1be8379400d40 100644 (file)
@@ -383,7 +383,7 @@ do
     scp "${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar" "${WORKSPACE}/odl${i}_karaf.log.tar"
     tar -xvf ${WORKSPACE}/odl${i}_karaf.log.tar -C . --strip-components 2 --transform s/karaf/odl${i}_karaf/g
     grep "ROBOT MESSAGE\| ERROR " odl${i}_karaf.log > odl${i}_err.log
-    grep "ROBOT MESSAGE\| Exception " odl${i}_karaf.log > odl${i}_exception.log
+    grep "ROBOT MESSAGE\|Exception" odl${i}_karaf.log > odl${i}_exception.log
     grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" odl${i}_karaf.log > odl${i}_err_warn_exception.log
     rm ${WORKSPACE}/odl${i}_karaf.log.tar
 done
@@ -477,6 +477,15 @@ ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "bash /tmp/get_devstack.sh"
 create_control_node_local_conf
 scp ${WORKSPACE}/local.conf_control ${OPENSTACK_CONTROL_NODE_IP}:/opt/stack/devstack/local.conf
 
+cat > "${WORKSPACE}/manual_install_package.sh" << EOF
+cd /opt/stack
+git clone "\$1"
+cd "\$2"
+git checkout "\$3"
+sudo python setup.py install
+
+EOF
+
 
 # Workworund for successful stacking with  Mitaka
 if [ "${ODL_ML2_BRANCH}" == "stable/mitaka" ]; then
@@ -488,9 +497,11 @@ if [ "${ODL_ML2_BRANCH}" == "stable/mitaka" ]; then
   # the problem has been solved with  version 1.17. If the latest version of paramiko is used, it causes
   # other timeout problems
   ssh ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack; git clone https://git.openstack.org/openstack/requirements; cd requirements; git checkout stable/mitaka; sed -i /openstacksdk/d upper-constraints.txt; sed -i /libvirt-python/d upper-constraints.txt; sed -i /paramiko/d upper-constraints.txt"
+  scp "${WORKSPACE}/manual_install_package.sh"  "${OPENSTACK_CONTROL_NODE_IP}:/tmp"
   ssh ${OPENSTACK_CONTROL_NODE_IP} "sudo pip install deprecation"
-  ssh ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack; git clone https://github.com/openstack/python-openstacksdk; cd python-openstacksdk; sudo python setup.py install"
-  ssh ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack; git clone https://github.com/paramiko/paramiko; cd paramiko; git checkout 1.17; sudo python setup.py install"
+  # Fix for recent requirements update  in the  master branch of the sdk.The section must be replaced with a better fix.
+  ssh "${OPENSTACK_CONTROL_NODE_IP}" "sh /tmp/manual_install_package.sh https://github.com/openstack/python-openstacksdk python-openstacksdk 0.9.14"
+  ssh "${OPENSTACK_CONTROL_NODE_IP}" "sh /tmp/manual_install_package.sh https://github.com/paramiko/paramiko paramiko 1.17"
 fi
 
 ssh ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"