Skip to content

Commit

Permalink
added Dockerfile, updated circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
Kate Brune committed Dec 31, 2020
1 parent cc000c2 commit 58db2f9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# test
version: 2.1
orbs:
node: circleci/[email protected]
jobs:
build-test-and-notify:
executor:
name: node/default
build-and-test:
machine:
image: ubuntu-1604:202007-01
steps:
- checkout
- run:
name: Install dependencies
command: npm install
name: Build
command: docker build -t moodqueue .
- run:
name: "Unit Test"
command: npm test --collectCoverage=true --max-workers=1
environment:
NODE_OPTIONS: --max_old_space_size=8192
name: Unit Test
command: docker run -e CI=true moodqueue yarn test:coverage
- run:
name: Copy Artifacts
command: id=$(docker create moodqueue) && docker cp $id:/usr/src/coverage/ . && docker rm -v $id
- store_artifacts:
path: coverage
workflows:
build:
jobs:
- build-test-and-notify
- build-and-test
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# base image
FROM node:alpine

WORKDIR /usr/src

COPY package.json .
ENV NODE=ENV=ci

RUN yarn install

COPY . .
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:watch": "jest -watch",
"test:coverage": "jest --collectCoverage",
"cy:open": "cypress open",
"preinstall": "if test \"$NODE_ENV\" != \"production\" ; then git config core.hooksPath hooks; fi",
"preinstall": "if test \"$NODE_ENV\" != \"production\" && \"$NODE_ENV\" != \"ci\" ; then git config core.hooksPath hooks; fi",
"storybook": "start-storybook -p 6006 -c .storybook",
"build-storybook": "build-storybook"
},
Expand All @@ -37,6 +37,11 @@
"coverageReporters": [
"json",
"html"
],
"testPathIgnorePatterns": [
"<rootDir>/.next",
"<rootDir>/.circleci",
"<rootDir>/.storybook"
]
},
"dependencies": {
Expand Down Expand Up @@ -71,7 +76,6 @@
"@types/react": "^16.9.43",
"babel-loader": "^8.1.0",
"babel-preset-react-app": "^9.1.2",
"cypress": "^5.0.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"husky": "^4.2.5",
Expand Down

0 comments on commit 58db2f9

Please sign in to comment.