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'
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
0 commit comments