Issue #18 - merging wes2bridge rpm changes into the git wes2bridge branch.

Former-commit-id: 9df496bfe5fea08e8c2c11e5fadcc0d09bad125d
This commit is contained in:
Bryan Kowal 2012-01-23 14:39:39 -06:00
parent ea1c82452b
commit bda5954b3c
23 changed files with 896 additions and 60 deletions

View file

@ -55,16 +55,6 @@ rm -rf ${RPM_BUILD_ROOT}/awips2/awipsShare
if [ "${1}" = "2" ]; then
exit 0
fi
# Need To Ensure That We Are Lined Up With The Current Edex (Base) Installation.
EDEX_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-edex-base`
if [ ! "${RPM_INSTALL_PREFIX}" = "${EDEX_INSTALL}" ]; then
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;31m\| ERROR: This Extension MUST Be Installed At The Same Location As EDEX!!!"
echo -e "\e[1;34m\| INFO: Use '--prefix=${EDEX_INSTALL}'.\e[m"
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
exit 1
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing the AWIPS II Adapt Native Libraries...\e[m"

View file

@ -5,7 +5,7 @@
Name: awips2-postgresql
Summary: AWIPS II PostgreSQL Distribution
Version: 8.3.4
Release: 3
Release: 4
Group: AWIPSII
BuildRoot: /tmp
Prefix: /awips2

View file

@ -24,28 +24,11 @@ prog="postmaster"
# We will no longer be using hard-coded paths that need to be replaced.
# Use rpm to find the paths that we need.
JAVA_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-java`
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "ERROR: awips2-java Must Be Installed."
echo "Unable To Continue ... Terminating."
exit 1
fi
PYTHON_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-python`
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "ERROR: awips2-python Must Be Installed."
echo "Unable To Continue ... Terminating."
exit 1
fi
PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "ERROR: awips2-psql Must Be Installed."
echo "Unable To Continue ... Terminating."
exit
fi
POSTGRESQL_INSTALL_ROOT=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-postgresql`
JAVA_INSTALL="/awips2/java"
PYTHON_INSTALL="/awips2/python"
PSQL_INSTALL="/awips2/psql"
POSTGRESQL_INSTALL_ROOT="/awips2"
POSTGRESQL_INSTALL="${POSTGRESQL_INSTALL_ROOT}/postgresql"
PGDATA_DIR="${POSTGRESQL_INSTALL_ROOT}/data"

View file

@ -3,7 +3,7 @@
## EDIT FROM HERE
# Use rpm to find installation locations / directory paths.
POSTGRESQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-postgresql`
POSTGRESQL_INSTALL="/awips2"
# Installation prefix
prefix="${POSTGRESQL_INSTALL}/postgresql"
@ -22,9 +22,9 @@ USER=`whoami`
## STOP EDITING HERE
# The path that is to be used for the script
PATH=${POSTGRESQL_INSTALL}/postgresql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH=${prefix}/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export LD_LIBRARY_PATH=${POSTGRESQL_INSTALL}/postgresql/lib
export LD_LIBRARY_PATH=${prefix}/lib
# What to use to start up the postmaster (we do NOT use pg_ctl for this,
# as it adds no value and can cause the postmaster to misrecognize a stale

View file

@ -61,20 +61,6 @@ cp -r ${MHS_LIB_DIR}/* \
${RPM_BUILD_ROOT}/awips2/edex/lib/native/linux32/awips1
%pre
if [ "${1}" = "1" ]; then
# This Is An Installation - Not An Upgrade.
# Ensure That We Are Being Installed To The Correct Location.
EDEX_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-edex-base`
if [ ! "${RPM_INSTALL_PREFIX}" = "${EDEX_INSTALL}" ]; then
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;31m\| ERROR: These Libraries MUST Be Installed At The Same Location As EDEX!!!"
echo -e "\e[1;34m\| INFO: Use '--prefix=${EDEX_INSTALL}'.\e[m"
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
exit 1
fi
fi
if [ "${1}" = "2" ]; then
exit 0
fi

