All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
buildUboone2.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # build uboonecode and uboone suite packages.
4 # uses buildFW
5 # designed to work on Jenkins
6 
7 # Extract set qualifier from $LARSOFT_QUAL (we don't care about anything else in $LARSOFT_QUAL).
8 
9 SQUAL=`echo $LARSOFT_QUAL | tr : '\n' | grep ^s`
10 
11 echo "uboonecode version: $VERSION"
12 echo "base qualifiers: $QUAL"
13 echo "set qualifier: $SQUAL"
14 echo "build type: $BUILDTYPE"
15 echo "workspace: $WORKSPACE"
16 
17 # Parse qualifier parameter into base qualifier and label (if any).
18 # Use hyphen as separator.
19 
20 basequal=''
21 label=''
22 quals=`echo $QUAL | tr '-' ' '`
23 for q in $quals
24 do
25  if [[ $q == e* || $q == c* ]]; then
27  else
28  label=$q
29  fi
30 done
31 echo "basequal: $basequal"
32 echo "label: $label"
33 
34 if [ x$basequal = x ]; then
35  echo "No base qualifier."
36  exit 1
37 fi
38 
39 # Create area for biuld artifacts.
40 rm -rf $WORKSPACE/copyBack
41 mkdir -p $WORKSPACE/copyBack || exit 1
42 
43 # Check for unsupported combinations of base qualifier, OS, and build label.
44 if [[ `uname -s` == Darwin ]] && [[ $basequal == e* ]]; then
45  echo "${basequal} build not supported on `uname -s`"
46  echo "${basequal} build not supported on `uname -s`" > $WORKSPACE/copyBack/skipping_build
47  exit 0
48 fi
49 if [[ `uname -s` == Darwin ]] && [[ x$label == xpy2 ]]; then
50  echo "Python 2 build not supported on `uname -s`"
51  echo "Python 2 build not supported on `uname -s`" > $WORKSPACE/copyBack/skipping_build
52  exit 0
53 fi
54 if [[ `uname -s` == Linux ]] && [[ `lsb_release -rs` == 6* ]] && [[ x$label == x ]] && [[ $basequal != e17 ]] && [[ $basequal != c2 ]]; then
55  echo "Python 3 build not supported on SL6"
56  echo "Python 3 build not supported on SL6" > $WORKSPACE/copyBack/skipping_build
57  exit 0
58 fi
59 
60 # Create build directory and go there.
61 blddir=${WORKSPACE}/build
62 logdir=${WORKSPACE}/log
63 rm -rf $blddir
64 rm -rf $logdir
65 mkdir -p $blddir || exit 1
66 mkdir -p $logdir || exit 1
67 cd $blddir || exit 1
68 
69 # Fetch buildFW script.
70 echo "Fetching buildFW."
71 curl --fail --silent --location --insecure -O http://scisoft.fnal.gov/scisoft/bundles/tools/buildFW || exit 1
72 chmod +x buildFW
73 
74 # Do build.
75 echo
76 echo "Begin build."
77 echo
78 if [ x$label = x ]; then
79  ./buildFW -t -b $basequal -s $SQUAL $blddir $BUILDTYPE uboone-$VERSION || \
80  { mv *.log $logdir
81  exit 1
82  }
83 else
84  ./buildFW -t -b $basequal -s $SQUAL -l $label $blddir $BUILDTYPE uboone-$VERSION || \
85  { mv *.log $logdir
86  exit 1
87  }
88 fi
89 
90 # Save log files.
91 
92 mv *.log $logdir || exit 1
93 
94 # Save artifacts.
95 
96 mv ub*.bz2 $WORKSPACE/copyBack/ || exit 1
97 mv larlite*.bz2 $WORKSPACE/copyBack/ || exit 1
98 mv larcv*.bz2 $WORKSPACE/copyBack/ || exit 1
99 mv swtrigger*.bz2 $WORKSPACE/copyBack/ || exit 1
100 mv *.txt $WORKSPACE/copyBack/ || exit 1
101 mv wcp*.bz2 $WORKSPACE/copyBack/ || echo "No wcp tarball"
102 
103 # Clean up.
104 
105 cd $WORKSPACE || exit 1
106 rm -rf $blddir || exit 1
107 
108 exit 0
process_name uboone
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
Definition: build_larcv.sh:51
pdgs p
Definition: selectors.fcl:22
SQUAL
Definition: buildUboone2.sh:9
then shift fi
do cd
then basequal
Definition: buildUboone2.sh:26
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
do i e
then echo echo For Linux