Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit e46f69e

Browse files
Add synth script and run it (#351)
1 parent bba96fc commit e46f69e

32 files changed

Lines changed: 415 additions & 27 deletions

.circleci/config.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
NPM_CONFIG_PREFIX: /home/node/.npm-global
7070
- run: npm test
7171
- run: node_modules/.bin/codecov
72+
7273
node8:
7374
docker:
7475
- image: 'node:8'
@@ -96,7 +97,7 @@ jobs:
9697
NPM_CONFIG_PREFIX: /home/node/.npm-global
9798
- run:
9899
name: Run linting.
99-
command: npm run check
100+
command: npm run lint
100101
environment:
101102
NPM_CONFIG_PREFIX: /home/node/.npm-global
102103
docs:
@@ -106,9 +107,7 @@ jobs:
106107
steps:
107108
- checkout
108109
- run: *npm_install_and_link
109-
- run:
110-
name: Build documentation.
111-
command: npm run docs
110+
- run: npm run docs
112111
sample_tests:
113112
docker:
114113
- image: 'node:8'
@@ -118,23 +117,28 @@ jobs:
118117
- run:
119118
name: Decrypt credentials.
120119
command: |
121-
openssl aes-256-cbc -d -in .circleci/key.json.enc \
120+
if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
121+
openssl aes-256-cbc -d -in .circleci/key.json.enc \
122122
-out .circleci/key.json \
123123
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
124+
fi
124125
- run: *npm_install_and_link
125126
- run: *samples_npm_install_and_link
126127
- run:
127128
name: Run sample tests.
128129
command: npm run samples-test
129130
environment:
130131
GCLOUD_PROJECT: long-door-651
131-
GOOGLE_APPLICATION_CREDENTIALS: /home/node/storage-samples/.circleci/key.json
132+
GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json
132133
NPM_CONFIG_PREFIX: /home/node/.npm-global
133134
- run:
134135
name: Remove unencrypted key.
135-
command: rm .circleci/key.json
136+
command: |
137+
if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
138+
rm .circleci/key.json
139+
fi
136140
when: always
137-
working_directory: /home/node/storage-samples
141+
working_directory: /home/node/samples/
138142
system_tests:
139143
docker:
140144
- image: 'node:8'
@@ -144,32 +148,30 @@ jobs:
144148
- run:
145149
name: Decrypt credentials.
146150
command: |
147-
openssl aes-256-cbc -d -in .circleci/key.json.enc \
151+
if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
152+
openssl aes-256-cbc -d -in .circleci/key.json.enc \
148153
-out .circleci/key.json \
149154
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
150-
- run:
151-
name: Decrypt second account credentials (storage-specific).
152-
command: |
153-
openssl aes-256-cbc -d -in .circleci/no-whitelist-key.json.enc \
154-
-out .circleci/no-whitelist-key.json \
155-
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
155+
fi
156156
- run: *npm_install_and_link
157157
- run:
158158
name: Run system tests.
159159
command: npm run system-test
160160
environment:
161-
GCN_STORAGE_2ND_PROJECT_ID: gcloud-node-whitelist-ci-tests
162-
GCN_STORAGE_2ND_PROJECT_KEY: .circleci/no-whitelist-key.json
163161
GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json
164162
- run:
165163
name: Remove unencrypted key.
166-
command: rm .circleci/key.json
164+
command: |
165+
if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
166+
rm .circleci/key.json
167+
fi
167168
when: always
168169
publish_npm:
169170
docker:
170171
- image: 'node:8'
171172
user: node
172173
steps:
173174
- checkout
174-
- run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
175+
- run: npm install
176+
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
175177
- run: npm publish --access=public

.jsdoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright 2017 Google Inc. All Rights Reserved.
2+
* Copyright 2018 Google LLC. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ module.exports = {
3636
includePattern: '\\.js$'
3737
},
3838
templates: {
39-
copyright: 'Copyright 2017 Google, Inc.',
39+
copyright: 'Copyright 2018 Google, LLC.',
4040
includeDate: false,
4141
sourceFiles: false,
4242
systemName: '@google-cloud/storage',

.kokoro/common.cfg

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# Format: //devtools/kokoro/config/proto/build.proto
22

3-
# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR}
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Download trampoline resources.
411
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
512

6-
# All builds use the trampoline script to run in docker.
7-
build_file: "google-cloud-node-storage/.kokoro/trampoline.sh"
13+
# Use the trampoline script to run in docker.
14+
build_file: "nodejs-storage/.kokoro/trampoline.sh"
815

916
# Configure the docker image for kokoro-trampoline.
1017
env_vars: {
1118
key: "TRAMPOLINE_IMAGE"
12-
value: "node:8"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10"
20+
}
21+
env_vars: {
22+
key: "TRAMPOLINE_BUILD_FILE"
23+
value: "github/nodejs-storage/.kokoro/test.sh"
1324
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Download trampoline resources.
11+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
12+
13+
# Use the trampoline script to run in docker.
14+
build_file: "nodejs-storage/.kokoro/trampoline.sh"
15+
16+
# Configure the docker image for kokoro-trampoline.
17+
env_vars: {
18+
key: "TRAMPOLINE_IMAGE"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10"
20+
}
21+
env_vars: {
22+
key: "TRAMPOLINE_BUILD_FILE"
23+
value: "github/nodejs-storage/.kokoro/test.sh"
24+
}

.kokoro/continuous/node10/test.cfg

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Download trampoline resources.
11+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
12+
13+
# Use the trampoline script to run in docker.
14+
build_file: "nodejs-storage/.kokoro/trampoline.sh"
15+
16+
# Configure the docker image for kokoro-trampoline.
17+
env_vars: {
18+
key: "TRAMPOLINE_IMAGE"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:6"
20+
}
21+
env_vars: {
22+
key: "TRAMPOLINE_BUILD_FILE"
23+
value: "github/nodejs-storage/.kokoro/test.sh"
24+
}

.kokoro/continuous/node6/test.cfg

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Download trampoline resources.
11+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
12+
13+
# Use the trampoline script to run in docker.
14+
build_file: "nodejs-storage/.kokoro/trampoline.sh"
15+
16+
# Configure the docker image for kokoro-trampoline.
17+
env_vars: {
18+
key: "TRAMPOLINE_IMAGE"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/node:8"
20+
}
21+
env_vars: {
22+
key: "TRAMPOLINE_BUILD_FILE"
23+
value: "github/nodejs-storage/.kokoro/test.sh"
24+
}

.kokoro/continuous/node8/docs.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
env_vars: {
2+
key: "TRAMPOLINE_BUILD_FILE"
3+
value: "github/nodejs-storage/.kokoro/docs.sh"
4+
}

.kokoro/continuous/node8/lint.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
env_vars: {
2+
key: "TRAMPOLINE_BUILD_FILE"
3+
value: "github/nodejs-storage/.kokoro/lint.sh"
4+
}

0 commit comments

Comments
 (0)