Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
chore(py-library): update decrypt secrets file (#40)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/6119a864-2de4-4996-b2e7-89215093ff0a/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@d302f93
  • Loading branch information
yoshi-automation committed Oct 13, 2020
1 parent 1985fef commit 23cc946
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion scripts/decrypt-secrets.sh
Expand Up @@ -20,14 +20,27 @@ ROOT=$( dirname "$DIR" )
# Work from the project root.
cd $ROOT

# Prevent it from overriding files.
# We recommend that sample authors use their own service account files and cloud project.
# In that case, they are supposed to prepare these files by themselves.
if [[ -f "testing/test-env.sh" ]] || \
[[ -f "testing/service-account.json" ]] || \
[[ -f "testing/client-secrets.json" ]]; then
echo "One or more target files exist, aborting."
exit 1
fi

# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources.
PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}"

gcloud secrets versions access latest --secret="python-docs-samples-test-env" \
--project="${PROJECT_ID}" \
> testing/test-env.sh
gcloud secrets versions access latest \
--secret="python-docs-samples-service-account" \
--project="${PROJECT_ID}" \
> testing/service-account.json
gcloud secrets versions access latest \
--secret="python-docs-samples-client-secrets" \
> testing/client-secrets.json
--project="${PROJECT_ID}" \
> testing/client-secrets.json
4 changes: 2 additions & 2 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-trace.git",
"sha": "d3f18195e92915289f9d9d5075de1f11eb316353"
"sha": "423fb47f6d3294fca9fe1c942c42d941c3ef3378"
}
},
{
Expand All @@ -18,7 +18,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "d91dd8aac77f7a9c5506c238038a26fa4f9e361e"
"sha": "d302f93d7f47e2852e585ac35ab2d15585717ec0"
}
}
],
Expand Down

0 comments on commit 23cc946

Please sign in to comment.