test:docker locally.

This commit is contained in:
i544693 2021-12-10 01:55:30 +08:00
parent cefe3f87e6
commit 1a836c9479
2 changed files with 16 additions and 1 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM mcr.microsoft.com/playwright:focal
WORKDIR /app
COPY . .
RUN rm package-lock.json
RUN npm install
RUN npx playwright install
RUN npm run build
ENTRYPOINT ["npm", "run"]
CMD ["test"]

View File

@ -43,7 +43,13 @@
"prepare": "npm run build",
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
"pub": "sh build/release.sh",
"postinstall": "opencollective-postinstall"
"postinstall": "opencollective-postinstall",
"docker:build": "docker build -f Dockerfile -t docsify-test:local .",
"docker:clean": "docker rmi docsify-test:local",
"docker:test": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test",
"docker:test:e2e": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test:e2e",
"docker:test:integration": "docker run --rm -it --ipc=host --user pwuser ddocsify-test:local test:integration",
"docker:test:unit": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test:unit"
},
"husky": {
"hooks": {