Skip to content

Commit

Permalink
try to make spack location independent of current directory
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Jan 13, 2025
1 parent 3751f6e commit 57e5bc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CI/dependencies/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ echo "Install destination: $destination"

mkdir -p ${destination}

if [ -n "${GITLAB_CI:-}" ]; then
_spack_folder=${CI_PROJECT_DIR}/spack
else
_spack_folder=${PWD}/spack
fi

start_section "Install spack if not already installed"
if ! command -v spack &> /dev/null; then
"${SCRIPT_DIR}/setup_spack.sh"
"${SCRIPT_DIR}/setup_spack.sh" "${_spack_folder}"
source "${_spack_folder}/spack/share/spack/setup-env.sh"
fi
end_section

Expand All @@ -113,7 +119,6 @@ if [ -n "${GITLAB_CI:-}" ]; then
ln -s ${CI_PROJECT_DIR}/.spack ${HOME}/.spack
fi

source "$(pwd)/spack/share/spack/setup-env.sh"


if [ -n "${CI:-}" ]; then
Expand Down
8 changes: 5 additions & 3 deletions CI/dependencies/setup_spack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set -u

_spack_version=${SPACK_VERSION:-develop}

if [ ! -d "spack" ]; then
_spack_folder=$1

if [ ! -d "${_spack_folder}" ]; then
echo "Cloning spack"
git clone --branch ${_spack_version} -c feature.manyFiles=true https://github.com/acts-project/spack.git
pushd spack > /dev/null
git clone --branch ${_spack_version} -c feature.manyFiles=true https://github.com/acts-project/spack.git ${_spack_folder}
pushd ${_spack_folder} > /dev/null
git config user.name 'CI'
git config user.email '<>'
popd > /dev/null
Expand Down

0 comments on commit 57e5bc5

Please sign in to comment.