Skip to content

Commit

Permalink
cqfd: do not depend on SSH_AUTH_SOCK
Browse files Browse the repository at this point in the history
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
  • Loading branch information
joufellasfl committed Dec 30, 2015
1 parent 5d727f0 commit 823c14e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
= ChangeLog for project-templates

== Untagged changes

* Do not have user depend on SSH_AUTH_SOCK

== Version v1

* Initial release
Expand Down
8 changes: 7 additions & 1 deletion common/sfl/cqfd
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 823c14e

Please sign in to comment.