Skip to content

Commit

Permalink
chore: run circle as non-root user (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored and stephenplusplus committed Jan 31, 2018
1 parent 5e10a2a commit 28a0513
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions packages/google-privacy-dlp/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
node4:
docker:
- image: node:4
user: node
steps:
- checkout
- run:
Expand All @@ -106,44 +107,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 @google-cloud/dlp
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 @@ -156,6 +170,7 @@ jobs:
sample_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -167,30 +182,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 @google-cloud/dlp
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/dlp/.circleci/key.json
GOOGLE_APPLICATION_CREDENTIALS: /home/node/dlp-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/dlp/
working_directory: /home/node/dlp-samples

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

0 comments on commit 28a0513

Please sign in to comment.