File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Original file line number Diff line number Diff line change @@ -43,19 +43,18 @@ export PATH="${HOME}/.local/bin:${PATH}"
43
43
# install nox for testing
44
44
pip install --user -q nox
45
45
46
- # Use secrets acessor service account to get secrets
46
+ # Use secrets acessor service account to get secrets.
47
47
if [[ -f " ${KOKORO_GFILE_DIR} /secrets_viewer_service_account.json" ]]; then
48
48
gcloud auth activate-service-account \
49
49
--key-file=" ${KOKORO_GFILE_DIR} /secrets_viewer_service_account.json" \
50
50
--project=" cloud-devrel-kokoro-resources"
51
+ # This script will create 3 files:
52
+ # - testing/test-env.sh
53
+ # - testing/service-account.json
54
+ # - testing/client-secrets.json
55
+ ./scripts/decrypt-secrets.sh
51
56
fi
52
57
53
- # This script will create 3 files:
54
- # - testing/test-env.sh
55
- # - testing/service-account.json
56
- # - testing/client-secrets.json
57
- ./scripts/decrypt-secrets.sh
58
-
59
58
source ./testing/test-env.sh
60
59
export GOOGLE_APPLICATION_CREDENTIALS=$( pwd) /testing/service-account.json
61
60
@@ -176,7 +175,4 @@ for file in **/requirements.txt; do
176
175
done
177
176
cd " $ROOT "
178
177
179
- # Workaround for Kokoro permissions issue: delete secrets
180
- rm testing/{test-env.sh,client-secrets.json,service-account.json}
181
-
182
178
exit " $RTN "
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ ROOT=$( dirname "$DIR" )
20
20
# Work from the project root.
21
21
cd $ROOT
22
22
23
+ # Prevent it from overriding files.
24
+ if [[ -f " testing/test-env.sh" ]] || \
25
+ [[ -f " testing/service-account.json" ]] || \
26
+ [[ -f " testing/client-secrets.json" ]]; then
27
+ echo " One or more target files exist, aborting."
28
+ exit 1
29
+ fi
30
+
23
31
# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources.
24
32
PROJECT_ID=" ${SECRET_MANAGER_PROJECT:- cloud-devrel-kokoro-resources} "
25
33
You can’t perform that action at this time.
0 commit comments