5 # designed to work on Jenkins
6 # this is a proof of concept script
8 echo
"sbndqm version: $SBNDQM_VERSION"
9 echo
"sbndqm tag: $SBNDQM"
10 #echo "sbncode tag: $SBNCODE"
11 echo
"sbndaq_onlin tag: $SBNDAQ_ONLINE"
12 echo
"base qualifiers: $QUAL"
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/fermilab.opensciencegrid.org/products/artdaq/"
28 ls /cvmfs/fermilab.opensciencegrid.org/products/artdaq
31 if [ -f /cvmfs/fermilab.opensciencegrid.org/products/artdaq/
setup ]; then
32 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
33 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/fermilab.opensciencegrid.org/products/artdaq
35 source /cvmfs/fermilab.opensciencegrid.org/products/artdaq/
setup ||
exit 1
37 echo
"No fermilab artdaq setup file found."
41 echo
"ls /cvmfs/larsoft.opensciencegrid.org"
42 ls /cvmfs/larsoft.opensciencegrid.org
45 if [ -f /cvmfs/larsoft.opensciencegrid.org/products/
setup ]; then
46 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
47 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/larsoft.opensciencegrid.org/products
51 echo
"No larsoft setup file found."
55 echo
"ls /cvmfs/sbn.opensciencegrid.org"
56 ls /cvmfs/sbn.opensciencegrid.org
59 if [ -f /cvmfs/sbn.opensciencegrid.org/products/sbn/
setup ]; then
60 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
61 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/sbn.opensciencegrid.org/products/sbn
63 echo
"Setting up sbn cvmfs"
66 echo
"No sbn setup file found."
79 rm -rf $WORKSPACE/temp ||
exit 1
82 rm -f $WORKSPACE/copyBack
91 # make sure we get a read-only copy
95 #if [ -z "$SBNCODE" ]; then
96 # # Extract sbncode version from sbncode product_deps
97 # SBNCODE=`grep sbncode $MRB_SOURCE/sbndqm/ups/product_deps | grep -v qualifier | awk '{print $2}'`
99 #echo "sbncode version: $SBNCODE"
100 #mrb g -r sbncode@$SBNCODE || exit 1
102 if [ -
z "$SBNDAQ_ONLINE" ]; then
103 # Extract sbnobj version from sbncode product_deps
104 SBNDAQ_ONLINE=`grep sbndaq_online $MRB_SOURCE/sbndqm/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
106 echo
"sbndaq_online version: $SBNDAQ_ONLINE"
107 mrb g -
r sbndaq_online@$SBNDAQ_ONLINE ||
exit 1
109 cd $MRB_BUILDDIR ||
exit 1
112 if uname | grep -
q Linux; then
113 cp /usr/lib64/libXmu.so.6 sbncode/lib
115 mrb mp -
n sbndqm -- -j$ncores ||
exit 1
119 # Extract larsoft version from product_deps.
120 sbncode_version=`grep sbncode $MRB_SOURCE/sbndqm/ups/product_deps | grep -v qualifier | awk
'{print $2}'`
121 sbncode_dot_version=`echo ${sbncode_version} | sed -
e 's/_/./g' | sed -
e 's/^v//'`
126 # Construct name of larsoft manifest.
128 sbncode_hyphen_qual=`echo $QUAL | tr : - | sed
's/-noifdh//'`
129 sbncode_manifest=sbn-${sbncode_dot_version}-${
flvr}-${sbncode_hyphen_qual}-${BUILDTYPE}_MANIFEST.txt
130 echo
"sbncode manifest:"
131 echo $sbncode_manifest
134 # Fetch larsoft manifest from scisoft and append to sbncode manifest.
136 curl --fail --silent --location --insecure http:
138 if echo $QUAL | grep -
q noifdh; then
139 # Delete the manifest entirely.
145 mv *.bz2 $WORKSPACE/copyBack/ ||
exit 1
147 if [ -f $manifest ]; then
148 mv $manifest $WORKSPACE/copyBack/ ||
exit 1
150 cp $MRB_BUILDDIR/sbndqm/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 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