Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
run circleci as non-root user
Browse files Browse the repository at this point in the history
It saves several minutes per CI task because it keeps recompiling `grpc` being unable to unpack it. Some details [here](ForbesLindesay-Unmaintained/tar-pack#35).
  • Loading branch information
alexander-fenster authored Feb 14, 2018
1 parent f2b5c09 commit bbf7b00
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
node4:
docker:
- image: node:4
user: node
steps:
- checkout
- run:
Expand All @@ -98,44 +99,57 @@ jobs:
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 -p /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: |
cd samples/
npm link dialogflow
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:
Expand All @@ -148,6 +162,7 @@ jobs:
sample_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -159,30 +174,37 @@ jobs:
- run:
name: Install and link the module.
command: |
mkdir -p /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: |
cd samples/
npm link dialogflow
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/dialogflow/.circleci/key.json
GOOGLE_APPLICATION_CREDENTIALS: /home/node/dialogflow-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/dialogflow/
working_directory: /home/node/dialogflow-samples

system_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -207,6 +229,7 @@ jobs:
publish_npm:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand Down

0 comments on commit bbf7b00

Please sign in to comment.