diff --git a/.circleci/config.yml b/.circleci/config.yml index db2b29555..ca57ecf47 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,34 +92,43 @@ jobs: node4: docker: - image: node:4 + user: node <<: *unit_tests node6: docker: - image: node:6 + user: node <<: *unit_tests node7: docker: - image: node:7 + user: node <<: *unit_tests node8: docker: - image: node:8 + user: node <<: *unit_tests node9: docker: - image: node:9 + user: node <<: *unit_tests lint: docker: - image: node:8 + user: node steps: - checkout - run: name: Install modules and dependencies. command: | + mkdir /home/node/.npm-global npm install npm link + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Link the module being tested to the samples. command: | @@ -127,13 +136,18 @@ jobs: npm link @google-cloud/storage npm install cd .. + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Run linting. command: npm run lint + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global docs: docker: - image: node:8 + user: node steps: - checkout - run: @@ -146,6 +160,7 @@ jobs: sample_tests: docker: - image: node:8 + user: node steps: - checkout - run: @@ -157,8 +172,11 @@ jobs: - run: name: Install and link the module. command: | + mkdir /home/node/.npm-global npm install npm link + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Link the module being tested to the samples. command: | @@ -166,21 +184,25 @@ jobs: npm link @google-cloud/storage npm install cd .. + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Run sample tests. command: npm run samples-test environment: GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /var/storage/.circleci/key.json + GOOGLE_APPLICATION_CREDENTIALS: /home/node/storage-samples/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Remove unencrypted key. command: rm .circleci/key.json when: always - working_directory: /var/storage/ + working_directory: /home/node/storage-samples system_tests: docker: - image: node:8 + user: node steps: - checkout - run: @@ -213,6 +235,7 @@ jobs: publish_npm: docker: - image: node:8 + user: node steps: - checkout - run: