Skip to content
Snippets Groups Projects
Commit 4b4748c5 authored by Fabio Hernandez's avatar Fabio Hernandez
Browse files

Improve usability

parent a426087b
No related branches found
No related tags found
No related merge requests found
......@@ -15,16 +15,51 @@ thisScript=$(basename $0)
defaultDeployDir='/pbs/throng/lsst/software/arc6-client'
#
# Target directory to deploy to
# Usage
#
function usage() {
local name=$1
echo -e "Usage: ${name} [-h] [-d <deploy dir>]\n"
echo -e " e.g. ${name} -d ${defaultDeployDir}"
}
#
# Parse command line arguments
#
deployDir=${defaultDeployDir}
OPTIND=1
while getopts "hd:" option; do
case "${option}" in
h|\?)
usage ${thisScript}
exit 0
;;
d)
deployDir=$OPTARG
;;
esac
done
shift $((OPTIND-1))
#
# Ensure there are no extra arguments
#
if [[ $# -gt 0 ]]; then
echo "${thisScript}: unexpected argument $1"
usage ${thisScript}
exit 1
fi
#
# Check deploy directory exists
#
deployDir=${1:-${defaultDeployDir}}
if [[ ! -d ${deployDir} ]]; then
echo "${thisScript}: could not find deploy directory ${deployDir}"
exit 1
fi
#
# Pack and copy the relevant files to the target directory
# Pack and copy the relevant files to the deploy directory
#
tempFile=$(mktemp)
trap "rm -f ${tempFile}" EXIT
......@@ -62,5 +97,5 @@ declare -a arcCommands=(
)
cd ${deployDir}
for cmd in "${arcCommands[@]}"; do
ln -sf ./run-arc.sh ${cmd}
ln -sf run-arc.sh ${cmd}
done
\ No newline at end of file
......@@ -4,6 +4,7 @@
# Init
#
thisScript=$(basename $0)
thisDir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
#
# Ensure this script is run via an ARC subcommand
......@@ -24,9 +25,10 @@ if ! voms-proxy-info --file ${X509_USER_PROXY} --exists &> /dev/null; then
fi
#
# Run the requested command with its arguments inside a Singularity container
# Run the requested command with its arguments inside a Singularity container. The
# container image is expected to be in the same directory as this script.
#
singularityImage='nordugrid-arc6-client.sif'
singularityImage="${thisDir}/nordugrid-arc6-client.sif"
singularity exec \
--env X509_USER_PROXY=/tmp/x509_user_proxy \
--bind /etc/grid-security \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment