Skip to content

Commit

Permalink
revert to --home on github
Browse files Browse the repository at this point in the history
  • Loading branch information
dhower-qc committed Jul 29, 2024
1 parent 7141cb0 commit 2daec73
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ if [ -v GITHUB_ACTIONS ]; then
echo "ACTIONS"
CONTAINER_PATH=${ROOT}/.singularity/image.sif
HOME_PATH=${GITHUB_WORKSPACE}
HOME_OPT="--home ${ROOT}/.home"
SINGULARITY_CACHE=--disable-cache
else
CONTAINER_PATH=${ROOT}/.singularity/image-$CONTAINER_TAG.sif
HOME_PATH=${HOME}
HOME_OPT="--bind ${ROOT}/.home:${HOME_PATH}"
SINGULARITY_CACHE=
fi

Expand All @@ -32,15 +34,15 @@ fi
if [ ! -f $ROOT/.bundle/config ]; then
OLDDIR=$PWD
cd $ROOT
singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle config set --local path ${ROOT}/.home/.gems
singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle config set --local cache_path ${ROOT}/.home/.cache
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle config set --local path ${ROOT}/.home/.gems
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle config set --local cache_path ${ROOT}/.home/.cache
cd $OLDDIR
fi

if [ ! -d $ROOT/.home/.gems ]; then
OLDDIR=$PWD
cd $ROOT
singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle install
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle install
cd $OLDDIR
fi

Expand All @@ -50,8 +52,8 @@ fi

if [[ ! -z "$DEVELOPMENT" && $DEVELOPMENT -eq 1 ]]; then
if [ ! -d "${ROOT}/.home/.yard/gem_index"]; then
singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard config --gem-install-yri
singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard gems
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard config --gem-install-yri
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard gems
touch ${ROOT}/.stamps/dev_gems
fi
fi
Expand All @@ -75,11 +77,11 @@ if [[ ! -z "$VSCODE" && $VSCODE -eq 1 ]]; then
fi

if [ ! -d ${ROOT}/node_modules ]; then
singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} npm i
singularity run ${HOME_OPT} ${CONTAINER_PATH} npm i
fi

BUNDLE="singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle"
RUBY="singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle exec ruby"
RAKE="singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} bundle exec rake"
NPM="singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} npm"
NPX="singularity run --bind ${ROOT}/.home:${HOME_PATH} ${CONTAINER_PATH} npx"
BUNDLE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle"
RUBY="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec ruby"
RAKE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec rake"
NPM="singularity run ${HOME_OPT} ${CONTAINER_PATH} npm"
NPX="singularity run ${HOME_OPT} ${CONTAINER_PATH} npx"

0 comments on commit 2daec73

Please sign in to comment.