Skip to content

Commit 67479ff

Browse files
Allow context to be provided to hack/env itself
1 parent 734a79b commit 67479ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hack/common.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1091,23 +1091,23 @@ function os::build::environment::create() {
10911091
set -o errexit
10921092
local release_image="${OS_BUILD_ENV_IMAGE}"
10931093
local additional_context="${OS_BUILD_ENV_DOCKER_ARGS:-}"
1094-
if [[ -z "${additional_context}" && "${OS_BUILD_ENV_USE_DOCKER:-y}" == "y" ]]; then
1095-
additional_context="--privileged -v /var/run/docker.sock:/var/run/docker.sock"
1094+
if [[ "${OS_BUILD_ENV_USE_DOCKER:-y}" == "y" ]]; then
1095+
additional_context+="--privileged -v /var/run/docker.sock:/var/run/docker.sock"
10961096

10971097
if [[ "${OS_BUILD_ENV_LOCAL_DOCKER:-n}" == "y" ]]; then
10981098
# if OS_BUILD_ENV_LOCAL_DOCKER==y, add the local OS_ROOT as the bind mount to the working dir
10991099
# and set the running user to the current user
11001100
local workingdir
11011101
workingdir=$( os::build::environment::release::workingdir )
1102-
additional_context="${additional_context} -v ${OS_ROOT}:${workingdir} -u $(id -u)"
1102+
additional_context+=" -v ${OS_ROOT}:${workingdir} -u $(id -u)"
11031103
elif [[ -n "${OS_BUILD_ENV_REUSE_VOLUME:-}" ]]; then
11041104
# if OS_BUILD_ENV_REUSE_VOLUME is set, create a docker volume to store the working output so
11051105
# successive iterations can reuse shared code.
11061106
local workingdir
11071107
workingdir=$( os::build::environment::release::workingdir )
11081108
name="$( echo "${OS_BUILD_ENV_REUSE_VOLUME}" | tr '[:upper:]' '[:lower:]' )"
11091109
docker volume create --name "${name}" > /dev/null
1110-
additional_context="${additional_context} -v ${name}:${workingdir}"
1110+
additional_context+=" -v ${name}:${workingdir}"
11111111
fi
11121112
fi
11131113

0 commit comments

Comments
 (0)