Merge "Omaha #4869 - externalize the management of CAVE versioning information." into omaha_16.2.1

Former-commit-id: f0c0cb171861f3d25be30bdc0c15cce6d4d2eab5
This commit is contained in:
Richard Peter 2015-09-16 16:15:46 -05:00 committed by Gerrit Code Review
commit 3509e3603d
6 changed files with 45 additions and 50 deletions

View file

@ -37,6 +37,7 @@
# Jun 17, 2015 #4148 rferrel Logback needs fewer environment variables. # Jun 17, 2015 #4148 rferrel Logback needs fewer environment variables.
# Jul 23, 2015 ASM#13849 D. Friedman Use a unique Eclipse configuration directory # Jul 23, 2015 ASM#13849 D. Friedman Use a unique Eclipse configuration directory
# Aug 03, 2015 #4694 dlovely Logback will now add user.home to LOGDIR # Aug 03, 2015 #4694 dlovely Logback will now add user.home to LOGDIR
# Sep 16, 2015 #4869 bkowal Read dynamic CAVE version information at startup.
# #
@ -117,6 +118,16 @@ else
echo "getTestMode() not found - going to use defaults" echo "getTestMode() not found - going to use defaults"
fi fi
VERSION_ARGS=()
if [ -f ${CAVE_INSTALL}/awipsVersion.txt ]; then
prevIFS=${IFS}
IFS=$'\n'
for line in `cat ${CAVE_INSTALL}/awipsVersion.txt`; do
VERSION_ARGS+=(${line})
done
IFS=${prevIFS}
fi
export TEXTWS=`hostname | sed -e 's/lx/xt/g'` export TEXTWS=`hostname | sed -e 's/lx/xt/g'`
hostName=`hostname -s` hostName=`hostname -s`
@ -252,14 +263,14 @@ createEclipseConfigurationDir
fi fi
echo "Launching cave application using the following command: " >> ${LOGFILE_STARTUP_SHUTDOWN} echo "Launching cave application using the following command: " >> ${LOGFILE_STARTUP_SHUTDOWN}
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES[@]} ${USER_ARGS[@]}" >> ${LOGFILE_STARTUP_SHUTDOWN} echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES[@]} ${USER_ARGS[@]} ${VERSION_ARGS[@]}" >> ${LOGFILE_STARTUP_SHUTDOWN}
if [[ "${redirect}" == "true" ]] ; then if [[ "${redirect}" == "true" ]] ; then
# send output to /dev/null because the logback CaveConsoleAppender will capture that output # send output to /dev/null because the logback CaveConsoleAppender will capture that output
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} "${SWITCHES[@]}" "${USER_ARGS[@]}" >> /dev/null 2>&1 exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} "${SWITCHES[@]}" "${USER_ARGS[@]}" "${VERSION_ARGS[@]}" >> /dev/null 2>&1
else else
# allow output to print to the console/terminal that launched CAVE # allow output to print to the console/terminal that launched CAVE
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} "${SWITCHES[@]}" "${USER_ARGS[@]}" 2>&1 exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} "${SWITCHES[@]}" "${USER_ARGS[@]}" "${VERSION_ARGS[@]}" 2>&1
fi fi
) & ) &

View file

@ -0,0 +1,4 @@
0=$vizVersion$
1=$buildDate$
2=$buildTime$
3=$buildSystem$

View file

@ -5,4 +5,5 @@ bin.includes = plugin.xml,\
.,\ .,\
icons/,\ icons/,\
plugin_customization.ini,\ plugin_customization.ini,\
plugin.properties plugin.properties,\
about.mappings

View file

@ -35,7 +35,8 @@
-XX:G1MixedGCCountTarget=16 -XX:G1MixedGCCountTarget=16
-XX:G1MixedGCLiveThresholdPercent=25 -XX:G1MixedGCLiveThresholdPercent=25
-XX:G1OldCSetRegionThresholdPercent=25 -XX:G1OldCSetRegionThresholdPercent=25
-XX:G1HeapWastePercent=5</vmArgs> -XX:G1HeapWastePercent=5
-DvizVersion=DEVELOPMENT</vmArgs>
<vmArgsWin>-Dfile.encoding=UTF-8</vmArgsWin> <vmArgsWin>-Dfile.encoding=UTF-8</vmArgsWin>
</launcherArgs> </launcherArgs>

View file

@ -1,5 +1,8 @@
caveAboutText=Common AWIPS Visualization Environment (CAVE)\n\ caveAboutText=Common AWIPS Visualization Environment (CAVE)\n\
\n\ \n\
Developed on the Raytheon Visualization Environment (viz)\n\ Developed on the Raytheon Visualization Environment (viz)\n\
\t~ DEVELOPMENT ~ \tBUILD VERSION: {0}\n\
\tBUILD DATE: {1}\n\
\tBUILD TIME: {2}\n\
\tBUILD SYSTEM: {3}
caveVersion=DEVELOPMENT caveVersion=DEVELOPMENT

View file

