5 # designed to work on Jenkins
6 # this is a proof of concept script
8 echo
"sbnana version: $SBNANA_VERSION"
9 echo
"sbnana tag/commit/branch: $SBNANA"
10 #echo "sbnanaobj tag/commit/branch: $SBNANAOBJ"
11 echo
"base qualifiers: $QUAL"
12 echo
"s qualifier: $SQUAL"
13 echo
"build type: $BUILDTYPE"
14 echo
"workspace: $WORKSPACE"
16 # Get number of cores to use.
20 if [ $ncores -lt 1 ]; then
23 echo
"Building using $ncores cores."
25 # Environment setup, uses cvmfs.
27 echo
"ls /cvmfs/larsoft.opensciencegrid.org"
28 ls /cvmfs/larsoft.opensciencegrid.org
31 if [ -f /cvmfs/larsoft.opensciencegrid.org/products/
setup ]; then
32 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
33 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/larsoft.opensciencegrid.org/products
37 echo
"No larsoft setup file found."
41 echo
"ls /cvmfs/sbn.opensciencegrid.org"
42 ls /cvmfs/sbn.opensciencegrid.org
45 if [ -f /cvmfs/sbn.opensciencegrid.org/products/sbn/
setup ]; then
46 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
47 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/sbn.opensciencegrid.org/products/sbn
49 echo
"Setting up sbn cvmfs"
52 echo
"No sbn setup file found."
59 # Use system git on macos.
69 rm -rf $WORKSPACE/temp ||
exit 1
72 rm -f $WORKSPACE/copyBack
81 # make sure we get a read-only copy
84 if [ -
z "$SBNANAOBJ" ]; then
85 # Extract sbananobj version from sbncode product_deps
86 SBNANAOBJ=`grep sbnanaobj $MRB_SOURCE/sbnana/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
88 echo
"sbnanaobj version: $SBNANAOBJ"
94 if uname | grep -
q Linux; then
95 cp /usr/lib64/libXmu.so.6 sbncode/lib
97 mrb mp -
n sbnana -- -j$ncores ||
exit 1
103 mv *.bz2 $WORKSPACE/copyBack/ ||
exit 1
104 if [ -f $manifest ]; then
105 mv $manifest $WORKSPACE/copyBack/ ||
exit 1
107 cp $MRB_BUILDDIR/sbnana/releaseDB
process_name opflash particleana ie ie ie z
then source grid fermiapp products dune setup_dune_fermiapp sh exit else echo No setup file found exit fi setup
process_name opflash particleana ie x
then cvmfs grid cern ch util cvmfs uptodate cvmfs uboone opensciencegrid org products fi source cvmfs uboone opensciencegrid org products setup_uboone sh exit else echo No setup file found exit fi if!uname grep q Darwin
then setup git exit fi setup gitflow exit export MRB_PROJECT
then echo Invalid dCache scratch not copying back else ifdh ls
then cp usr lib64 libXmu so sbncode lib fi mrb mp n sbn j $ncores exit manifest