build_rpms.sh cleanup
This commit is contained in:
parent
44fb8dd9cc
commit
e3f74ae31a
1 changed files with 46 additions and 25 deletions
|
@ -1,17 +1,32 @@
|
||||||
#!/bin/sh -xe
|
#!/bin/sh -xe
|
||||||
# Run rpmbuild scripts for awips
|
#
|
||||||
# type=$(rpm -qa awips2 | rev | cut -d "." -f3|rev)
|
# Build Unidata AWIPS RPMs from source
|
||||||
type=$1
|
# Author: mjames@ucar.edu
|
||||||
if [ -z "$type" ]; then
|
#
|
||||||
echo "supply type (el6, el7)"
|
|
||||||
|
#
|
||||||
|
# Require el6 or el7 be specified
|
||||||
|
# RPM name is optional (see below)
|
||||||
|
#
|
||||||
|
os_version=$1
|
||||||
|
rpm=$2
|
||||||
|
|
||||||
|
if [ -z "$os_version" ]; then
|
||||||
|
echo "supply os_version (el6, el7)"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set up AWIPS environment
|
||||||
|
#
|
||||||
. /awips2/repo/awips2-builds/build/buildEnvironment.sh
|
. /awips2/repo/awips2-builds/build/buildEnvironment.sh
|
||||||
buildsh=$REPO/awips2-builds/build/build.sh
|
buildsh=$REPO/awips2-builds/build/build.sh
|
||||||
pushd $REPO
|
pushd $REPO
|
||||||
|
|
||||||
# if not mounted to docker container, clone from github
|
#
|
||||||
|
# If local source directories, exist, mount them to the
|
||||||
|
# container, otherwise clone the repo from github
|
||||||
|
#
|
||||||
if [ ! -d awips2-ncep ]; then git clone https://github.com/Unidata/awips2-ncep.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
if [ ! -d awips2-ncep ]; then git clone https://github.com/Unidata/awips2-ncep.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
||||||
if [ ! -d awips2-goesr ]; then git clone https://github.com/Unidata/awips2-goesr.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
if [ ! -d awips2-goesr ]; then git clone https://github.com/Unidata/awips2-goesr.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
||||||
if [ ! -d awips2-unidata ]; then git clone https://github.com/Unidata/awips2-unidata.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
if [ ! -d awips2-unidata ]; then git clone https://github.com/Unidata/awips2-unidata.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
||||||
|
@ -20,6 +35,10 @@ if [ ! -d awips2-core-foss ]; then git clone https://github.com/Unidata/awips2-c
|
||||||
if [ ! -d awips2-foss ]; then git clone https://github.com/Unidata/awips2-foss.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
if [ ! -d awips2-foss ]; then git clone https://github.com/Unidata/awips2-foss.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
||||||
if [ ! -d awips2-nws ]; then git clone https://github.com/Unidata/awips2-nws.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
if [ ! -d awips2-nws ]; then git clone https://github.com/Unidata/awips2-nws.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
||||||
if [ ! -d awips2-rpm ]; then git clone https://github.com/Unidata/awips2-rpm.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
if [ ! -d awips2-rpm ]; then git clone https://github.com/Unidata/awips2-rpm.git --branch unidata_${AWIPSII_VERSION} --single-branch ;fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# AWIPS Static files are too large to host on github
|
||||||
|
#
|
||||||
if [ ! -d awips2-static ]; then
|
if [ ! -d awips2-static ]; then
|
||||||
mkdir awips2-static
|
mkdir awips2-static
|
||||||
cd awips2-static
|
cd awips2-static
|
||||||
|
@ -28,36 +47,38 @@ if [ ! -d awips2-static ]; then
|
||||||
rm -rf static.tar
|
rm -rf static.tar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# to test the dockerized build procedure on a quick rpm
|
#
|
||||||
#su - awips -c "/bin/bash $buildsh -b awips2-ldm"
|
# If RPM name is given
|
||||||
|
#
|
||||||
|
if [ ! -z "$rpm" ]; then
|
||||||
|
|
||||||
# provides rpm name as arg (ex: ./build/setup.sh el7 awips2-python-jep)
|
frst="$(echo $rpm | head -c 1)"
|
||||||
prog=$2
|
|
||||||
if [ ! -z "$prog" ]; then
|
|
||||||
frst="$(echo $prog | head -c 1)"
|
|
||||||
if [[ "$frst" = "-" ]]; then
|
if [[ "$frst" = "-" ]]; then
|
||||||
su - awips -c "/bin/bash $buildsh $prog"
|
# If first character is a dash, then a build group alias was given
|
||||||
|
su - awips -c "/bin/bash $buildsh $rpm"
|
||||||
else
|
else
|
||||||
su - awips -c "/bin/bash $buildsh -b $prog"
|
su - awips -c "/bin/bash $buildsh -b $rpm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
# If RPM name is not given
|
||||||
# Build all groups (in this order)
|
# Build all groups (in this order)
|
||||||
#su - awips -c "/bin/bash $buildsh -ade"
|
su - awips -c "/bin/bash $buildsh -ade"
|
||||||
#su - awips -c "/bin/bash $buildsh -python"
|
su - awips -c "/bin/bash $buildsh -python"
|
||||||
#su - awips -c "/bin/bash $buildsh -qpid"
|
su - awips -c "/bin/bash $buildsh -qpid"
|
||||||
#su - awips -c "/bin/bash $buildsh -server"
|
su - awips -c "/bin/bash $buildsh -server"
|
||||||
#su - awips -c "/bin/bash $buildsh -database"
|
su - awips -c "/bin/bash $buildsh -database"
|
||||||
#su - awips -c "/bin/bash $buildsh -b awips2-ldm"
|
|
||||||
su - awips -c "/bin/bash $buildsh -edex"
|
su - awips -c "/bin/bash $buildsh -edex"
|
||||||
#su - awips -c "/bin/bash $buildsh -httpd"
|
su - awips -c "/bin/bash $buildsh -httpd"
|
||||||
#su - awips -c "/bin/bash $buildsh -cave"
|
su - awips -c "/bin/bash $buildsh -cave"
|
||||||
ls -al
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Manage RPMs
|
# Manage RPMs
|
||||||
if [ "$(ls -A ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/x86_64/)" ]; then
|
if [ "$(ls -A ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/x86_64/)" ]; then
|
||||||
mv ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/x86_64/* /awips2/repo/awips2-builds/dist/${type}-dev/x86_64/
|
mv ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/x86_64/* /awips2/repo/awips2-builds/dist/${os_version}-dev/x86_64/
|
||||||
fi
|
fi
|
||||||
if [ "$(ls -A ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/noarch/)" ]; then
|
if [ "$(ls -A ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/noarch/)" ]; then
|
||||||
mv ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/noarch/* /awips2/repo/awips2-builds/dist/${type}-dev/noarch/
|
mv ${JENKINS_HOME}/build/rpms/awips2_${AWIPSII_VERSION}/noarch/* /awips2/repo/awips2-builds/dist/${os_version}-dev/noarch/
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue