File tree 1 file changed +14
-6
lines changed
synthtool/gcp/templates/python_library/.kokoro
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 15
15
16
16
set -eo pipefail
17
17
18
+ CURRENT_DIR=$( dirname " ${BASH_SOURCE[0]} " )
19
+
18
20
if [[ -z " ${PROJECT_ROOT:- } " ]]; then
19
- PROJECT_ROOT=" github/{{ metadata['repo']['repo'].split('/')[1] }} "
21
+ PROJECT_ROOT=$( realpath " ${CURRENT_DIR} /.. " )
20
22
fi
21
23
22
- cd " ${PROJECT_ROOT} "
24
+ pushd " ${PROJECT_ROOT} "
23
25
24
26
# Disable buffering, so that the logs stream through.
25
27
export PYTHONUNBUFFERED=1
@@ -28,10 +30,16 @@ export PYTHONUNBUFFERED=1
28
30
env | grep KOKORO
29
31
30
32
# Setup service account credentials.
31
- export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR} /service-account.json
33
+ if [[ -f " ${KOKORO_GFILE_DIR} /service-account.json" ]]
34
+ then
35
+ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR} /service-account.json
36
+ fi
32
37
33
38
# Setup project id.
34
- export PROJECT_ID=$( cat " ${KOKORO_GFILE_DIR} /project-id.json" )
39
+ if [[ -f " ${KOKORO_GFILE_DIR} /project-id.json" ]]
40
+ then
41
+ export PROJECT_ID=$( cat " ${KOKORO_GFILE_DIR} /project-id.json" )
42
+ fi
35
43
36
44
# If this is a continuous build, send the test log to the FlakyBot.
37
45
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
46
54
# If NOX_SESSION is set, it only runs the specified session,
47
55
# otherwise run all the sessions.
48
56
if [[ -n " ${NOX_SESSION:- } " ]]; then
49
- python3 -m nox -s ${NOX_SESSION:- }
57
+ python3 -m nox -s ${NOX_SESSION:- }
50
58
else
51
- python3 -m nox
59
+ python3 -m nox
52
60
fi
You can’t perform that action at this time.
0 commit comments