Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit eeede34

Browse files
chore(py-library): update decrypt secrets file
* chore(py-library): update decrypt secrets file From https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/scripts/decrypt-secrets.sh * docs: explain conditional Co-authored-by: Jeffrey Rennie <rennie@google.com> Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Tue Sep 8 11:35:59 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: d302f93d7f47e2852e585ac35ab2d15585717ec0 Source-Link: googleapis/synthtool@d302f93
1 parent 76a2a59 commit eeede34

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

scripts/decrypt-secrets.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,27 @@ ROOT=$( dirname "$DIR" )
2020
# Work from the project root.
2121
cd $ROOT
2222

23+
# Prevent it from overriding files.
24+
# We recommend that sample authors use their own service account files and cloud project.
25+
# In that case, they are supposed to prepare these files by themselves.
26+
if [[ -f "testing/test-env.sh" ]] || \
27+
[[ -f "testing/service-account.json" ]] || \
28+
[[ -f "testing/client-secrets.json" ]]; then
29+
echo "One or more target files exist, aborting."
30+
exit 1
31+
fi
32+
2333
# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources.
2434
PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}"
2535

2636
gcloud secrets versions access latest --secret="python-docs-samples-test-env" \
37+
--project="${PROJECT_ID}" \
2738
> testing/test-env.sh
2839
gcloud secrets versions access latest \
2940
--secret="python-docs-samples-service-account" \
41+
--project="${PROJECT_ID}" \
3042
> testing/service-account.json
3143
gcloud secrets versions access latest \
3244
--secret="python-docs-samples-client-secrets" \
33-
> testing/client-secrets.json
45+
--project="${PROJECT_ID}" \
46+
> testing/client-secrets.json

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "d91dd8aac77f7a9c5506c238038a26fa4f9e361e"
22+
"sha": "d302f93d7f47e2852e585ac35ab2d15585717ec0"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "d91dd8aac77f7a9c5506c238038a26fa4f9e361e"
29+
"sha": "d302f93d7f47e2852e585ac35ab2d15585717ec0"
3030
}
3131
}
3232
],

0 commit comments

Comments
 (0)