Skip to content

Commit 823c14e

Browse files
committed
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
1 parent 5d727f0 commit 823c14e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
= ChangeLog for project-templates
22

3+
== Untagged changes
4+
5+
* Do not have user depend on SSH_AUTH_SOCK
6+
37
== Version v1
48

59
* Initial release

common/sfl/cqfd

+7-1
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ docker_build() {
9191
# arg$1: the command string to execute as builder
9292
#
9393
docker_run() {
94+
local opt
95+
96+
if [ -e "$SSH_AUTH_SOCK" ]; then
97+
opt="-v `dirname $SSH_AUTH_SOCK`:/home/builder/.sockets"
98+
fi
99+
94100
docker run --privileged -v "$PROJECT_PATH":/home/builder/src \
95101
-v ~/.ssh:/home/builder/.ssh \
96-
-v `dirname $SSH_AUTH_SOCK`:/home/builder/.sockets \
102+
$opt \
97103
-it "$DOCKER_IMG_NAME" \
98104
/bin/bash -c "groupadd -og $GROUPS -f builders && \
99105
useradd -s /bin/bash -u $UID -g $GROUPS builder && \

0 commit comments

Comments
 (0)