Skip to content

Commit d58023b

Browse files
authored
build(kokoro): run docker as user node (#358)
* build(kokoro): run docker as user node * set npm config prefix to a dir. accessible by user `node`, so npm link works
1 parent 41559c8 commit d58023b

12 files changed

Lines changed: 17 additions & 7 deletions

File tree

handwritten/storage/.kokoro/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:10"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/continuous/node10/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:10"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/continuous/node6/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:6"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:6-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/continuous/node8/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:8"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/docs.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
set -xeo pipefail
1818

19+
export NPM_CONFIG_PREFIX=/home/node/.npm-global
20+
1921
cd $(dirname $0)/..
2022

2123
npm install

handwritten/storage/.kokoro/lint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
set -xeo pipefail
1818

19+
export NPM_CONFIG_PREFIX=/home/node/.npm-global
20+
1921
cd $(dirname $0)/..
2022

2123
npm install

handwritten/storage/.kokoro/presubmit/node10/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:10"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/presubmit/node6/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:6"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:6-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/presubmit/node8/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build_file: "nodejs-storage/.kokoro/trampoline.sh"
1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/node:8"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"

handwritten/storage/.kokoro/samples-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
set -xeo pipefail
1818

19+
export NPM_CONFIG_PREFIX=/home/node/.npm-global
20+
1921
# Setup service account credentials.
2022
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
2123
export GCLOUD_PROJECT=long-door-651

0 commit comments

Comments
 (0)