@@ -117,9 +117,11 @@ jobs:
117117 - run :
118118 name : Decrypt credentials.
119119 command : |
120- 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 \
121122 -out .circleci/key.json \
122123 -k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
124+ fi
123125 - run : *npm_install_and_link
124126 - run : *samples_npm_install_and_link
125127 - run :
@@ -131,7 +133,10 @@ jobs:
131133 NPM_CONFIG_PREFIX : /home/node/.npm-global
132134 - run :
133135 name : Remove unencrypted key.
134- command : rm .circleci/key.json
136+ command : |
137+ if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
138+ rm .circleci/key.json
139+ fi
135140 when : always
136141 working_directory : /home/node/samples/
137142 system_tests :
@@ -143,9 +148,11 @@ jobs:
143148 - run :
144149 name : Decrypt credentials.
145150 command : |
146- 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 \
147153 -out .circleci/key.json \
148154 -k "${SYSTEM_TESTS_ENCRYPTION_KEY}"
155+ fi
149156 - run : *npm_install_and_link
150157 - run :
151158 name : Run system tests.
@@ -154,14 +161,17 @@ jobs:
154161 GOOGLE_APPLICATION_CREDENTIALS : .circleci/key.json
155162 - run :
156163 name : Remove unencrypted key.
157- command : rm .circleci/key.json
164+ command : |
165+ if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then
166+ rm .circleci/key.json
167+ fi
158168 when : always
159169 publish_npm :
160170 docker :
161171 - image : ' node:8'
162172 user : node
163173 steps :
164174 - checkout
165- - npm install
175+ - run : npm install
166176 - run : echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
167177 - run : npm publish --access=public
0 commit comments