Skip to content
Snippets Groups Projects

Support users redirecting git https to ssh

Merged Louis Moureaux requested to merge lmoureau/Darwin:feature/support-redirect-to-ssh into master
1 file
+ 24
0
Compare changes
  • Side-by-side
  • Inline
+ 24
0
@@ -4,6 +4,30 @@ set -e
BASE_DIR=$PWD
# If the user insists on using SSH for everything, make sure their key is
# unlocked before doing anything else. Otherwise they won't be able to clone.
if [ ! -z "$(git config url.ssh://git@gitlab.cern.ch:7999/.insteadOf)" ]; then
echo "+----------------------------------------------------------------------------------+"
echo "| NOTE ABOUT SSH KEYS |"
echo "| |"
echo "| Your git configuration redirects all clones to SSH. We will try to make it work, |"
echo "| but it may fail if you do not use the default SSH key. In any case running cmake |"
echo "| commands directly will require you ensure an SSH agent is running and your SSH |"
echo "| key is unlocked. |"
echo "+----------------------------------------------------------------------------------+"
echo
echo "===> Unlocking your SSH key..."
# Start an ssh agent if needed
if [ -z "$SSH_AUTH_SOCK" ] || [ -z "$SSH_AGENT_PID" ]; then
eval $(ssh-agent)
fi
# Unlock the key. This will only work if the default key is used for GitLab,
# but we have no easy way of getting this information.
ssh-add
fi
# Get a CMSSW if we don't have one
if [ -z $CMSSW_BASE ]; then
version=CMSSW_12_4_0
Loading