From 823c14e21bd13a29b5a96f2deb5a2fb8ae27fd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Oufella?= Date: Wed, 30 Dec 2015 11:26:48 -0500 Subject: [PATCH] cqfd: do not depend on SSH_AUTH_SOCK The run command would fail in case no SSH_AUTH_SOCK was set in the user's context. This commit makes the mapping of the ssh agent socket optional, at the user's expense. Change-Id: Icef9708831f4aced9e840ac6af3afb6772cfe9dc --- CHANGELOG | 4 ++++ common/sfl/cqfd | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index bb7aadd..5b8c918 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ = ChangeLog for project-templates +== Untagged changes + +* Do not have user depend on SSH_AUTH_SOCK + == Version v1 * Initial release diff --git a/common/sfl/cqfd b/common/sfl/cqfd index f9ffe7b..1fb9bab 100755 --- a/common/sfl/cqfd +++ b/common/sfl/cqfd @@ -91,9 +91,15 @@ docker_build() { # arg$1: the command string to execute as builder # docker_run() { + local opt + + if [ -e "$SSH_AUTH_SOCK" ]; then + opt="-v `dirname $SSH_AUTH_SOCK`:/home/builder/.sockets" + fi + docker run --privileged -v "$PROJECT_PATH":/home/builder/src \ -v ~/.ssh:/home/builder/.ssh \ - -v `dirname $SSH_AUTH_SOCK`:/home/builder/.sockets \ + $opt \ -it "$DOCKER_IMG_NAME" \ /bin/bash -c "groupadd -og $GROUPS -f builders && \ useradd -s /bin/bash -u $UID -g $GROUPS builder && \