Skip to content
Snippets Groups Projects

Migration

Merged Louis Moureaux requested to merge migration into master
Files
25
+ 39
0
 
#!/usr/bin/env bash
 
 
if [[ $# -lt 2 ]]; then
 
echo "$0 image command [args]" >&2
 
exit 2
 
fi
 
 
img=$1
 
shift # rm first element of $@
 
 
case "$img" in
 
*cc7)
 
export CMSSW_VERSION=CMSSW_10_6_30
 
;;
 
*el8)
 
export CMSSW_VERSION=CMSSW_12_4_0
 
;;
 
*)
 
tput setaf 1
 
echo "Unknown Linux version. Abort."
 
tput op
 
exit 1
 
;;
 
esac
 
 
$img <<'SCRIPT' -s $CMSSW_VERSION "$@"
 
CMSSW_VERSION=$1
 
shift
 
function source_CMS_setup() { source $DAS_BASE/CMS/setup > /dev/null ; }
 
source_CMS_setup
 
if [ ! -d $DAS_BASE/$CMSSW_VERSION ]; then
 
echo "$CMSSW_VERSION could not be found. Are you sure that it has been installed?"
 
exit 1
 
fi
 
cd $DAS_BASE/$CMSSW_VERSION
 
eval $(scram runtime -sh) # cmsenv
 
cd - > /dev/null
 
"$@"
 
SCRIPT
Loading