You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by aw...@apache.org on 2016/01/15 23:24:30 UTC
yetus git commit: YETUS-285. flag to enable/disable docker privileged
mode
Repository: yetus
Updated Branches:
refs/heads/master d49f2ff1a -> 5056bd973
YETUS-285. flag to enable/disable docker privileged mode
Signed-off-by: Sean Busbey <bu...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/5056bd97
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/5056bd97
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/5056bd97
Branch: refs/heads/master
Commit: 5056bd973b261302a3becb4ced26380aaeb218a9
Parents: d49f2ff
Author: Allen Wittenauer <aw...@apache.org>
Authored: Fri Jan 15 10:01:39 2016 -0800
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Fri Jan 15 14:24:12 2016 -0800
----------------------------------------------------------------------
precommit/core.d/docker.sh | 6 ++++++
precommit/test-patch.sh | 5 +++++
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/yetus/blob/5056bd97/precommit/core.d/docker.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/docker.sh b/precommit/core.d/docker.sh
index 80ed919..2f75667 100755
--- a/precommit/core.d/docker.sh
+++ b/precommit/core.d/docker.sh
@@ -519,12 +519,17 @@ PatchSpecificDocker
extraargs=""
fi
+ if [[ "${DOCKER_ENABLE_PRIVILEGED}" = true ]]; then
+ extraargs="${extraargs} --privileged "
+ fi
+
client=$(docker_version Client)
server=$(docker_version Server)
dockerversion="Client=${client} Server=${server}"
if [[ ${PATCH_DIR} =~ ^/ ]]; then
+ # shellcheck disable=SC2086
exec "${DOCKERCMD}" run --rm=true -i \
${extraargs} \
-v "${PWD}:/testptch/${PROJECT_NAME}" \
@@ -540,6 +545,7 @@ PatchSpecificDocker
--env=TESTPATCHMODE="${TESTPATCHMODE}" \
"${patchimagename}"
else
+ # shellcheck disable=SC2086
exec "${DOCKERCMD}" run --rm=true -i \
${extraargs} \
-v "${PWD}:/testptch/${PROJECT_NAME}" \
http://git-wip-us.apache.org/repos/asf/yetus/blob/5056bd97/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index bb98e69..328630f 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -75,6 +75,7 @@ function setup_defaults
DOCKERMODE=false
DOCKERSUPPORT=false
+ DOCKER_ENABLE_PRIVILEGED=true
BUILD_NATIVE=${BUILD_NATIVE:-true}
BUILDTOOLCWD=true
@@ -686,6 +687,7 @@ function yetus_usage
yetus_add_option "--dockercmd=<file>" "Command to use as docker executable (default: docker from path)"
yetus_add_option "--dockerfile=<file>" "Dockerfile fragment to use as the base"
yetus_add_option "--dockeronfail=<list>" "If Docker fails, determine fallback method order (default: ${DOCKERFAIL})"
+ yetus_add_option "--dockerprivd=<bool>" "Run docker in privileged mode (default: '${DOCKER_ENABLE_PRIVILEGED}')"
yetus_add_option "--java-home=<path>" "Set JAVA_HOME (In Docker mode, this should be local to the image)"
yetus_add_option "--linecomments=<bug>" "Only write line comments to this comma delimited list (defaults to bugcomments)"
yetus_add_option "--list-plugins" "List all installed plug-ins and then exit"
@@ -794,6 +796,9 @@ function parse_args
--dockeronfail=*)
DOCKERFAIL=${i#*=}
;;
+ --dockerprivd=*)
+ DOCKER_ENABLE_PRIVILEGED=${i#*=}
+ ;;
--java-home=*)
JAVA_HOME=${i#*=}
;;