Commit 34a19dbc authored by Pere Mato Vila's avatar Pere Mato Vila
Browse files

Merge branch 'SPI-2006' into 'master'

Mount and unmount CVMFS when needed

Closes SPI-2006

See merge request !973
parents 57627244 4ec3c11b
Pipeline #3141702 passed with stage
in 7 minutes and 12 seconds
...@@ -70,9 +70,11 @@ def preinstallMacOS() { ...@@ -70,9 +70,11 @@ def preinstallMacOS() {
if (params.BUILDMODE == 'nightly') { if (params.BUILDMODE == 'nightly') {
def today = (new Date()).format("EEE") def today = (new Date()).format("EEE")
def yesterday = (new Date() - 1).format("EEE") def yesterday = (new Date() - 1).format("EEE")
def prefix = '/Users/Shared/cvmfs/sft-nightlies.cern.ch/lcg/nightlies' def volume = '/Users/Shared/cvmfs/sft-nightlies.cern.ch'
def views = '/Users/Shared/cvmfs/sft-nightlies.cern.ch/lcg/views' def prefix = volume + '/lcg/nightlies'
def views = volume + '/lcg/views'
sh label: 'preinstall-macos', script: """ sh label: 'preinstall-macos', script: """
sudo umount ${volume} || true
rm -rf ${prefix}/${LCG_VERSION}/${yesterday} rm -rf ${prefix}/${LCG_VERSION}/${yesterday}
rm -rf ${prefix}/${LCG_VERSION}/${today} rm -rf ${prefix}/${LCG_VERSION}/${today}
mkdir -p ${prefix}/${LCG_VERSION}/${today} mkdir -p ${prefix}/${LCG_VERSION}/${today}
...@@ -88,10 +90,12 @@ def preinstallMacOS() { ...@@ -88,10 +90,12 @@ def preinstallMacOS() {
""" """
} }
else if (params.BUILDMODE == 'release') { else if (params.BUILDMODE == 'release') {
def prefix = '/Users/Shared/cvmfs/sft.cern.ch/lcg/releases' def volume = '/Users/Shared/cvmfs/sft.cern.ch'
def views = '/Users/Shared/cvmfs/sft.cern.ch/lcg/views' def prefix = volume + '/lcg/releases'
def views = volume + '/lcg/views'
sh label: 'preinstall-macos', script: """ sh label: 'preinstall-macos', script: """
unset RELEASE_MODE unset RELEASE_MODE
sudo umount ${volume} || true
mkdir -p ${prefix}/LCG_${LCG_VERSION} mkdir -p ${prefix}/LCG_${LCG_VERSION}
rm -rf ${prefix}/LCG_${LCG_VERSION}/* rm -rf ${prefix}/LCG_${LCG_VERSION}/*
mkdir -p ${views}/LCG_${LCG_VERSION} mkdir -p ${views}/LCG_${LCG_VERSION}
......
...@@ -9,6 +9,12 @@ for iterations in {1..12} ...@@ -9,6 +9,12 @@ for iterations in {1..12}
do do
if [ `uname -s` == Darwin ]; then if [ `uname -s` == Darwin ]; then
current_rev=`xattr -p user.revision /cvmfs/$VOLUME` current_rev=`xattr -p user.revision /cvmfs/$VOLUME`
if [ $? -ne 0 ]; then
# Probably the CVMFS volume is not mounted. Try to mount it...
echo "Mounting CVMFS volume $VOLUME"
sudo mount -t cvmfs $VOLUME /Users/Shared/cvmfs/$VOLUME
current_rev=`xattr -p user.revision /cvmfs/$VOLUME`
fi
else else
current_rev=`attr -qg revision /cvmfs/$VOLUME/` current_rev=`attr -qg revision /cvmfs/$VOLUME/`
fi fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment