File tree 4 files changed +15
-5
lines changed
4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 16
16
17
17
set -eo pipefail
18
18
19
+ _run_error_log () {
20
+ echo " error: line $( caller) "
21
+ }
22
+
23
+ trap ' _run_error_log' ERR
24
+
19
25
# Activate mocha config
20
26
export MOCHA_REPORTER_OUTPUT=${PROJECT} _sponge_log.xml
21
27
export MOCHA_REPORTER=xunit
@@ -37,12 +43,14 @@ gcloud config set project $GOOGLE_CLOUD_PROJECT
37
43
38
44
# Version is in the format <PR#>-<GIT COMMIT SHA>.
39
45
# Ensures PR-based triggers of the same branch don't collide if Kokoro attempts
40
- # to run them concurrently.
46
+ # to run them concurrently. Defaults to 'latest'.
41
47
export SAMPLE_VERSION=" ${KOKORO_GIT_COMMIT:- latest} "
42
48
export SAMPLE_NAME=" $( basename $( pwd) ) "
43
49
44
- # Builds not triggered by a PR will fall back to the commit hash then "latest".
45
- SUFFIX=${KOKORO_BUILD_ID}
50
+ # Cloud Run has a max service name length, $KOKORO_BUILD_ID is too long to guarantee no conflict deploys.
51
+ set -x
52
+ export SUFFIX=" $( cat /dev/urandom | LC_CTYPE=C tr -dc ' a-z0-9' | head -c 15) "
53
+ set +x
46
54
export SERVICE_NAME=" ${SAMPLE_NAME} -${SUFFIX} "
47
55
export CONTAINER_IMAGE=" gcr.io/${GOOGLE_CLOUD_PROJECT} /run-${SAMPLE_NAME} :${SAMPLE_VERSION} "
48
56
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ find . -name ' *.sh' -not -path " ./testing/*" -exec shellcheck -f gcc {} \;
Original file line number Diff line number Diff line change 14
14
15
15
const assert = require ( 'assert' ) ;
16
16
const request = require ( 'got' ) ;
17
+ const { resolve} = require ( 'url' ) ;
17
18
18
19
const get = ( route , base_url ) => {
19
20
const { ID_TOKEN } = process . env ;
20
21
if ( ! ID_TOKEN ) {
21
22
throw Error ( '"ID_TOKEN" environment variable is required.' ) ;
22
23
}
23
24
24
- return request ( route , {
25
- baseUrl : base_url . trim ( ) ,
25
+ return request ( resolve ( base_url . trim ( ) , route ) , {
26
26
headers : {
27
27
Authorization : `Bearer ${ ID_TOKEN . trim ( ) } ` ,
28
28
} ,
You can’t perform that action at this time.
0 commit comments