moved awips2-edex-shapefiles RPM build to separate script, reduce time to run buildEDEX by 20 minutes

Former-commit-id: 38b0e2e9dd
This commit is contained in:
mjames-upc 2015-01-08 17:08:33 -07:00
parent 6f6472d8c7
commit e29a717f80
6 changed files with 170 additions and 1 deletions

View file

@ -155,7 +155,7 @@ cd ../
buildRPM "Installer.edex"
buildRPM "Installer.edex-configuration"
buildRPM "Installer.edex-shapefiles"
#buildRPM "Installer.edex-shapefiles"
# build the edex-datadelivery rpm
export COMPONENT_NAME="edex-datadelivery"
patchDDSpecification

View file

@ -0,0 +1,137 @@
#!/bin/bash
# This script will build the AWIPS II Edex RPMs.
# Build Variables:
# -----------------------------------------------------------------------------
VAR_AWIPSII_TOP_DIR="/home/bkowal/rpmbuild"
VAR_WORKSPACE="/common/bkowal/git/thunder/baseline"
VAR_AWIPSII_BUILD_ROOT="/tmp/awips-component"
VAR_AWIPSII_VERSION=""
VAR_AWIPSII_RELEASE=""
VAR_UFRAME_ECLIPSE="/awips2/eclipse"
VAR_AWIPSCM_SHARE="/awipscm"
# -----------------------------------------------------------------------------
if [ "${AWIPSII_TOP_DIR}" = "" ] &&
[ "${VAR_AWIPSII_TOP_DIR}" = "" ]; then
echo "ERROR: You Must Set the AWIPSII_TOP_DIR Environment Variable."
echo "Unable to Continue ... Terminating."
exit 1
fi
function prepareBuildEnvironment()
{
if [ "${AWIPSII_TOP_DIR}" = "" ]; then
export AWIPSII_TOP_DIR="${VAR_AWIPSII_TOP_DIR}"
fi
if [ "${WORKSPACE}" = "" ]; then
export WORKSPACE="${VAR_WORKSPACE}"
fi
if [ "${AWIPSII_BUILD_ROOT}" = "" ]; then
export AWIPSII_BUILD_ROOT="${VAR_AWIPSII_BUILD_ROOT}"
fi
if [ "${AWIPSII_VERSION}" = "" ]; then
# Determine if we need to use the default version.
if [ "${VAR_AWIPSII_VERSION}" = "" ]; then
VAR_AWIPSII_VERSION=`cat ${WORKSPACE}/rpms/version.txt`
fi
export AWIPSII_VERSION="${VAR_AWIPSII_VERSION}"
fi
if [ "${AWIPSII_RELEASE}" = "" ]; then
# Determine if we need to use the default release.
if [ "${VAR_AWIPSII_RELEASE}" = "" ]; then
VAR_AWIPSII_RELEASE=`date +"%Y%m%d"`
fi
export AWIPSII_RELEASE="${VAR_AWIPSII_RELEASE}"
fi
if [ "${UFRAME_ECLIPSE}" = "" ]; then
export UFRAME_ECLIPSE="${VAR_UFRAME_ECLIPSE}"
fi
if [ "${AWIPSCM_SHARE}" = "" ]; then
export AWIPSCM_SHARE="${VAR_AWIPSCM_SHARE}"
fi
}
function setTargetArchitecture()
{
# Set the target build architecture for the rpms based on the EDEX build
# architecture.
export TARGET_BUILD_ARCH="${EDEX_BUILD_ARCH}"
export EDEX_BUILD_BITS="64"
if [ "${EDEX_BUILD_ARCH}" = "x86" ]; then
export TARGET_BUILD_ARCH="i386"
export EDEX_BUILD_BITS="32"
fi
}
export TARGET_BUILD_ARCH=
# If the architecture has not been specified, default to 32-bit.
if [ "${EDEX_BUILD_ARCH}" = "" ]; then
export EDEX_BUILD_ARCH="x86"
echo "The Build Architecture was not specified ... defaulting to x86."
else
echo "Building for architecture ... ${EDEX_BUILD_ARCH}."
fi
function buildRPM()
{
# Arguments:
# ${1} == specs file
if [ ! "${COMPONENT_NAME}" = "edex-binlightning" ] ||
[ ${LIGHTNING} = true ]; then
rpmbuild -ba --target=${TARGET_BUILD_ARCH} \
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
--define '_baseline_workspace %(echo ${WORKSPACE})' \
--define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
--define '_awipscm_share %(echo ${AWIPSCM_SHARE})' \
--define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \
--define '_component_version %(echo ${AWIPSII_VERSION})' \
--define '_component_release %(echo ${AWIPSII_RELEASE})' \
--define '_component_name %(echo ${COMPONENT_NAME})' \
--define '_build_arch %(echo ${EDEX_BUILD_ARCH})' \
--define '_build_bits %(echo ${EDEX_BUILD_BITS})' \
--buildroot ${AWIPSII_BUILD_ROOT} \
${1}/component.spec
RC=$?
if [ ${RC} -ne 0 ]; then
echo "FATAL: rpmbuild failed."
exit 1
fi
fi
}
prepareBuildEnvironment
pushd .
cd ${WORKSPACE}/build.edex
if [ $? -ne 0 ]; then
exit 1
fi
if [ ${LIGHTNING} = true ]; then
/awips2/ant/bin/ant -f build.xml -Dlightning=true \
-Duframe.eclipse=${UFRAME_ECLIPSE}
RC=$?
else
/awips2/ant/bin/ant -f build.xml \
-Duframe.eclipse=${UFRAME_ECLIPSE}
RC=$?
fi
if [ ${RC} -ne 0 ]; then
exit 1
fi
popd
setTargetArchitecture
# Adjust Our Execution Position.
cd ../
buildRPM "Installer.edex-shapefiles"

View file

@ -121,6 +121,32 @@ function buildEDEX()
return 0
}
function buildShapefiles()
{
cd ${WORKSPACE}/rpms/awips2.shapefiles/deploy.builder
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the edex shapefile rpm."
return 1
fi
# Determine the build architecture.
export EDEX_BUILD_ARCH=`uname -i`
if [ "${EDEX_BUILD_ARCH}" = "i386" ]; then
export EDEX_BUILD_ARCH="x86"
fi
if [ $? -ne 0 ]; then
echo "ERROR: Failed to determine the architecture."
return 1
fi
/bin/bash build.sh
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build the edex shapefile rpm."
return 1
fi
return 0
}
function buildCAVEsingle()
{
cd ${WORKSPACE}/rpms/awips2.cave/deploy.builder

View file

@ -11,6 +11,7 @@ function usage()
echo " -ade build all rpms that are packaged in the ade."
echo " -viz only build the Viz rpms (CAVE & AlertViz)."
echo " -edex only build the EDEX rpms."
echo " -shp only build the EDEX shapefile rpm."
echo " -qpid build only the QPID rpms."
echo " -ldm build the awips2-ldm rpm; requires root privileges."
echo " -upc build the awips2-edex-upc rpm."

View file

@ -458,6 +458,11 @@ if [ "${1}" = "-viz" ]; then
exit 0
fi
if [ "${1}" = "-shp" ]; then
buildShapefiles
exit 0
fi
if [ "${1}" = "-edex" ]; then
##buildRPM "awips2-common-base"
buildRPM "awips2"