Skip to content

Commit 68b2492

Browse files
committed
add logic for graalvm job
1 parent 8fd3d4a commit 68b2492

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.kokoro/populate-secrets.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ mkdir -p ${SECRET_LOCATION}
2828
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
2929
do
3030
msg "Retrieving secret ${key}"
31-
gcloud secrets versions access latest \
32-
--project cloud-devrel-kokoro-resources \
33-
--secret ${key} > "${SECRET_LOCATION}/${key}"
34-
# docker run --entrypoint=gcloud \
35-
# --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
36-
# gcr.io/google.com/cloudsdktool/cloud-sdk \
37-
# secrets versions access latest \
38-
# --project cloud-devrel-kokoro-resources \
39-
# --secret ${key} > \
40-
# "${SECRET_LOCATION}/${key}"
41-
if [[ -f "${SECRET_LOCATION}/${key}" ]]; then
42-
msg "Secret file exists: ${SECRET_LOCATION}/${key}"
31+
if [[ "${JOB_TYPE}" == *"graalvm"* ]]; then
32+
gcloud secrets versions access latest \
33+
--project cloud-devrel-kokoro-resources \
34+
--secret ${key} > "${SECRET_LOCATION}/${key}"
35+
else
36+
docker run --entrypoint=gcloud \
37+
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
38+
gcr.io/google.com/cloudsdktool/cloud-sdk \
39+
secrets versions access latest \
40+
--project cloud-devrel-kokoro-resources \
41+
--secret ${key} > \
42+
"${SECRET_LOCATION}/${key}"
4343
fi
4444
if [[ $? == 0 ]]; then
4545
msg "Secret written to ${SECRET_LOCATION}/${key}"

0 commit comments

Comments
 (0)