5 # designed to work on Jenkins
6 # this is a proof of concept script
8 echo
"sbncode version: $SBN_VERSION"
9 echo
"sbncode tag: $SBN"
10 echo
"sbnobj tag: $SBNOBJ"
11 echo
"sbnanaobj tag: $SBNANAOBJ"
12 echo
"sbndaq_artdaq_core tag: $SBNDAQ_ARTDAQ_CORE"
13 echo
"base qualifiers: $QUAL"
14 echo
"s qualifier: $SQUAL"
15 echo
"build type: $BUILDTYPE"
16 echo
"workspace: $WORKSPACE"
18 # Get number of cores to use.
22 if [ $ncores -lt 1 ]; then
25 echo
"Building using $ncores cores."
27 # Environment setup, uses cvmfs.
29 echo
"ls /cvmfs/larsoft.opensciencegrid.org"
30 ls /cvmfs/larsoft.opensciencegrid.org
33 if [ -f /cvmfs/larsoft.opensciencegrid.org/products/
setup ]; then
34 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
35 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/larsoft.opensciencegrid.org/products
39 echo
"No larsoft setup file found."
43 echo
"ls /cvmfs/sbn.opensciencegrid.org"
44 ls /cvmfs/sbn.opensciencegrid.org
47 if [ -f /cvmfs/sbn.opensciencegrid.org/products/sbn/
setup ]; then
48 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
49 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/sbn.opensciencegrid.org/products/sbn
51 echo
"Setting up sbn cvmfs"
54 echo
"No sbn setup file found."
61 # Use system git on macos.
71 rm -rf $WORKSPACE/temp ||
exit 1
74 rm -f $WORKSPACE/copyBack
83 # make sure we get a read-only copy
86 if [ -
z "$SBNOBJ" ]; then
87 # Extract sbnobj version from sbncode product_deps
88 SBNOBJ=`grep sbnobj $MRB_SOURCE/sbncode/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
90 echo
"sbnobj version: $SBNOBJ"
93 if [ -
z "$SBNANAOBJ" ]; then
94 # Extract sbnobj version from sbncode product_deps
95 SBNANAOBJ=`grep sbnanaobj $MRB_SOURCE/sbncode/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
97 echo
"sbnanaobj version: $SBNANAOBJ"
100 if [ -
z "$SBNDAQ_ARTDAQ_CORE" ]; then
101 # Extract sbndaq_artdaq_core version from sbncode product_deps
102 SBNDAQ_ARTDAQ_CORE=`grep sbndaq_artdaq_core $MRB_SOURCE/sbncode/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
104 echo
"sbndaq_artdaq_core version: $SBNDAQ_ARTDAQ_CORE"
105 mrb g -
r sbndaq_artdaq_core@$SBNDAQ_ARTDAQ_CORE ||
exit 1
107 cd $MRB_BUILDDIR ||
exit 1
110 if uname | grep -
q Linux; then
111 cp /usr/lib64/libXmu.so.6 sbncode/lib
113 mrb mp -
n sbn -- -j$ncores ||
exit 1
117 # Extract larsoft version from product_deps.
118 larsoft_version=`grep larsoft $MRB_SOURCE/sbncode/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
119 larsoft_dot_version=`echo ${larsoft_version} | sed -
e 's/_/./g' | sed -
e 's/^v//'`
124 # Construct name of larsoft manifest.
126 larsoft_hyphen_qual=`echo $SQUAL:$QUAL | tr : - | sed
's/-noifdh//'`
127 larsoft_manifest=larsoft-${larsoft_dot_version}-${
flvr}-${larsoft_hyphen_qual}-${BUILDTYPE}_MANIFEST.txt
128 echo
"Larsoft manifest:"
129 echo $larsoft_manifest
132 # Fetch larsoft manifest from scisoft and append to sbncode manifest.
134 curl --fail --silent --location --insecure http:
136 if echo $QUAL | grep -
q noifdh; then
137 # Delete the manifest entirely.
143 mv *.bz2 $WORKSPACE/copyBack/ ||
exit 1
145 if [ -f $manifest ]; then
146 mv $manifest $WORKSPACE/copyBack/ ||
exit 1
148 cp $MRB_BUILDDIR/sbncode/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