| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 89afab9 commit 58c3f00
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ retry_with_backoff 3 10 \ | |||
| 39 | 39 | ||
| 40 | 40 | # if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it | |
| 41 | 41 | if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then | |
| 42 | - export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) | ||
| 42 | + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) | ||
| 43 | 43 | fi | |
| 44 | 44 | ||
| 45 | 45 | RETURN_CODE=0 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,14 +28,10 @@ env_vars: { | |||
| 28 | 28 | ||
| 29 | 29 | env_vars: { | |
| 30 | 30 | key: "GOOGLE_APPLICATION_CREDENTIALS" | |
| 31 | - value: "keystore/73713_java_it_service_account" | ||
| 31 | + value: "secret_manager/java-it-service-account" | ||
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | - before_action { | ||
| 35 | - fetch_keystore { | ||
| 36 | - keystore_resource { | ||
| 37 | - keystore_config_id: 73713 | ||
| 38 | - keyname: "java_it_service_account" | ||
| 39 | - } | ||
| 40 | - } | ||
| 34 | + env_vars: { | ||
| 35 | + key: "SECRET_MANAGER_KEYS" | ||
| 36 | + value: "java-it-service-account" | ||
| 41 | 37 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,19 +24,15 @@ env_vars: { | |||
| 24 | 24 | ||
| 25 | 25 | env_vars: { | |
| 26 | 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" | |
| 27 | - value: "keystore/73713_java_it_service_account" | ||
| 27 | + value: "secret_manager/java-docs-samples-service-account" | ||
| 28 | 28 | } | |
| 29 | 29 | ||
| 30 | 30 | env_vars: { | |
| 31 | - key: "ENABLE_BUILD_COP" | ||
| 32 | - value: "true" | ||
| 31 | + key: "SECRET_MANAGER_KEYS" | ||
| 32 | + value: "java-docs-samples-service-account" | ||
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | - before_action { | ||
| 36 | - fetch_keystore { | ||
| 37 | - keystore_resource { | ||
| 38 | - keystore_config_id: 73713 | ||
| 39 | - keyname: "java_it_service_account" | ||
| 40 | - } | ||
| 41 | - } | ||
| 35 | + env_vars: { | ||
| 36 | + key: "ENABLE_BUILD_COP" | ||
| 37 | + value: "true" | ||
| 42 | 38 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,43 @@ | |||
| 1 | + #!/bin/bash | ||
| 2 | + # Copyright 2020 Google LLC. | ||
| 3 | + # | ||
| 4 | + # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + # you may not use this file except in compliance with the License. | ||
| 6 | + # You may obtain a copy of the License at | ||
| 7 | + # | ||
| 8 | + # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + # | ||
| 10 | + # Unless required by applicable law or agreed to in writing, software | ||
| 11 | + # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + # See the License for the specific language governing permissions and | ||
| 14 | + # limitations under the License. | ||
| 15 | + | ||
| 16 | + set -eo pipefail | ||
| 17 | + | ||
| 18 | + function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} | ||
| 19 | + function msg { println "$*" >&2 ;} | ||
| 20 | + function println { printf '%s\n' "$(now) $*" ;} | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + # Populates requested secrets set in SECRET_MANAGER_KEYS from service account: | ||
| 24 | + # kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com | ||
| 25 | + SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" | ||
| 26 | + msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" | ||
| 27 | + mkdir -p ${SECRET_LOCATION} | ||
| 28 | + for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") | ||
| 29 | + do | ||
| 30 | + msg "Retrieving secret ${key}" | ||
| 31 | + docker run --entrypoint=gcloud \ | ||
| 32 | + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ | ||
| 33 | + gcr.io/google.com/cloudsdktool/cloud-sdk \ | ||
| 34 | + secrets versions access latest \ | ||
| 35 | + --project cloud-devrel-kokoro-resources \ | ||
| 36 | + --secret ${key} > \ | ||
| 37 | + "${SECRET_LOCATION}/${key}" | ||
| 38 | + if [[ $? == 0 ]]; then | ||
| 39 | + msg "Secret written to ${SECRET_LOCATION}/${key}" | ||
| 40 | + else | ||
| 41 | + msg "Error retrieving secret ${key}" | ||
| 42 | + fi | ||
| 43 | + done | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,14 +24,10 @@ env_vars: { | |||
| 24 | 24 | ||
| 25 | 25 | env_vars: { | |
| 26 | 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" | |
| 27 | - value: "keystore/73713_java_it_service_account" | ||
| 27 | + value: "secret_manager/java-it-service-account" | ||
| 28 | 28 | } | |
| 29 | 29 | ||
| 30 | - before_action { | ||
| 31 | - fetch_keystore { | ||
| 32 | - keystore_resource { | ||
| 33 | - keystore_config_id: 73713 | ||
| 34 | - keyname: "java_it_service_account" | ||
| 35 | - } | ||
| 36 | - } | ||
| 30 | + env_vars: { | ||
| 31 | + key: "SECRET_MANAGER_KEYS" | ||
| 32 | + value: "java-it-service-account" | ||
| 37 | 33 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,14 +24,10 @@ env_vars: { | |||
| 24 | 24 | ||
| 25 | 25 | env_vars: { | |
| 26 | 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" | |
| 27 | - value: "keystore/73713_java_it_service_account" | ||
| 27 | + value: "secret_manager/java-docs-samples-service-account" | ||
| 28 | 28 | } | |
| 29 | 29 | ||
| 30 | - before_action { | ||
| 31 | - fetch_keystore { | ||
| 32 | - keystore_resource { | ||
| 33 | - keystore_config_id: 73713 | ||
| 34 | - keyname: "java_it_service_account" | ||
| 35 | - } | ||
| 36 | - } | ||
| 37 | - } | ||
| 30 | + env_vars: { | ||
| 31 | + key: "SECRET_MANAGER_KEYS" | ||
| 32 | + value: "java-docs-samples-service-account" | ||
| 33 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,4 +21,6 @@ function cleanup() { | |||
| 21 | 21 | echo "cleanup"; | |
| 22 | 22 | } | |
| 23 | 23 | trap cleanup EXIT | |
| 24 | + | ||
| 25 | + $(dirname $0)/populate-secrets.sh # Secret Manager secrets. | ||
| 24 | 26 | python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,14 +4,14 @@ | |||
| 4 | 4 | "git": { | |
| 5 | 5 | "name": ".", | |
| 6 | 6 | "remote": "https://github.com/googleapis/java-storage-nio.git", | |
| 7 | - "sha": "51ae4181ef1c786ff6237346c044548281f4eec9" | ||
| 7 | + "sha": "68508ce596e8a45791f7079738342afbac5b94d1" | ||
| 8 | 8 | } | |
| 9 | 9 | }, | |
| 10 | 10 | { | |
| 11 | 11 | "git": { | |
| 12 | 12 | "name": "synthtool", | |
| 13 | 13 | "remote": "https://github.com/googleapis/synthtool.git", | |
| 14 | - "sha": "987270824bd26f6a8c716d5e2022057b8ae7b26e" | ||
| 14 | + "sha": "c4f3059c27591eb24d6942a0e357ec94c80459f2" | ||
| 15 | 15 | } | |
| 16 | 16 | } | |
| 17 | 17 | ] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments