Skip to content

Commit

Permalink
Use docker for linting and building (#52)
Browse files Browse the repository at this point in the history
* Use docker for build stage

* Tweak
  • Loading branch information
pcothenet authored Nov 10, 2021
1 parent 8ab0f68 commit 4526ff4
Show file tree
Hide file tree
Showing 4 changed files with 839 additions and 1,028 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.4.0
16.13.0
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:16.13 AS base


FROM base AS build

WORKDIR /data
ENTRYPOINT [ "npm", "install"]


FROM base AS lint

WORKDIR /data

ENTRYPOINT [ "npx", "prettier", "--write" ]

13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
SHELL = /bin/bash

build:
npm install && \
npx prettier --write . && \
npm run build
build: install lint

install:
docker build --target build . -t patch-node-build && \
docker run --rm -v $(PWD):/data patch-node-build

lint:
docker build --target lint . -t patch-node-lint && \
docker run --rm -v $(PWD):/data patch-node-lint .

test:
npm run test
Expand Down
Loading

0 comments on commit 4526ff4

Please sign in to comment.