@@ -59,16 +59,17 @@ jobs:
59
59
- image : ' node:6'
60
60
user : node
61
61
steps : &unit_tests_steps
62
- - checkout
62
+ - checkout
63
63
- run : &npm_install_and_link
64
64
name : Install and link the module
65
65
command : |-
66
66
mkdir -p /home/node/.npm-global
67
- npm install
67
+ ./.circleci/ npm- install-retry.js
68
68
environment :
69
69
NPM_CONFIG_PREFIX : /home/node/.npm-global
70
70
- run : npm test
71
71
- run : node_modules/.bin/codecov
72
+
72
73
node8 :
73
74
docker :
74
75
- image : ' node:8'
81
82
steps : *unit_tests_steps
82
83
lint :
83
84
docker :
84
- - image : ' node:10 '
85
+ - image : ' node:8 '
85
86
user : node
86
87
steps :
87
88
- checkout
90
91
name : Link the module being tested to the samples.
91
92
command : |
92
93
cd samples/
93
- npm install
94
94
npm link ../
95
+ ./../.circleci/npm-install-retry.js
95
96
environment :
96
97
NPM_CONFIG_PREFIX : /home/node/.npm-global
97
98
- run :
@@ -101,52 +102,57 @@ jobs:
101
102
NPM_CONFIG_PREFIX : /home/node/.npm-global
102
103
docs :
103
104
docker :
104
- - image : ' node:10 '
105
+ - image : ' node:8 '
105
106
user : node
106
107
steps :
107
108
- checkout
108
109
- run : *npm_install_and_link
109
- - run :
110
- name : Build documentation.
111
- command : npm run docs
110
+ - run : npm run docs
112
111
sample_tests :
113
112
docker :
114
- - image : ' node:10 '
113
+ - image : ' node:8 '
115
114
user : node
116
115
steps :
117
116
- checkout
118
117
- run :
119
118
name : Decrypt credentials.
120
119
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 \
122
122
-out .circleci/key.json \
123
123
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
124
+ fi
124
125
- run : *npm_install_and_link
125
126
- run : *samples_npm_install_and_link
126
127
- run :
127
128
name : Run sample tests.
128
129
command : npm run samples-test
129
130
environment :
130
- NPM_CONFIG_PREFIX : /home/node/.npm-global
131
131
GCLOUD_PROJECT : long-door-651
132
- GOOGLE_APPLICATION_CREDENTIALS : /home/node/compute-samples/.circleci/key.json
132
+ GOOGLE_APPLICATION_CREDENTIALS : /home/node/samples/.circleci/key.json
133
+ NPM_CONFIG_PREFIX : /home/node/.npm-global
133
134
- run :
134
135
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
136
140
when : always
137
- working_directory : /home/node/compute- samples
141
+ working_directory : /home/node/samples/
138
142
system_tests :
139
143
docker :
140
- - image : ' node:10 '
144
+ - image : ' node:8 '
141
145
user : node
142
146
steps :
143
147
- checkout
144
148
- run :
145
149
name : Decrypt credentials.
146
150
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 \
148
153
-out .circleci/key.json \
149
154
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
155
+ fi
150
156
- run : *npm_install_and_link
151
157
- run :
152
158
name : Run system tests.
@@ -155,13 +161,17 @@ jobs:
155
161
GOOGLE_APPLICATION_CREDENTIALS : .circleci/key.json
156
162
- run :
157
163
name : Remove unencrypted key.
158
- command : rm .circleci/key.json
164
+ command : |
165
+ if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
166
+ rm .circleci/key.json
167
+ fi
159
168
when : always
160
169
publish_npm :
161
170
docker :
162
- - image : ' node:10 '
171
+ - image : ' node:8 '
163
172
user : node
164
173
steps :
165
174
- checkout
166
- - run : ' echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
167
- - run : npm publish
175
+ - run : ./.circleci/npm-install-retry.js
176
+ - run : echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
177
+ - run : npm publish --access=public
0 commit comments