View file

@ -2,5 +2,5 @@
QPID_INST_PATH=/awips2/qpid
# this should be done already, but just in case
export LD_LIBRARY_PATH=${QPID_INST_PATH}/lib
${QPID_INST_PATH}/sbin/qpidd --config /awips2/qpid/etc/qpidd.conf --no-module-dir
${QPID_INST_PATH}/sbin/qpidd --config ${QPID_INST_PATH}/etc/qpidd.conf --no-module-dir

View file

@ -74,7 +74,7 @@ start() {
touch $pidfile
chown awips:fxalpha $pidfile
[ -x /sbin/restorecon ] && /sbin/restorecon $pidfile
runuser - -s /bin/sh awips -c "$QPID_HOME/sbin/$prog --check > $pidfile"
runuser - -s /bin/sh awips -c "$QPID_HOME/sbin/$prog --check --config $QPID_HOME/etc/qpidd.conf > $pidfile"
echo "Creating durable queues"
$queueCreatorScript

View file

@ -2,13 +2,14 @@
export PATH=/awips2/python/bin:$PATH
export LD_LIBRARY_PATH=/awips2/python/lib:$LD_LIBRARY_PATH
port=5672
#define 96 Meg persistence queues
QUEUES=('external.dropbox' 'Ingest.Text')
for queue in ${QUEUES[*]};
do
echo "Creating queue $queue"
qpid-config add queue $queue --durable --file-count 32 --file-size 48
qpid-config --broker-addr localhost:$port add queue $queue --durable --file-count 32 --file-size 48
done
#define 48 Meg persistence queues
@ -16,7 +17,7 @@ QUEUES=('Ingest.Grib' 'Ingest.Radar' 'watchwarn' 'cpgsrvFiltering' 'Ingest.model
for queue in ${QUEUES[*]};
do
echo "Creating queue $queue"
qpid-config add queue $queue --durable --file-count 32 --file-size 24
qpid-config --broker-addr localhost:$port add queue $queue --durable --file-count 32 --file-size 24
done
#define 24 Meg Dat queues
@ -24,7 +25,7 @@ QUEUES=('ffmp' 'cwat' 'vil' 'qpf' 'preciprate' 'fssobs' 'fog')
for queue in ${QUEUES[*]};
do
echo "Creating queue ${queue}Generate"
qpid-config add queue ${queue}Generate --durable --file-count 16 --file-size 24
qpid-config --broker-addr localhost:$port add queue ${queue}Generate --durable --file-count 16 --file-size 24
done
#define 24 Meg persistence queues
@ -32,7 +33,7 @@ QUEUES=('activeTablePending' 'gfeSvcBackupOp' 'gfeIscQueue' 'edex.tpcWatch' 'ede
for queue in ${QUEUES[*]};
do
echo "Creating queue $queue"
qpid-config add queue $queue --durable --file-count 16 --file-size 24
qpid-config --broker-addr localhost:$port add queue $queue --durable --file-count 16 --file-size 24
done
#define 24 Meg persistence queues for ingest
@ -40,7 +41,7 @@ QUEUES=('vaa' 'textlightning' 'tcs' 'tcg' 'taf' 'svrwx' 'sfcobs' 'redbook' 'recc
for queue in ${QUEUES[*]};
do
echo "Creating queue Ingest.$queue"
qpid-config add queue Ingest.$queue --durable --file-count 16 --file-size 24
qpid-config --broker-addr localhost:$port add queue Ingest.$queue --durable --file-count 16 --file-size 24
done

View file

@ -91,7 +91,7 @@
Name: %{name}
Version: %{qpid_release}.%{qpid_svnrev}
Release: 32%{?dist}
Release: 33%{?dist}
Summary: Libraries for Qpid C++ client applications
Group: AWIPSII
License: ASL 2.0

View file

@ -0,0 +1,250 @@
%define _installation_directory "/awips2"
#
# awips2-wes2bridge-edex
#
Name: awips2-wes2bridge-edex
Summary: awips2-wes2bridge-edex
Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: %{_build_root}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-wes2bridge-edex
provides: awips2-edex-base
provides: awips2-base-component
provides: awips2-edex-gfe
requires: awips2-postgresql
requires: awips2-qpid-server-store
requires: awips2-qpid-client
requires: awips2-qpid-server
requires: awips2-python
requires: awips2-java
requires: awips2-psql
conflicts: awips2-edex-satellite
conflicts: awips2-edex-cots
conflicts: awips2-edex-radar
conflicts: awips2-edex-dataplugins
conflicts: awips2-edex-text
conflicts: awips2-edex-bufr
conflicts: awips2-edex-npp
conflicts: awips2-edex-grib
conflicts: awips2-edex-dat
conflicts: awips2-edex-common-core
conflicts: awips2-edex-configuration
conflicts: awips2-edex-hydro
conflicts: awips2-edex-ncep
conflicts: awips2-edex-core
%description
The wes2bridge version of awips2-edex consists of the edex runtime and
the AWIPS II wes2bridge manager. The wes2bridge manager exists to spawn
and configure additional instances of the wes2bridge triad {postgresql,
qpid, edex}. The wes2bridge version of awips2-edex is not designed to
be run in the same way that the standard awips2-edex is.
# Disable byte-compiling of python and repacking of jar files.
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
%prep
# Verify that a build root has been specified.
if [ "%{build_root}" = "" ]; then
echo "ERROR: A 'BuildRoot' has not been specified."
exit 1
fi
rm -rf %{_build_root}
if [ $? -ne 0 ]; then
exit 1
fi
# Verify that the required scripts exist.
# build.sh
if [ ! -f %{_baseline_workspace}/build.edex/build.sh ]; then
echo "ERROR: Unable to locate the edex pde build script."
exit 1
fi
# deploy-install.sh
if [ ! -f %{_baseline_workspace}/build.edex/deploy-install.xml ]; then
echo "ERROR: Unable to locate the edex deploy-install script."
exit 1
fi
# ensure that ant is in the path.
which ant > /dev/null 2>&1
if [ $? -ne 0 ]; then
which ant
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/edex
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/wes2bridge/scripts
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/wes2bridge/macro/utilities
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/wes2bridge/macro/functions
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# create the edex environment directory.
mkdir -p %{_build_root}/usr/local/wes2bridge
%build
pushd . > /dev/null 2>&1
# Run the pde build.
cd %{_baseline_workspace}/build.edex
/bin/bash build.sh -eclipse=%{_uframe_eclipse}
if [ $? -ne 0 ]; then
echo "ERROR: The pde build of edex has failed."
exit 1
fi
popd > /dev/null 2>&1
%install
# Run the deployment to the specified:
# %{_build_root}%{_installation_directory}/edex
pushd . > /dev/null 2>&1
cd %{_baseline_workspace}/build.edex
ant -f deploy-install.xml \
-Dinstall.dir=%{_build_root}%{_installation_directory}/edex \
-Dinstaller=true
if [ $? -ne 0 ]; then
echo "ERROR: the deploy-install of edex has failed."
exit 1
fi
popd > /dev/null 2>&1
RPM_PROJECT="%{_baseline_workspace}/Installer.rpm"
POSTGRES_INITD="${RPM_PROJECT}/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres"
QPID_INITD="${RPM_PROJECT}/awips2.qpid/SOURCES/qpidd"
QUEUE_SH="${RPM_PROJECT}/awips2.qpid/SOURCES/queueCreator.sh"
EDEX_INITD="${RPM_PROJECT}/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel"
# Copy the startup scripts.
cp ${POSTGRES_INITD} \
%{_build_root}%{_installation_directory}/wes2bridge/scripts
if [ $? -ne 0 ]; then
exit 1
fi
cp ${QPID_INITD} \
%{_build_root}%{_installation_directory}/wes2bridge/scripts
if [ $? -ne 0 ]; then
exit 1
fi
cp ${QUEUE_SH} \
%{_build_root}%{_installation_directory}/wes2bridge/scripts
if [ $? -ne 0 ]; then
exit 1
fi
cp ${EDEX_INITD} \
%{_build_root}%{_installation_directory}/wes2bridge/scripts
if [ $? -ne 0 ]; then
exit 1
fi
# Copy the wes2bridge macro, functions, and utilities.
DELIVERABLES="%{_baseline_workspace}/Installer.rpm/awips2.wes2bridge/wes2bridge.files/deliverables"
# Utilities
cp ${DELIVERABLES}/utility/*.jar \
%{_build_root}%{_installation_directory}/wes2bridge/macro/utilities
if [ $? -ne 0 ]; then
exit 1
fi
# Macro and functions.
cp ${DELIVERABLES}/scripts/wes2bridge \
%{_build_root}%{_installation_directory}/wes2bridge/macro
if [ $? -ne 0 ]; then
exit 1
fi
cp ${DELIVERABLES}/scripts/functions/*.sh \
%{_build_root}%{_installation_directory}/wes2bridge/macro/functions
if [ $? -ne 0 ]; then
exit 1
fi
# The profile.d script.
cp ${DELIVERABLES}/profile.d/* \
%{_build_root}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# Temporary? Remove the edex management plugin.
JAR_FILE="com.raytheon.uf.edex.management.jar"
if [ -f %{_build_root}%{_installation_directory}/edex/lib/plugins/${JAR_FILE} ]; then
rm -f %{_build_root}%{_installation_directory}/edex/lib/plugins/${JAR_FILE}
if [ $? -ne 0 ]; then
exit 1
fi
fi
%pre
%post
%preun
%postun
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/edex
%dir /awips2/edex/conf
/awips2/edex/conf/*
%dir /awips2/edex/data
/awips2/edex/data/*
%dir /awips2/edex/etc
/awips2/edex/etc/*
%dir /awips2/edex/lib
/awips2/edex/lib/*
%dir /awips2/edex/logs
%dir /awips2/edex/webapps
/awips2/edex/webapps/*
%dir /awips2/edex/bin/linux-x86-32
/awips2/edex/bin/linux-x86-32/*.so
/awips2/edex/bin/linux-x86-32/*.conf
/awips2/edex/bin/setup.env
%dir /usr/local/wes2bridge
%defattr(755,awips,fxalpha,755)
%dir /awips2/edex/bin
/awips2/edex/bin/*.sh
/awips2/edex/bin/linux-x86-32/wrapper
/awips2/edex/bin/wrapper.jar
%defattr(644,root,root,755)
%dir /awips2/wes2bridge
%dir /awips2/wes2bridge/scripts
/awips2/wes2bridge/scripts/*
%dir /awips2/wes2bridge/macro
%dir /awips2/wes2bridge/macro/utilities
/awips2/wes2bridge/macro/utilities/*
%dir /awips2/wes2bridge/macro/functions
/awips2/wes2bridge/macro/functions/*
/etc/profile.d/awips2-wes2bridge-env.sh
/etc/profile.d/awips2-wes2bridge-env.csh
%defattr(700,root,root,755)
/awips2/wes2bridge/macro/wes2bridge

View file

@ -0,0 +1,46 @@
#!/bin/bash
# User variables for local builds:
export U_RPM_DESTINATION="/home/bkowal/rpmbuild"
export U_COMPONENT_VERSION="11.9.0"
export U_COMPONENT_RELEASE="1"
export U_BUILD_ROOT="/tmp/${USER}/awips2-build"
export U_UFRAME_ECLIPSE="/opt/uframe-eclipse"
export U_BASELINE_WORKSPACE="/common/bkowal/workspace"
# build variables
if [ "${RPM_DESTINATION}" = "" ]; then
export RPM_DESTINATION="${U_RPM_DESTINATION}"
fi
if [ "${COMPONENT_VERSION}" = "" ]; then
export COMPONENT_VERSION="${U_COMPONENT_VERSION}"
fi
if [ "${COMPONENT_RELEASE}" = "" ]; then
export COMPONENT_RELEASE="${U_COMPONENT_RELEASE}"
fi
if [ "${BUILD_ROOT}" = "" ]; then
export BUILD_ROOT="${U_BUILD_ROOT}"
fi
if [ "${UFRAME_ECLIPSE}" = "" ]; then
export UFRAME_ECLIPSE="/opt/uframe-eclipse"
fi
if [ "${BASELINE_WORKSPACE}" = "" ]; then
export BASELINE_WORKSPACE="${U_BASELINE_WORKSPACE}"
fi
WES2BRIDGE="${BASELINE_WORKSPACE}/Installer.rpm/awips2.wes2bridge"
/usr/bin/rpmbuild -ba --target=i386 \
--define '_topdir %(echo ${RPM_DESTINATION})' \
--define '_component_version %(echo ${COMPONENT_VERSION})' \
--define '_component_release %(echo ${COMPONENT_RELEASE})' \
--define '_build_root %(echo ${BUILD_ROOT})' \
--define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
--define '_baseline_workspace %(echo ${BASELINE_WORKSPACE})' \
--buildroot ${BUILD_ROOT} \
${WES2BRIDGE}/edex/component.spec
if [ $? -ne 0 ]; then
exit 1
fi
exit 0

View file

@ -0,0 +1,9 @@
#!/bin/csh
set WES2BRIDGE_PATH="/awips2/wes2bridge/macro"
if $?PATH then
setenv PATH ${WES2BRIDGE_PATH}:$PATH
else
setenv PATH ${WES2BRIDGE_PATH}
endif

View file

@ -0,0 +1,10 @@
#!/bin/bash
WES2BRIDGE_PATH="/awips2/wes2bridge/macro"
CHECK_PATH=`echo ${PATH} | grep ${WES2BRIDGE_PATH}`
if [ ! "${CHECK_PATH}" = "" ]; then
return
fi
export PATH=${WES2BRIDGE_PATH}:${PATH}

View file

@ -0,0 +1,128 @@
#!/bin/bash
function createEnvironment()
{
# Arguments:
# ${1} configuration file.
config_file="${1}"
# Determine the name of the environment.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
# Ensure that an environment does not already exist.
if [ -d ${WES2BRIDGE_DIR}/${env_name} ]; then
echo "ERROR: An edex environment with name = ${env_name} already exists."
return 1
fi
# An environment does not exist. Create it.
# 1) Create the root directory.
mkdir -p ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Failed to create the ${env_name} environment root directory."
return 1
fi
# 2) Create the environment by copying components in /awips2.
# /awips2/edex
cp -r /awips2/edex ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place edex in the ${env_name} environment."
return 1
fi
# /awips2/GFESuite
cp -r /awips2/GFESuite ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place GFESuite in the ${env_name} environment."
return 1
fi
# /awips2/database
cp -r /awips2/database ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place the database in the ${env_name} environment."
return 1
fi
# /awips2/data
cp -r /awips2/data ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place the database in the ${env_name} environment."
return 1
fi
# /awips2/postgresql
cp -r /awips2/postgresql ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place postgresql in the ${env_name} environment."
return 1
fi
# /awips2/qpid
cp -r /awips2/qpid ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place qpid in the ${env_name} environment."
return 1
fi
# 3) Update the links in: data/pg_tblspc
pushd . > /dev/null 2>&1
cd ${WES2BRIDGE_DIR}/${env_name}/data/pg_tblspc
for link in `ls -1`; do
linked_dir=`readlink ${link}`
if [ $? -ne 0 ]; then
return 1
fi
data_dir=`/awips2/java/bin/java -jar ${UTILITIES}/DataLinkUtility.jar "${linked_dir}"`
if [ $? -ne 0 ]; then
return 1
fi
# Remove the existing link.
rm -f ${link}
if [ $? -ne 0 ]; then
return 1
fi
# Create a new link to the correct location.
ln -sf ${WES2BRIDGE_DIR}/${env_name}/data/${data_dir} ${link}
if [ $? -ne 0 ]; then
return 1
fi
done
popd > /dev/null 2>&1
# 4) Create a directory for the environment-specific start (init.d) scripts.
mkdir -p ${WES2BRIDGE_DIR}/${env_name}/wes2bridge
if [ $? -ne 0 ]; then
exit 1
fi
# 5) Re-configure: Edex, QPID, and PostgreSQL
/awips2/java/bin/java -jar ${UTILITIES}/Wes2BridgeManager.jar "${config_file}"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to configure the ${env_name} environment."
return 1
fi
# 6) Adjust permissions.
chown -R awips:fxalpha ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
return 1
fi
chmod -R 775 ${WES2BRIDGE_DIR}/${env_name}/edex/data
if [ $? -ne 0 ]; then
return 1
fi
# 7) Lockdown the startup scripts.
chown root:root ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/*
if [ $? -ne 0 ]; then
return 1
fi
chmod 644 ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/*
if [ $? -ne 0 ]; then
return 1
fi
# FINISHED.
return 0
}

View file

@ -0,0 +1,12 @@
#!/bin/bash
function listEnvironments()
{
pushd . > /dev/null 2>&1
cd ${WES2BRIDGE_DIR}
echo "Existing EDEX Environment(s):"
for env_dir in `ls -1`; do
echo " -${env_dir}"
done
popd > /dev/null 2>&1
}

View file

@ -0,0 +1,48 @@
#!/bin/bash
function removeEnvironment()
{
# Arguments:
# ${1} configuration file.
# ${2} name.
config_file="${1}"
env_name="${2}"
if [ ! "${config_file}" = "" ]; then
# Get the name from the configuration file.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
fi
removeEnvironmentInternal "${env_name}"
if [ $? -ne 0 ]; then
return 1
fi
return 0
}
# private
function removeEnvironmentInternal()
{
# Arguments:
# ${1} name.
env_name="${1}"
# Ensure that the environment exists.
if [ ! -d ${WES2BRIDGE_DIR}/${env_name} ]; then
echo "ERROR: The ${env_name} environment does not exist yet."
return 1
fi
# Remove the environment.
rm -rf ${WES2BRIDGE_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to remove the ${env_name} environment."
return 1
fi
return 0
}

View file

@ -0,0 +1,71 @@
#!/bin/bash
function startEnvironment()
{
# Arguments:
# ${1} configuration file.
# ${2} name.
config_file="${1}"
env_name="${2}"
if [ ! "${config_file}" = "" ]; then
# Get the name from the configuration file.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
fi
startEnvironmentInternal "${env_name}"
if [ $? -ne 0 ]; then
return 1
fi
return 0
}
# private
function startEnvironmentInternal()
{
# Arguments:
# ${1} name.
env_name="${1}"
# Ensure that the environment exists.
if [ ! -d ${WES2BRIDGE_DIR}/${env_name} ]; then
echo "ERROR: The ${env_name} environment does not exist yet."
return 1
fi
# Verify that the environment is not missing any startup scripts.
if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_camel ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_postgres ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/qpidd ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
# Start the environment.
pushd . > /dev/null 2>&1
cd ${WES2BRIDGE_DIR}/${env_name}/wes2bridge
# Start PostgreSQL.
/bin/bash edex_postgres start
echo
sleep 10
# Start QPID.
/bin/bash qpidd start
echo
sleep 10
# Start EDEX (replace with wes mode when available).
/bin/bash edex_camel start
echo
popd > /dev/null 2>&1
return 0
}

View file

@ -0,0 +1,71 @@
#!/bin/bash
function stopEnvironment()
{
# Arguments:
# ${1} configuration file.
# ${2} name.
config_file="${1}"
env_name="${2}"
if [ ! "${config_file}" = "" ]; then
# Get the name from the configuration file.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
fi
stopEnvironmentInternal "${env_name}"
if [ $? -ne 0 ]; then
return 1
fi
return 0
}
# private
function stopEnvironmentInternal()
{
# Arguments:
# ${1} name.
env_name="${1}"
# Ensure that the environment exists.
if [ ! -d ${WES2BRIDGE_DIR}/${env_name} ]; then
echo "ERROR: The ${env_name} environment does not exist yet."
return 1
fi
# Verify that the environment is not missing any startup scripts.
if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_camel ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/edex_postgres ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${WES2BRIDGE_DIR}/${env_name}/wes2bridge/qpidd ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
# Stop the environment.
pushd . > /dev/null 2>&1
cd ${WES2BRIDGE_DIR}/${env_name}/wes2bridge
# Stop EDEX.
/bin/bash edex_camel stop
echo
sleep 10
# Stop QPID.
/bin/bash qpidd stop
echo
sleep 10
# Stop PostgreSQL.
/bin/bash edex_postgres stop
echo
popd > /dev/null 2>&1
return 0
}

View file

@ -0,0 +1,174 @@
#!/bin/bash
# wes2bridge environment
dir="/awips2/wes2bridge/macro"
export WES2BRIDGE_DIR="/usr/local/wes2bridge"
export UTILITIES="${dir}/utilities"
# access functions
pushd . > /dev/null 2>&1
cd ${dir}/functions
for func in `ls -1`; do
source ${dir}/functions/${func}
done
popd > /dev/null 2>&1
function usage()
{
echo "Usage: wes2bridge -create \${CONFIG_FILE} [--start]"
echo " wes2bridge -start { \${CONFIG_FILE} | -name \${NAME} }"
echo " wes2bridge -stop { \${CONFIG_FILE} | -name \${NAME} }"
echo " wes2bridge -remove { \${CONFIG_FILE} | -name \${NAME} }"
echo " wes2bridge --list"
}
function parseCreate()
{
# The second argument should be a configuration file.
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
createEnvironment "${config_file}"
if [ $? -ne 0 ]; then
exit 1
fi
# The third argument may be "--start"
if [ "${3}" = "--start" ]; then
startEnvironment "${config_file}" ""
if [ $? -ne 0 ]; then
exit 1
fi
fi
exit 0
}
function parseStart()
{
local config_file=""
local env_name=""
# The second argument could be "-name"; if not, it is a config file.
# If the second argument is "-name", the third argument is the 'name'.
if [ "${2}" = "-name" ]; then
if [ "${3}" = "" ]; then
usage
exit 0
fi
env_name="${3}"
else
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
fi
startEnvironment "${config_file}" "${env_name}"
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
}
function parseStop()
{
local config_file=""
local env_name=""
# The second argument could be "-name"; if not, it is a config file.
# If the second argument is "-name", the third argument is the 'name'.
if [ "${2}" = "-name" ]; then
if [ "${3}" = "" ]; then
usage
exit 0
fi
env_name="${3}"
else
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
fi
stopEnvironment "${config_file}" "${env_name}"
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
}
function parseRemove()
{
local config_file=""
local env_name=""
# The second argument could be "-name"; if not, it is a config file.
# If the second argument is "-name", the third argument is the 'name'.
if [ "${2}" = "-name" ]; then
if [ "${3}" = "" ]; then
usage
exit 0
fi
env_name="${3}"
else
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
fi
removeEnvironment "${config_file}" "${env_name}"
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
}
if [ $# -eq 0 ]; then
usage
exit 0
fi
# The first argument should be one of: {-create, -start, -stop, -remove, --list}
if [ "${1}" = "-create" ]; then
parseCreate $*
fi
if [ "${1}" = "-start" ]; then
parseStart $*
fi
if [ "${1}" = "-stop" ]; then
parseStop $*
fi
if [ "${1}" = "-remove" ]; then
parseRemove $*
fi
if [ "${1}" = "--list" ]; then
listEnvironments
exit 0
fi
# default case:
usage
exit 0

View file

@ -31,7 +31,6 @@
<packagereq type="default">awips2-edex-text</packagereq>
<packagereq type="default">awips2-edex-shapefiles</packagereq>
<packagereq type="default">awips2-edex-configuration</packagereq>
<packagereq type="default">awips2-edex-ncep-nsharp</packagereq>
<packagereq type="default">awips2-edex-npp</packagereq>
<packagereq type="default">awips2-edex-ncep</packagereq>
<packagereq type="default">awips2-gfesuite-server</packagereq>
@ -76,6 +75,65 @@
<packagereq type="default">awips2-localapps-environment</packagereq>
</packagelist>
</group>
<group>
<id>awips2-wes2bridge</id>
<name>AWIPS II Wes2Bridge</name>
<default>true</default>
<description>This Will Install All Of The AWIPS II Components That Are Required For The Wes2Bridge Environment.</description>
<uservisible>true</uservisible>
<packagelist>
<packagereq type="default">awips2</packagereq>
<packagereq type="default">awips2-cli</packagereq>
<packagereq type="default">awips2-database</packagereq>
<packagereq type="default">awips2-maps-database</packagereq>
<packagereq type="default">awips2-database-standalone-configuration</packagereq>
<packagereq type="default">awips2-wes2bridge-edex</packagereq>
<packagereq type="default">awips2-edex-native</packagereq>
<packagereq type="default">awips2-edex-shapefiles</packagereq>
<packagereq type="default">awips2-gfesuite-server</packagereq>
<packagereq type="default">awips2-httpd-pypies</packagereq>
<packagereq type="default">awips2-adapt-native</packagereq>
<packagereq type="default">awips2-hydroapps-shared</packagereq>
<packagereq type="default">awips2-java</packagereq>
<packagereq type="default">awips2-notification</packagereq>
<packagereq type="default">awips2-postgresql</packagereq>
<packagereq type="default">awips2-psql</packagereq>
<packagereq type="default">awips2-pypies</packagereq>
<packagereq type="default">awips2-python</packagereq>
<packagereq type="default">awips2-qpid-client</packagereq>
<packagereq type="default">awips2-qpid-server</packagereq>
<packagereq type="default">awips2-qpid-server-store</packagereq>
<packagereq type="default">awips2-rcm</packagereq>
<packagereq type="default">awips2-tools</packagereq>
<packagereq type="default">awips2-data.hdf5-topo</packagereq>
<packagereq type="default">awips2-data.hdf5-gfe.climo</packagereq>
<packagereq type="default">awips2-aviation-shared</packagereq>
<packagereq type="default">awips2-python-cherrypy</packagereq>
<packagereq type="default">awips2-python-dynamicserialize</packagereq>
<packagereq type="default">awips2-python-h5py</packagereq>
<packagereq type="default">awips2-python-matplotlib</packagereq>
<packagereq type="default">awips2-python-nose</packagereq>
<packagereq type="default">awips2-python-numpy</packagereq>
<packagereq type="default">awips2-python-pil</packagereq>
<packagereq type="default">awips2-python-pmw</packagereq>
<packagereq type="default">awips2-python-pupynere</packagereq>
<packagereq type="default">awips2-python-qpid</packagereq>
<packagereq type="default">awips2-python-scientific</packagereq>
<packagereq type="default">awips2-python-scipy</packagereq>
<packagereq type="default">awips2-python-tables</packagereq>
<packagereq type="default">awips2-python-thrift</packagereq>
<packagereq type="default">awips2-python-tpg</packagereq>
<packagereq type="default">awips2-python-ufpy</packagereq>
<packagereq type="default">awips2-python-werkzeug</packagereq>
<packagereq type="default">awips2-python-pygtk</packagereq>
<packagereq type="default">awips2-python-pycairo</packagereq>
<packagereq type="default">awips2-localapps-environment</packagereq>
</packagelist>
</group>
<group>
<id>awips2-visualize</id>
@ -181,7 +239,6 @@
<packagereq type="default">awips2-edex-shapefiles</packagereq>
<packagereq type="default">awips2-edex-text</packagereq>
<packagereq type="default">awips2-edex-ncep</packagereq>
<packagereq type="default">awips2-edex-ncep-nsharp</packagereq>
<packagereq type="default">awips2-edex-npp</packagereq>
<packagereq type="default">awips2-gfesuite-server</packagereq>