@ -24,7 +24,6 @@ URL: N/A
License: N/A License: N/A
Distribution: N/A Distribution: N/A
Vendor: Raytheon Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no AutoReq: no
provides: %{_component_name} provides: %{_component_name}
@ -58,28 +57,6 @@ CONST_BANNER_LENGTH=47
AWIPS_PRODUCT_JAR= AWIPS_PRODUCT_JAR=
EDEX_BANNER_TXT= EDEX_BANNER_TXT=
# This function exists for upgrading from
# 11.6.X builds.
function updateCAVEVersionLegacy()
{
local TMP_PRODUCTS_DIR="/awips2/${AWIPS_PRODUCT}/.tmp/products"
cd ${TMP_PRODUCTS_DIR}
# update plugin.xml
sed '/aboutText/{n;s/\".*\"/\"%caveAboutText\"/;}' \
-i plugin.xml
# update the manifest.
touch manifestUpdate
echo "Bundle-Localization: plugin" > manifestUpdate
# merge the updated plugin.xml and manifest into the jar.
/awips2/java/bin/jar umf manifestUpdate ${AWIPS_PRODUCT_JAR}
/awips2/java/bin/jar uf ${AWIPS_PRODUCT_JAR} plugin.xml
rm -f manifestUpdate
}
function padEdexBannerLine() function padEdexBannerLine()
{ {
local _output="${1}" local _output="${1}"
@ -100,7 +77,7 @@ function padEdexBannerLine()
return 0 return 0
} }
function updateVersion() function updateAlertVizVersion()
{ {
local TMP_PRODUCTS_DIR="/awips2/${AWIPS_PRODUCT}/.tmp/products" local TMP_PRODUCTS_DIR="/awips2/${AWIPS_PRODUCT}/.tmp/products"
@ -118,11 +95,7 @@ function updateVersion()
# Update the version information. # Update the version information.
cd ${TMP_PRODUCTS_DIR} cd ${TMP_PRODUCTS_DIR}
unzip -qq ${AWIPS_PRODUCT_JAR} unzip -qq ${AWIPS_PRODUCT_JAR}
if [ ! -f plugin.properties ]; then rm -f plugin.properties
updateCAVEVersionLegacy
else
rm -f plugin.properties
fi
ARCH="x86" ARCH="x86"
# Determine the architecture. # Determine the architecture.
@ -178,30 +151,32 @@ function updateEDEXVersion()
>> ${EDEX_BANNER_TXT} >> ${EDEX_BANNER_TXT}
} }
AWIPS_PRODUCT_WILDCARD="/awips2/cave/plugins/com.raytheon.viz.product.awips_*.jar" function updateCaveVersion() {
# Get the actual name of the product jar. # Note: the system properties echoed to the versions script are based on
if [ -d /awips2/cave/plugins ]; then # about.mappings in the com.raytheon.viz.product.awips plugin.
AWIPS_PRODUCT_JAR=`ls -1 ${AWIPS_PRODUCT_WILDCARD}` AWIPS_VERSION_TXT=/awips2/cave/awipsVersion.txt
RC=$?
if [ ${RC} -eq 0 ]; then echo "--launcher.appendVmargs" > ${AWIPS_VERSION_TXT}
# does the jar exist? echo "-vmargs" >> ${AWIPS_VERSION_TXT}
if [ -f ${AWIPS_PRODUCT_JAR} ]; then echo "-DvizVersion=%{_component_version}-%{_component_release}" >> ${AWIPS_VERSION_TXT}
AWIPS_PRODUCT="cave" echo "-DbuildDate=%{_component_build_date}" >> ${AWIPS_VERSION_TXT}
updateVersion echo "-DbuildTime=%{_component_build_time}" >> ${AWIPS_VERSION_TXT}
fi echo "-DbuildSystem=%{_component_build_system}" >> ${AWIPS_VERSION_TXT}
fi }
if [ -d /awips2/cave ]; then
updateCaveVersion
fi fi
AWIPS_PRODUCT_WILDCARD="/awips2/alertviz/plugins/com.raytheon.uf.viz.product.alertviz_*.jar" AWIPS_PRODUCT_WILDCARD="/awips2/alertviz/plugins/com.raytheon.uf.viz.product.alertviz_*.jar"
# Get the actual name of the product jar. # Get the actual name of the product jar.
if [ -d /awips2/alertviz/plugins ]; then if [ -d /awips2/alertviz/plugins ]; then
AWIPS_PRODUCT_JAR=`ls -1 ${AWIPS_PRODUCT_WILDCARD}` AWIPS_PRODUCT_JAR=`ls -1 ${AWIPS_PRODUCT_WILDCARD}`
RC=$? if [ $? -eq 0 ]; then
if [ ${RC} -eq 0 ]; then
# does the jar exist? # does the jar exist?
if [ -f ${AWIPS_PRODUCT_JAR} ]; then if [ -f ${AWIPS_PRODUCT_JAR} ]; then
AWIPS_PRODUCT="alertviz" AWIPS_PRODUCT="alertviz"
updateVersion updateAlertVizVersion
fi fi
fi fi
fi fi