<NME> ossim-install.sh
<BEF> ADDFILE
<MSG> Fixed multibranch setup od jenkinsfile and added scripts

<DFF> @@ -0,0 +1,127 @@
+#!/bin/bash
+ZIP_OPTION=$1
+pushd `dirname ${BASH_SOURCE[0]}` >/dev/null
+OSSIMCI_SCRIPT_DIR=`pwd -P`
+pushd $OSSIMCI_SCRIPT_DIR/../../.. >/dev/null
+export OSSIM_DEV_HOME=$PWD
+popd > /dev/null
+popd >/dev/null
+
+source $OSSIMCI_SCRIPT_DIR/ossim-env.sh
+
+# Establish CMAKE's install directory:
+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
+    export OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install
+fi
+
+echo "STATUS: Checking presence of env var OSSIM_BUILD_DIR = <$OSSIM_BUILD_DIR>...";
+if [ -z $OSSIM_BUILD_DIR ]; then
+  export OSSIM_BUILD_DIR=$OSSIM_DEV_HOME/build;
+  if [ ! -d $OSSIM_BUILD_DIR ] ; then
+    echo "ERROR: OSSIM_BUILD_DIR = <$OSSIM_BUILD_DIR> does not exist at this location. Cannot install";
+    exit 1;
+  fi
+fi
+
+echo "STATUS: Performing make install to <$OSSIM_INSTALL_PREFIX>"
+pushd $OSSIM_DEV_HOME/ossim/scripts
+./install.sh
+if [ $? -ne 0 ]; then
+  echo; echo "ERROR: Error encountered ossim install. Check the console log and correct."
+  popd >/dev/null
+  exit 1
+fi
+popd >/dev/null
+
+mkdir -p $OSSIM_INSTALL_PREFIX/etc/profile.d
+mkdir -p $OSSIM_INSTALL_PREFIX/share/ossim/templates
+
+cp $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.sh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.sh
+cp $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.csh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.csh
+cp $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-initd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-initd-template
+cp $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-systemd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-systemd-template
+
+chmod -R 755 $OSSIM_INSTALL_PREFIX/etc/profile.d
+chmod 755 $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper*
+
+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.sh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.sh
+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.csh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.csh
+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-initd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-initd-template
+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-systemd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-systemd-template
+
+echo; echo "STATUS: Install completed successfully. Install located in $OSSIM_INSTALL_PREFIX"
+
+if [ "$BUILD_KAKADU_PLUGIN" = "ON" ]; then
+   if [ -z $KAKADU_LIBRARY ]; then
+      echo "ERROR: KAKADU_LIBRARY env variable not set for install"
+      exit 1
+   fi
+
+   if [ -z $KAKADU_AUX_LIBRARY ]; then
+      echo "ERROR: KAKADU_AUX_LIBRARY env variable not set for install"
+      exit 1
+   fi
+
+   # Need Kakadu shared libs for jpip server. drb - 20160414
+   echo "STATUS: Performing install of $KAKADU_LIBRARY to <$OSSIM_INSTALL_PREFIX>"
+   cp $KAKADU_LIBRARY $OSSIM_INSTALL_PREFIX/lib64
+   echo "STATUS: Performing install of $KAKADU_AUX_LIBRARY to <$OSSIM_INSTALL_PREFIX>"
+   cp $KAKADU_AUX_LIBRARY $OSSIM_INSTALL_PREFIX/lib64
+fi
+
+if [ "$BUILD_OMS" == "ON" ] ; then
+   echo "STATUS: Performing joms install to <$OSSIM_INSTALL_PREFIX>"
+   pushd $OSSIM_DEV_HOME/ossim-oms/joms/build_scripts/linux
+   ./install.sh
+   if [ $? -ne 0 ]; then
+     echo; echo "ERROR: Error encountered during make install of joms. Check the console log and correct."
+     popd
+     exit 1
+   fi
+fi 
+TIMESTAMP=`date +%Y-%m-%d-%H%M`
+
+#####
+# For binary install we will go ahead and define a service wrapper
+# for the JPIP server.
+#
+mkdir -p ${OSSIM_INSTALL_PREFIX}/etc/init.d ${OSSIM_INSTALL_PREFIX}/lib/systemd/system
+chmod 755 ${OSSIM_INSTALL_PREFIX}/etc/init.d
+chmod 755 ${OSSIM_INSTALL_PREFIX}/lib/systemd/system
+
+#install -d -m755 ${OSSIM_INSTALL_PREFIX}/etc/init.d
+#install -d -m755 ${OSSIM_INSTALL_PREFIX}/lib/systemd/system
+pushd $OSSIM_DEV_HOME/ossim/support/linux/
+app=jpip-server
+sed -e "s/{{program_name}}/${app}/g"  -e "s/{{program_user}}/omar/g" -e "s/{{program_group}}/omar/g" < service-wrapper-systemd-template >${OSSIM_INSTALL_PREFIX}/lib/systemd/system/${app}.service
+sed -e "s/{{program_name}}/${app}/g"  -e "s/{{program_user}}/omar/g" -e "s/{{program_group}}/omar/g" < service-wrapper-initd-template >${OSSIM_INSTALL_PREFIX}/etc/init.d/${app}
+popd
+
+echo; echo "STATUS: Writing install info file to: <$OSSIM_INSTALL_PREFIX/gocd_install.info>..."
+pushd $OSSIM_INSTALL_PREFIX
+INSTALL_DIRNAME=${PWD##*/}
+echo "
+Build timestamp: $TIMESTAMP
+Pipeline Name:   $GO_PIPELINE_NAME
+Job Name:        $GO_JOB_NAME
+" > gocd_install.info
+cd ..
+
+if [ "$ZIP_OPTION" == "-z" ]; then
+  echo; echo "STATUS: Zipping up install directory: <$INSTALL_DIRNAME>..."
+  FILENAME_TS="install_$GO_PIPELINE_NAME_$TIMESTAMP.tgz"
+  tar cvfz $FILENAME_TS $INSTALL_DIRNAME
+  if [ $? -ne 0 ]; then
+    echo; echo "ERROR: Error encountered while zipping the install dir. Check the console log and correct."
+    popd
+    exit 1
+  fi
+
+  # Create a link that can be used as artifact of latest build/install. This will
+  # overwrite previous sandbox's so only the latest is used for testing (standalone)
+  # or generating expected results
+  ln -s $FILENAME_TS "install.tgz"
+  echo "STATUS: Successfully zipped install dir to <$PWD/$FILENAME_TS> and created link <$PWD/install.tgz>."
+fi
+
+popd # Out of dir containing install subdir

{'commit': 'diff --git a/Jenkinsfile b/Jenkinsfile\nindex a839ae4e..76332aa5 100644\n--- a/Jenkinsfile\n+++ b/Jenkinsfile\n@@ -4,17 +4,12 @@ properties([\n         string(name: \'MAKE_VERBOSE\', defaultValue: \'VERBOSE=true\', description: \'\'),\n         booleanParam(name: \'BUILD_WITH_FORTIFY\', defaultValue: false, description: \'Check to build and scan source using HP Fortify tool\'),\n         booleanParam(name: \'SCAN_WITH_SONARQUBE\', defaultValue: false, description: \'Check to perform SonarQube analysis\'),\n-        string(name: \'GIT_PUBLIC_SERVER_URL\', defaultValue: \'https://github.com/ossimlabs\', description: \'\'),\n-        string(name: \'GIT_PRIVATE_SERVER_URL\', defaultValue: \'https://github.com/Maxar-Corp\', description: \'\'),\n-        string(name: \'CREDENTIALS_ID\', defaultValue: \'cicdGithub\', description: \'\'),\n-\n-\n         booleanParam(name: \'CLEAN_WORKSPACE\', defaultValue: true, description: \'Clean the workspace at the end of the run\')\n     ]),\n     pipelineTriggers([\n             [$class: "GitHubPushTrigger"]\n     ]),\n-    [$class: \'GithubProjectProperty\', displayName: \'\', projectUrlStr: \'https://github.com/ossimlabs/tlv\'],\n+    [$class: \'GithubProjectProperty\', displayName: \'\', projectUrlStr: \'https://github.com/ossimlabs/ossim\'],\n     buildDiscarder(logRotator(artifactDaysToKeepStr: \'\', artifactNumToKeepStr: \'3\', daysToKeepStr: \'\', numToKeepStr: \'20\')),\n     disableConcurrentBuilds()\n ])\n@@ -23,10 +18,12 @@ node ("${BUILD_NODE}"){\n \n     try {\n         stage( "Download Artifacts" ) {\n-            dir( "ossim-ci" ) {\n-                git branch: "$BRANCH_NAME",\n-                url: "${ GIT_PRIVATE_SERVER_URL }/ossim-ci.git",\n-                credentialsId: "${ CREDENTIALS_ID }"\n+            env.OPENCV_HOME = "${env.WORKSPACE}/opencv-3.2-minimal-install"\n+            withCredentials([string(credentialsId: \'o2-artifact-project\', variable: \'o2ArtifactProject\')]) {\n+                step ([$class: "CopyArtifact",\n+                    projectName: o2ArtifactProject,\n+                    filter: "common-variables.groovy",\n+                    flatten: true])\n             }\n \n             dir( "${ env.WORKSPACE }" ) {\n@@ -48,8 +45,7 @@ node ("${BUILD_NODE}"){\n                     """\n             }\n \n-            load "ossim-ci/jenkins/variables/common-variables.groovy"\n-            load "ossim-ci/jenkins/variables/ossim-variables.groovy"\n+            load "common-variables.groovy"\n         }\n \n         stage( "Checkout" ) {\n@@ -100,8 +96,8 @@ node ("${BUILD_NODE}"){\n                 sh """\n                     rm -rf ${ env.WORKSPACE }/build/CMakeCache.txt\n                     export PATH=${ PATH }:/opt/HPE_Security/Fortify_SCA_and_Apps_17.20/bin\n-                    ${ env.WORKSPACE }/ossim-ci/scripts/ossim-build.sh\n-                    ${ env.WORKSPACE }/ossim-ci/scripts/ossim-install.sh\n+                    ${ env.WORKSPACE }/ossim/scripts/ossim-build.sh\n+                    ${ env.WORKSPACE }/ossim/scripts/ossim-install.sh\n                 """\n             }\n         }\n@@ -112,7 +108,7 @@ node ("${BUILD_NODE}"){\n                 usernameVariable: \'REPOSITORY_MANAGER_USER\',\n                 passwordVariable: \'REPOSITORY_MANAGER_PASSWORD\']]) {\n                     dir( "${ env.WORKSPACE }" ) {\n-                        sh "${ env.WORKSPACE }/ossim-ci/scripts/oms-deploy.sh"\n+                        sh "${ env.WORKSPACE }/ossim/scripts/oms-deploy.sh"\n                     }\n             }\n         }\n@@ -141,7 +137,7 @@ node ("${BUILD_NODE}"){\n         if ( BUILD_WITH_FORTIFY == "true" ) {\n             stage( \'Fortify SCA\' ) {\n                 dir( "${ env.WORKSPACE }/build" ) {\n-                    sh """\n+                    sh """ \n                         export PATH=${ PATH }:/opt/HPE_Security/Fortify_SCA_and_Apps_17.20/bin\n                         sourceanalyzer -64 -b ossimlabs -scan -f fortifyResults-ossim.fpr\n                     """\ndiff --git a/scripts/oms-deploy.sh b/scripts/oms-deploy.sh\nnew file mode 100755\nindex 00000000..dfc18f9b\n--- /dev/null\n+++ b/scripts/oms-deploy.sh\n@@ -0,0 +1,16 @@\n+#!/bin/bash \n+pushd $(dirname ${BASH_SOURCE[0]}) > /dev/null\n+OSSIMCI_SCRIPT_DIR=`pwd -P`\n+pushd $OSSIMCI_SCRIPT_DIR/../../.. >/dev/null\n+popd > /dev/null\n+popd >/dev/null\n+\n+source $OSSIMCI_SCRIPT_DIR/ossim-env.sh\n+\n+pushd $OSSIM_DEV_HOME/ossim-oms/joms\n+   gradle uploadArchives\n+   if [ $? -ne 0 ]; then\n+     echo; echo "ERROR: Build failed for JOMS Deploy to Nexus."\n+     exit 1\n+   fi\n+ popd\ndiff --git a/scripts/ossim-build.sh b/scripts/ossim-build.sh\nnew file mode 100755\nindex 00000000..3a8afe09\n--- /dev/null\n+++ b/scripts/ossim-build.sh\n@@ -0,0 +1,43 @@\n+#!/bin/bash\n+\n+pushd $(dirname ${BASH_SOURCE[0]}) > /dev/null\n+OSSIMCI_SCRIPT_DIR=`pwd -P`\n+pushd $OSSIMCI_SCRIPT_DIR/../../.. >/dev/null\n+popd > /dev/null\n+popd >/dev/null\n+\n+source $OSSIMCI_SCRIPT_DIR/ossim-env.sh\n+\n+if [ "$BUILD_OMS" == "ON" ] ; then\n+   pushd $OSSIM_DEV_HOME/ossim-oms/joms/build_scripts/linux\n+   ./setup.sh\n+   if [ $? -ne 0 ]; then\n+     echo; echo "ERROR: Build SETUP for OSSIM."\n+     exit 1\n+   fi\n+   popd\n+fi\n+\n+if [ -d $OSSIM_DEV_HOME/ossim ] ; then\n+   pushd $OSSIM_DEV_HOME/ossim/scripts\n+   ./build.sh\n+   if [ $? -ne 0 ]; then\n+     echo; echo "ERROR: Build failed for OSSIM."\n+     exit 1\n+   fi\n+   popd\n+else\n+   echo "ERROR: OSSIM module not found.  We at least need ossim module to build the baseline"\n+   exit 1\n+fi\n+\n+if [ "$BUILD_OMS" == "ON" ] ; then\n+   echo; echo "### BUILD_OMS = $BUILD_OMS ###"; echo\n+   pushd $OSSIM_DEV_HOME/ossim-oms/joms/build_scripts/linux\n+   ./build.sh\n+      if [ $? -ne 0 ]; then\n+        echo; echo "ERROR: Build failed for JOMS."\n+        exit 1\n+      fi\n+   popd\n+fi\ndiff --git a/scripts/ossim-env.sh b/scripts/ossim-env.sh\nnew file mode 100755\nindex 00000000..77a1d61f\n--- /dev/null\n+++ b/scripts/ossim-env.sh\n@@ -0,0 +1,293 @@\n+#!/bin/bash \n+# Set Continuous Integration Environment:\n+\n+if [ -z $OSSIMCI_SCRIPT_DIR ] ; then\n+   pushd $(dirname ${BASH_SOURCE[0]})\n+   export OSSIMCI_SCRIPT_DIR=`pwd -P`\n+   popd >/dev/null\n+fi\n+if [ -z $WORKSPACE ] ; then\n+   if [ -z $OSSIM_DEV_HOME ] ; then\n+      pushd $OSSIMCI_SCRIPT_DIR/../../.. >/dev/null\n+      export OSSIM_DEV_HOME=$PWD\n+      popd > /dev/null\n+   fi\n+\n+else\n+   export OSSIM_DEV_HOME=$WORKSPACE\n+fi\n+\n+echo "OSSIMCI_SCRIPT_DIR = ${OSSIMCI_SCRIPT_DIR}"\n+if [ -f "${OSSIMCI_SCRIPT_DIR}/git-prompt.sh" ] ; then\n+   echo "SOURCING ${OSSIMCI_SCRIPT_DIR}/git-prompt.sh"\n+  source $OSSIMCI_SCRIPT_DIR/git-prompt.sh\n+fi\n+\n+if [ -z $OSSIM_INSTALL_PREFIX ]; then\n+  export OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install\n+fi\n+\n+# Setup JAVA Home\n+#\n+# If not explicitly set then try to set.  Add more for other OS\'s\n+# this should work with OpenJDK installation.\n+#\n+if [ -z $JAVA_HOME ] ; then\n+  if [ -d "/usr/lib/jvm/java" ] ; then\n+    export JAVA_HOME="/usr/lib/jvm/java"\n+  elif [ -f "/usr/libexec/java_home" ] ; then\n+    export JAVA_HOME=`/usr/libexec/java_home`\n+  fi\n+fi\n+\n+if [ -z $OSSIM_GIT_BRANCH ] ; then\n+   pushd $OSSIM_DEV_HOME/ossim-ci\n+   export OSSIM_GIT_BRANCH=`__git_ps1 "%s"`\n+   popd $OSSIM_DEV_HOME/ossim-ci\n+fi\n+\n+echo "CURRENT BRANCH = ${OSSIM_GIT_BRANCH}"\n+\n+if [ -z $S3_DELIVERY_BUCKET ]; then\n+  export S3_DELIVERY_BUCKET="s3://o2-delivery/${OSSIM_GIT_BRANCH}"\n+fi\n+\n+if [ -z $KAKADU_VERSION ] ; then\n+   # later need to add tests.  This is the last version\n+   # before they started using C++11 and that does not build on\n+   # gcc < 4.8 so CentOS6 and REL6 , ... uses gcc 4.6 I do believe.\n+  export KAKADU_VERSION="v7_5-01123C"\n+fi\n+\n+# Version definitions\n+if [ -z $OSSIM_DEPENDENCY_VERSION ]; then\n+   export OSSIM_DEPENDENCY_VERSION=1.0.0\n+fi\n+\n+# for packaging and general version number \n+#\n+if [ -z $OSSIM_VERSION ] ; then\n+   export OSSIM_VERSION=1.9.0\n+fi\n+\n+if [ -z $OSSIM_VERSION_TAG ] ; then\n+   if [ "${OSSIM_GIT_BRANCH}" == "dev" ] ; then\n+      export OSSIM_VERSION_TAG="SNAPSHOT"\n+   else \n+       export OSSIM_VERSION_TAG="RELEASE"\n+   fi\n+fi\n+\n+# for packaging and general version number \n+#\n+if [ -z $O2_VERSION ] ; then\n+   export O2_VERSION=1.0.0\n+fi\n+\n+# for packaging and general version number \n+#\n+if [ -z $TLV_VERSION ] ; then\n+   export TLV_VERSION=1.0.0\n+fi\n+\n+# For RPM packaging\n+#\n+if [ -z $OSSIM_BUILD_RELEASE ] ; then\n+   export OSSIM_BUILD_RELEASE=1\n+fi\n+\n+# For RPM packaging\n+#\n+if [ -z $O2_BUILD_RELEASE ] ; then\n+   export O2_BUILD_RELEASE=1\n+fi\n+\n+if [ -z $TLV_BUILD_RELEASE ] ; then\n+   export TLV_BUILD_RELEASE=1\n+fi\n+\n+if [ -z $BUILD_OSSIM_APPS ] ; then\n+   export BUILD_OSSIM_APPS=ON\n+fi\n+\n+if [ -z $BUILD_OSSIM_CURL_APPS ] ; then\n+   export BUILD_OSSIM_CURL_APPS=ON\n+fi\n+\n+if [ -d $OSSIM_DEV_HOME/ossim-video ] ; then\n+   if [ -z $BUILD_OSSIM_VIDEO ] ; then\n+      export BUILD_OSSIM_VIDEO=ON\n+   fi\n+else\n+   export BUILD_OSSIM_VIDEO=ON\n+fi\n+\n+if [ -d $OSSIM_DEV_HOME/ossim-oms ] ; then\n+   if [ -z $BUILD_OMS ] ; then\n+      export BUILD_OMS=ON\n+   fi\n+else\n+   export BUILD_OMS=OFF\n+fi\n+\n+if [ -d $OSSIM_DEV_HOME/ossim-gui ] ; then\n+   if [ -z $BUILD_OSSIM_GUI ] ; then\n+      export BUILD_OSSIM_GUI=ON\n+   fi\n+else\n+   export BUILD_OSSIM_GUI=OFF\n+fi\n+\n+if [ -d $OSSIM_DEV_HOME/ossim-planet ] ; then\n+   if [ -z $BUILD_OSSIM_PLANET ] ; then\n+      export BUILD_OSSIM_PLANET=ON\n+   fi\n+else\n+   export BUILD_OSSIM_PLANET=OFF\n+fi\n+\n+if [ -d $OSSIM_DEV_HOME/ossim-wms ] ; then\n+   if [ -z $BUILD_OSSIM_WMS ] ; then\n+      export BUILD_OSSIM_WMS=ON\n+   fi\n+else\n+   export BUILD_OSSIM_WMS=OFF\n+fi\n+\n+\n+if [ -d $OSSIM_DEV_HOME/ossim-plugins ] ; then\n+\n+   if [ -z $BUILD_CNES_PLUGIN ] ; then\n+      export BUILD_CNES_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_WEB_PLUGIN ] ; then\n+      export BUILD_WEB_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_SQLITE_PLUGIN ] ; then\n+      export BUILD_SQLITE_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_KAKADU_PLUGIN ] ; then\n+      export BUILD_KAKADU_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_KML_PLUGIN ] ; then\n+      export BUILD_KML_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_GDAL_PLUGIN ] ; then\n+      export BUILD_GDAL_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_AWS_PLUGIN ] ; then\n+      export BUILD_AWS_PLUGIN=ON\n+   fi\n+#   if [ -z $BUILD_HDF5_PLUGIN ] ; then\n+#      export BUILD_HDF5_PLUGIN=ON\n+#   fi\n+\n+   if [ -z $BUILD_POTRACE_PLUGIN ] ; then\n+      export BUILD_POTRACE_PLUGIN=ON\n+   fi\n+   \n+   if [ -z $BUILD_FFTW3_PLUGIN ] ; then\n+      export BUILD_FFTW3_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_GEOPDF_PLUGIN ] ; then\n+   export BUILD_GEOPDF_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_OPENCV_PLUGIN ] ; then\n+      export BUILD_OPENCV_PLUGIN=OFF\n+   fi\n+\n+   if [ -z $BUILD_OPENJPEG_PLUGIN ] ; then\n+      export BUILD_OPENJPEG_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_PNG_PLUGIN ] ; then\n+      export BUILD_PNG_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_JPEG12_PLUGIN ] ; then\n+      export BUILD_JPEG12_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_CSM_PLUGIN ] ; then\n+      export BUILD_CSM_PLUGIN=OFF\n+   fi\n+\n+   if [ -z $BUILD_MSP_PLUGIN ] ; then\n+      export BUILD_MSP_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_ATP_PLUGIN ] ; then\n+      export BUILD_ATP_PLUGIN=ON\n+   fi\n+\n+   if [ -z $BUILD_OSSIM_HDF5_SUPPORT ] ; then\n+      export BUILD_OSSIM_HDF5_SUPPORT=ON\n+   fi\n+   if [ -z $BUILD_OSSIM_HDF5_SUPPORT ] ; then\n+      export BUILD_OSSIM_HDF5_SUPPORT=ON\n+   fi\n+fi\n+\n+if [ -z $OSSIM_BUILD_ADDITIONAL_DIRECTORIES ] ; then\n+   if [ -d $OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server ]; then\n+     export OSSIM_BUILD_ADDITIONAL_DIRECTORIES=$OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server\n+   fi\n+fi\n+\n+if [ \\( "${BUILD_KAKADU_PLUGIN}"="ON" \\) -o \\( -d "$OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server" \\) ] ; then\n+\n+   if [ -d "${OSSIM_DEV_HOME}/kakadu-${KAKADU_VERSION}" ] ; then\n+      if [ -z $KAKADU_ROOT_SRC ] ; then\n+         export KAKADU_ROOT_SRC="${OSSIM_DEV_HOME}/kakadu-${KAKADU_VERSION}"\n+      fi\n+      if [ -d "${KAKADU_ROOT_SRC}/lib/Linux-x86-64-gcc" ] ; then\n+         if [ -z $KAKADU_LIBRARY ] ; then\n+              export KAKADU_LIBRARY="${KAKADU_ROOT_SRC}/lib/Linux-x86-64-gcc/libkdu_v75R.so"\n+         fi\n+         if [ -z $KAKADU_AUX_LIBRARY ] ; then\n+            export KAKADU_AUX_LIBRARY="${KAKADU_ROOT_SRC}/lib/Linux-x86-64-gcc/libkdu_a75R.so"\n+         fi\n+      fi\n+   fi\n+fi\n+\n+# For OSSIM run-time environment:\n+if [ -z $OSSIM_DATA ] ; then\n+   export OSSIM_DATA="/data"\n+fi\n+if [ -z $OSSIM_BATCH_TEST_DATA ] ; then\n+   export OSSIM_BATCH_TEST_DATA="$OSSIM_DATA/ossim-data/${OSSIM_GIT_BRANCH}"\n+fi\n+if [ -z $OSSIM_BATCH_TEST_EXPECTED ] ; then\n+   export OSSIM_BATCH_TEST_EXPECTED="$OSSIM_DATA/ossim-expected/${OSSIM_GIT_BRANCH}"\n+fi\n+if [ -z $OSSIM_BATCH_TEST_RESULTS ] ; then\n+   export OSSIM_BATCH_TEST_RESULTS="$OSSIM_DATA/ossim-results/${OSSIM_GIT_BRANCH}"\n+fi\n+if [ -z $OSSIM_PREFS_FILE ] ; then\n+   if [ -f $OSSIM_INSTALL_PREFIX/ossim.config ] ; then\n+      export OSSIM_PREFS_FILE=$OSSIM_INSTALL_PREFIX/ossim.config\n+   elif [ -f $OSSIM_INSTALL_PREFIX/share/ossim/ossim-preferences-template ] ; then\n+      export OSSIM_PREFS_FILE=$OSSIM_INSTALL_PREFIX/share/ossim/ossim-preferences-template\n+   fi\n+fi\n+\n+# For S3 storage/syncing of test data\n+if [ -z $S3_DATA_BUCKET ] ; then\n+   export S3_DATA_BUCKET="s3://o2_test_data"\n+fi\n+\n+\n+echo "S3_DATA_BUCKET = ${S3_DATA_BUCKET}"\n+echo "OSSIM_DATA = ${OSSIM_DATA}"\n+echo "OSSIM_BATCH_TEST_DATA = ${OSSIM_BATCH_TEST_DATA}"\n+echo "OSSIM_INSTALL_PREFIX = ${OSSIM_INSTALL_PREFIX}"\n+echo "OSSIM_PREFS_FILE = ${OSSIM_PREFS_FILE}"\ndiff --git a/scripts/ossim-install.sh b/scripts/ossim-install.sh\nnew file mode 100755\nindex 00000000..73dd2bf2\n--- /dev/null\n+++ b/scripts/ossim-install.sh\n@@ -0,0 +1,127 @@\n+#!/bin/bash\n+ZIP_OPTION=$1\n+pushd `dirname ${BASH_SOURCE[0]}` >/dev/null\n+OSSIMCI_SCRIPT_DIR=`pwd -P`\n+pushd $OSSIMCI_SCRIPT_DIR/../../.. >/dev/null\n+export OSSIM_DEV_HOME=$PWD\n+popd > /dev/null\n+popd >/dev/null\n+\n+source $OSSIMCI_SCRIPT_DIR/ossim-env.sh\n+\n+# Establish CMAKE\'s install directory:\n+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then\n+    export OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install\n+fi\n+\n+echo "STATUS: Checking presence of env var OSSIM_BUILD_DIR = <$OSSIM_BUILD_DIR>...";\n+if [ -z $OSSIM_BUILD_DIR ]; then\n+  export OSSIM_BUILD_DIR=$OSSIM_DEV_HOME/build;\n+  if [ ! -d $OSSIM_BUILD_DIR ] ; then\n+    echo "ERROR: OSSIM_BUILD_DIR = <$OSSIM_BUILD_DIR> does not exist at this location. Cannot install";\n+    exit 1;\n+  fi\n+fi\n+\n+echo "STATUS: Performing make install to <$OSSIM_INSTALL_PREFIX>"\n+pushd $OSSIM_DEV_HOME/ossim/scripts\n+./install.sh\n+if [ $? -ne 0 ]; then\n+  echo; echo "ERROR: Error encountered ossim install. Check the console log and correct."\n+  popd >/dev/null\n+  exit 1\n+fi\n+popd >/dev/null\n+\n+mkdir -p $OSSIM_INSTALL_PREFIX/etc/profile.d\n+mkdir -p $OSSIM_INSTALL_PREFIX/share/ossim/templates\n+\n+cp $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.sh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.sh\n+cp $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.csh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.csh\n+cp $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-initd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-initd-template\n+cp $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-systemd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-systemd-template\n+\n+chmod -R 755 $OSSIM_INSTALL_PREFIX/etc/profile.d\n+chmod 755 $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper*\n+\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.sh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.sh\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.csh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.csh\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-initd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-initd-template\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-systemd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-systemd-template\n+\n+echo; echo "STATUS: Install completed successfully. Install located in $OSSIM_INSTALL_PREFIX"\n+\n+if [ "$BUILD_KAKADU_PLUGIN" = "ON" ]; then\n+   if [ -z $KAKADU_LIBRARY ]; then\n+      echo "ERROR: KAKADU_LIBRARY env variable not set for install"\n+      exit 1\n+   fi\n+\n+   if [ -z $KAKADU_AUX_LIBRARY ]; then\n+      echo "ERROR: KAKADU_AUX_LIBRARY env variable not set for install"\n+      exit 1\n+   fi\n+\n+   # Need Kakadu shared libs for jpip server. drb - 20160414\n+   echo "STATUS: Performing install of $KAKADU_LIBRARY to <$OSSIM_INSTALL_PREFIX>"\n+   cp $KAKADU_LIBRARY $OSSIM_INSTALL_PREFIX/lib64\n+   echo "STATUS: Performing install of $KAKADU_AUX_LIBRARY to <$OSSIM_INSTALL_PREFIX>"\n+   cp $KAKADU_AUX_LIBRARY $OSSIM_INSTALL_PREFIX/lib64\n+fi\n+\n+if [ "$BUILD_OMS" == "ON" ] ; then\n+   echo "STATUS: Performing joms install to <$OSSIM_INSTALL_PREFIX>"\n+   pushd $OSSIM_DEV_HOME/ossim-oms/joms/build_scripts/linux\n+   ./install.sh\n+   if [ $? -ne 0 ]; then\n+     echo; echo "ERROR: Error encountered during make install of joms. Check the console log and correct."\n+     popd\n+     exit 1\n+   fi\n+fi \n+TIMESTAMP=`date +%Y-%m-%d-%H%M`\n+\n+#####\n+# For binary install we will go ahead and define a service wrapper\n+# for the JPIP server.\n+#\n+mkdir -p ${OSSIM_INSTALL_PREFIX}/etc/init.d ${OSSIM_INSTALL_PREFIX}/lib/systemd/system\n+chmod 755 ${OSSIM_INSTALL_PREFIX}/etc/init.d\n+chmod 755 ${OSSIM_INSTALL_PREFIX}/lib/systemd/system\n+\n+#install -d -m755 ${OSSIM_INSTALL_PREFIX}/etc/init.d\n+#install -d -m755 ${OSSIM_INSTALL_PREFIX}/lib/systemd/system\n+pushd $OSSIM_DEV_HOME/ossim/support/linux/\n+app=jpip-server\n+sed -e "s/{{program_name}}/${app}/g"  -e "s/{{program_user}}/omar/g" -e "s/{{program_group}}/omar/g" < service-wrapper-systemd-template >${OSSIM_INSTALL_PREFIX}/lib/systemd/system/${app}.service\n+sed -e "s/{{program_name}}/${app}/g"  -e "s/{{program_user}}/omar/g" -e "s/{{program_group}}/omar/g" < service-wrapper-initd-template >${OSSIM_INSTALL_PREFIX}/etc/init.d/${app}\n+popd\n+\n+echo; echo "STATUS: Writing install info file to: <$OSSIM_INSTALL_PREFIX/gocd_install.info>..."\n+pushd $OSSIM_INSTALL_PREFIX\n+INSTALL_DIRNAME=${PWD##*/}\n+echo "\n+Build timestamp: $TIMESTAMP\n+Pipeline Name:   $GO_PIPELINE_NAME\n+Job Name:        $GO_JOB_NAME\n+" > gocd_install.info\n+cd ..\n+\n+if [ "$ZIP_OPTION" == "-z" ]; then\n+  echo; echo "STATUS: Zipping up install directory: <$INSTALL_DIRNAME>..."\n+  FILENAME_TS="install_$GO_PIPELINE_NAME_$TIMESTAMP.tgz"\n+  tar cvfz $FILENAME_TS $INSTALL_DIRNAME\n+  if [ $? -ne 0 ]; then\n+    echo; echo "ERROR: Error encountered while zipping the install dir. Check the console log and correct."\n+    popd\n+    exit 1\n+  fi\n+\n+  # Create a link that can be used as artifact of latest build/install. This will\n+  # overwrite previous sandbox\'s so only the latest is used for testing (standalone)\n+  # or generating expected results\n+  ln -s $FILENAME_TS "install.tgz"\n+  echo "STATUS: Successfully zipped install dir to <$PWD/$FILENAME_TS> and created link <$PWD/install.tgz>."\n+fi\n+\n+popd # Out of dir containing install subdir\n', 'commit_subject': 'Fixed multibranch setup od jenkinsfile and added scripts', 'repo_name': 'ossimlabs/ossim', 'committer': {'name': 'Tyler Culp', 'email': 'fe3e20e285eae1dbbe3c43bc7de683d583cac10d@gmail.com', 'time_sec': '1565022517', 'tz_offset': '-240', 'date': {'seconds': '1565022517'}}, 'commit_tree': 'af3aecba0008ac6ac707dcbefae51e7bfc5bf8f9', 'commit_message': 'Fixed multibranch setup od jenkinsfile and added scripts\n', 'language_name': 'C', 'license': 'mit', 'hunks': '@@ -0,0 +1,127 @@\n+#!/bin/bash\n+ZIP_OPTION=$1\n+pushd `dirname ${BASH_SOURCE[0]}` >/dev/null\n+OSSIMCI_SCRIPT_DIR=`pwd -P`\n+pushd $OSSIMCI_SCRIPT_DIR/../../.. >/dev/null\n+export OSSIM_DEV_HOME=$PWD\n+popd > /dev/null\n+popd >/dev/null\n+\n+source $OSSIMCI_SCRIPT_DIR/ossim-env.sh\n+\n+# Establish CMAKE\'s install directory:\n+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then\n+    export OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install\n+fi\n+\n+echo "STATUS: Checking presence of env var OSSIM_BUILD_DIR = <$OSSIM_BUILD_DIR>...";\n+if [ -z $OSSIM_BUILD_DIR ]; then\n+  export OSSIM_BUILD_DIR=$OSSIM_DEV_HOME/build;\n+  if [ ! -d $OSSIM_BUILD_DIR ] ; then\n+    echo "ERROR: OSSIM_BUILD_DIR = <$OSSIM_BUILD_DIR> does not exist at this location. Cannot install";\n+    exit 1;\n+  fi\n+fi\n+\n+echo "STATUS: Performing make install to <$OSSIM_INSTALL_PREFIX>"\n+pushd $OSSIM_DEV_HOME/ossim/scripts\n+./install.sh\n+if [ $? -ne 0 ]; then\n+  echo; echo "ERROR: Error encountered ossim install. Check the console log and correct."\n+  popd >/dev/null\n+  exit 1\n+fi\n+popd >/dev/null\n+\n+mkdir -p $OSSIM_INSTALL_PREFIX/etc/profile.d\n+mkdir -p $OSSIM_INSTALL_PREFIX/share/ossim/templates\n+\n+cp $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.sh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.sh\n+cp $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.csh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.csh\n+cp $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-initd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-initd-template\n+cp $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-systemd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-systemd-template\n+\n+chmod -R 755 $OSSIM_INSTALL_PREFIX/etc/profile.d\n+chmod 755 $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper*\n+\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.sh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.sh\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/etc/profile.d/ossim.csh $OSSIM_INSTALL_PREFIX/etc/profile.d/ossim.csh\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-initd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-initd-template\n+#install -p -m755 -D $OSSIM_DEV_HOME/ossim/support/linux/service-wrapper-systemd-template $OSSIM_INSTALL_PREFIX/share/ossim/templates/service-wrapper-systemd-template\n+\n+echo; echo "STATUS: Install completed successfully. Install located in $OSSIM_INSTALL_PREFIX"\n+\n+if [ "$BUILD_KAKADU_PLUGIN" = "ON" ]; then\n+   if [ -z $KAKADU_LIBRARY ]; then\n+      echo "ERROR: KAKADU_LIBRARY env variable not set for install"\n+      exit 1\n+   fi\n+\n+   if [ -z $KAKADU_AUX_LIBRARY ]; then\n+      echo "ERROR: KAKADU_AUX_LIBRARY env variable not set for install"\n+      exit 1\n+   fi\n+\n+   # Need Kakadu shared libs for jpip server. drb - 20160414\n+   echo "STATUS: Performing install of $KAKADU_LIBRARY to <$OSSIM_INSTALL_PREFIX>"\n+   cp $KAKADU_LIBRARY $OSSIM_INSTALL_PREFIX/lib64\n+   echo "STATUS: Performing install of $KAKADU_AUX_LIBRARY to <$OSSIM_INSTALL_PREFIX>"\n+   cp $KAKADU_AUX_LIBRARY $OSSIM_INSTALL_PREFIX/lib64\n+fi\n+\n+if [ "$BUILD_OMS" == "ON" ] ; then\n+   echo "STATUS: Performing joms install to <$OSSIM_INSTALL_PREFIX>"\n+   pushd $OSSIM_DEV_HOME/ossim-oms/joms/build_scripts/linux\n+   ./install.sh\n+   if [ $? -ne 0 ]; then\n+     echo; echo "ERROR: Error encountered during make install of joms. Check the console log and correct."\n+     popd\n+     exit 1\n+   fi\n+fi \n+TIMESTAMP=`date +%Y-%m-%d-%H%M`\n+\n+#####\n+# For binary install we will go ahead and define a service wrapper\n+# for the JPIP server.\n+#\n+mkdir -p ${OSSIM_INSTALL_PREFIX}/etc/init.d ${OSSIM_INSTALL_PREFIX}/lib/systemd/system\n+chmod 755 ${OSSIM_INSTALL_PREFIX}/etc/init.d\n+chmod 755 ${OSSIM_INSTALL_PREFIX}/lib/systemd/system\n+\n+#install -d -m755 ${OSSIM_INSTALL_PREFIX}/etc/init.d\n+#install -d -m755 ${OSSIM_INSTALL_PREFIX}/lib/systemd/system\n+pushd $OSSIM_DEV_HOME/ossim/support/linux/\n+app=jpip-server\n+sed -e "s/{{program_name}}/${app}/g"  -e "s/{{program_user}}/omar/g" -e "s/{{program_group}}/omar/g" < service-wrapper-systemd-template >${OSSIM_INSTALL_PREFIX}/lib/systemd/system/${app}.service\n+sed -e "s/{{program_name}}/${app}/g"  -e "s/{{program_user}}/omar/g" -e "s/{{program_group}}/omar/g" < service-wrapper-initd-template >${OSSIM_INSTALL_PREFIX}/etc/init.d/${app}\n+popd\n+\n+echo; echo "STATUS: Writing install info file to: <$OSSIM_INSTALL_PREFIX/gocd_install.info>..."\n+pushd $OSSIM_INSTALL_PREFIX\n+INSTALL_DIRNAME=${PWD##*/}\n+echo "\n+Build timestamp: $TIMESTAMP\n+Pipeline Name:   $GO_PIPELINE_NAME\n+Job Name:        $GO_JOB_NAME\n+" > gocd_install.info\n+cd ..\n+\n+if [ "$ZIP_OPTION" == "-z" ]; then\n+  echo; echo "STATUS: Zipping up install directory: <$INSTALL_DIRNAME>..."\n+  FILENAME_TS="install_$GO_PIPELINE_NAME_$TIMESTAMP.tgz"\n+  tar cvfz $FILENAME_TS $INSTALL_DIRNAME\n+  if [ $? -ne 0 ]; then\n+    echo; echo "ERROR: Error encountered while zipping the install dir. Check the console log and correct."\n+    popd\n+    exit 1\n+  fi\n+\n+  # Create a link that can be used as artifact of latest build/install. This will\n+  # overwrite previous sandbox\'s so only the latest is used for testing (standalone)\n+  # or generating expected results\n+  ln -s $FILENAME_TS "install.tgz"\n+  echo "STATUS: Successfully zipped install dir to <$PWD/$FILENAME_TS> and created link <$PWD/install.tgz>."\n+fi\n+\n+popd # Out of dir containing install subdir\n', 'addition_count': 127, 'deletion_count': 0, 'src_file': '/dev/null', 'tgt_file': 'b/scripts/ossim-install.sh', 'file_extension': '.sh', 'before_file': 'ADDFILE', 'message': 'Fixed multibranch setup od jenkinsfile and added scripts\n', 'author_name': 'Tyler Culp', 'lang': 'sh'}