projects-dir.mk: Enable temporary passwordless SSH session login

Making use of SSH session sharing, which avoids the need for using an
authentication agent. It also speeds things up considerably.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-04-12 10:07:48 +00:00
commit f86ccd036b

View file

@ -30,13 +30,15 @@ endif
export CVSROOT = :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs
ifeq ($(CVS_RSH),)
export CVS_RSH = ssh
export CVS_RSH := ./ssh-wrapper.sh
endif
ifeq ($(GIT_SSH),)
export GIT_SSH = $(CVS_RSH)
export GIT_SSH := $(CVS_RSH)
endif
export JW_BUILD_SSH_EXTRA_OPTS = -o ControlMaster=auto -o ControlPath=./%r@build:%p -o ControlPersist=60s
ifneq ($(CLONE_FROM_USER),)
export PGIT_CLONE_FROM_USER = $(CLONE_FROM_USER)
else
@ -55,8 +57,8 @@ BUILD_PY = python $(MOD_SCRIPT_DIR)/build.py -b $(shell pwd) $(BUILD_PY_EX
PURGE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/purge-stale-projects.sh /opt/jw-build/bin/purge-stale-projects.sh) purge-not-found)
RELEASE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/build-release.sh /opt/jw-build/bin/build-release.sh) release-not-found)
BROWSER ?= firefox
GIT_SRV_ADMIN = $(GIT_SSH) $(JANWARE_USER)@git.jannet.de /opt/jw-build/bin/git-srv-admin.sh
CVS_ADMIN = $(GIT_SSH) $(JANWARE_USER)@git.jannet.de /opt/jw-build/bin/cvs-admin.sh
GIT_SRV_ADMIN = JW_BUILD_SSH_EXTRA_OPTS="$(JW_BUILD_SSH_EXTRA_OPTS)" $(GIT_SSH) $(JANWARE_USER)@git.jannet.de /opt/jw-build/bin/git-srv-admin.sh
CVS_ADMIN = JW_BUILD_SSH_EXTRA_OPTS="$(JW_BUILD_SSH_EXTRA_OPTS)" $(GIT_SSH) $(JANWARE_USER)@git.jannet.de /opt/jw-build/bin/cvs-admin.sh
# ------------ targets
@ -181,7 +183,15 @@ links.done:
if [ -d dspc/src/shared ]; then ln -sf dspc/src/shared dspider-shared; fi
touch $@
cvsdir.done:
ssh-wrapper.sh: Makefile
echo -e '#!/bin/bash -x\n\nexec /usr/bin/ssh $$JW_BUILD_SSH_EXTRA_OPTS "$$@"' > $@.tmp
chmod 700 $@.tmp
mv $@.tmp $@
clean.ssh-wrapper:
rm -f ssh-wrapper.sh
clean: clean.ssh-wrapper
cvsdir.done: ssh-wrapper.sh
if [ ! -d CVS ]; then \
mkdir CVS && \
echo :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs > CVS/Root && \