40
40
# (true|false): Whether to upload the Docker image after the
41
41
# successful builds.
42
42
# TRAMPOLINE_BUILD_FILE: The script to run in the docker container.
43
+ # TRAMPOLINE_WORKSPACE: The workspace path in the docker container.
44
+ # Defaults to /workspace.
43
45
#
44
46
# Potentially there are some repo specific envvars in .trampolinerc in
45
47
# the project root.
@@ -118,6 +120,9 @@ PROJECT_ROOT="$(repo_root "${PROGRAM_DIR}")"
118
120
RUNNING_IN_CI=" false"
119
121
TRAMPOLINE_V2=" true"
120
122
123
+ # The workspace in the container, defaults to /workspace.
124
+ TRAMPOLINE_WORKSPACE=" ${TRAMPOLINE_WORKSPACE:-/ workspace} "
125
+
121
126
# If it's running on Kokoro, RUNNING_IN_CI will be true and
122
127
# TRAMPOLINE_CI is set to 'kokoro'. Both envvars will be passing down
123
128
# to the container for telling which CI system we're in.
@@ -137,10 +142,10 @@ if [[ -n "${KOKORO_GFILE_DIR:-}" ]]; then
137
142
mkdir -p " ${tmpdir} /gcloud"
138
143
gcloud_config_dir=" ${tmpdir} /gcloud"
139
144
140
- log " Using isolated gcloud config: ${gcloud_config_dir} ."
145
+ log_yellow " Using isolated gcloud config: ${gcloud_config_dir} ."
141
146
export CLOUDSDK_CONFIG=" ${gcloud_config_dir} "
142
147
143
- log " Using ${SERVICE_ACCOUNT_KEY_FILE} for authentication."
148
+ log_yellow " Using ${SERVICE_ACCOUNT_KEY_FILE} for authentication."
144
149
gcloud auth activate-service-account \
145
150
--key-file " ${SERVICE_ACCOUNT_KEY_FILE} "
146
151
gcloud auth configure-docker --quiet
@@ -268,9 +273,9 @@ docker_flags=(
268
273
" --env" " USER=${user_name} "
269
274
270
275
# Mount the project directory inside the Docker container.
271
- " --volume" " ${PROJECT_ROOT} :/v "
272
- " --workdir" " /v "
273
- " --env" " PROJECT_ROOT=/v "
276
+ " --volume" " ${PROJECT_ROOT} :${TRAMPOLINE_WORKSPACE} "
277
+ " --workdir" " ${TRAMPOLINE_WORKSPACE} "
278
+ " --env" " PROJECT_ROOT=${TRAMPOLINE_WORKSPACE} "
274
279
275
280
# Mount the temporary home directory.
276
281
" --volume" " ${tmphome} :/h"
0 commit comments