From 7946c2ff2e287e516ceeafa2ea64f098a665f6e6 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Fri, 23 Dec 2022 23:21:06 +0200 Subject: [PATCH] Try to run the existing tests in buildbot, docker-test.sh - is an alternative script to run locally. --- .buildbot/node/Dockerfile | 14 ++++++++++++++ .buildbot/node/build.sh | 5 +++++ .buildbot/node/test.sh | 3 +++ docker-test.sh | 3 +++ 4 files changed, 25 insertions(+) create mode 100644 .buildbot/node/Dockerfile create mode 100755 .buildbot/node/build.sh create mode 100755 .buildbot/node/test.sh create mode 100755 docker-test.sh diff --git a/.buildbot/node/Dockerfile b/.buildbot/node/Dockerfile new file mode 100644 index 0000000..6c9dde4 --- /dev/null +++ b/.buildbot/node/Dockerfile @@ -0,0 +1,14 @@ +FROM node:16 + +RUN apt-get update +RUN apt-get install -yq --no-install-suggests --no-install-recommends xauth xvfb + +WORKDIR /app +COPY package*.json binding.gyp *.cc ./ + +RUN npm install +RUN npm audit fix + +RUN mkdir -p ../out + +COPY . . diff --git a/.buildbot/node/build.sh b/.buildbot/node/build.sh new file mode 100755 index 0000000..1d8a062 --- /dev/null +++ b/.buildbot/node/build.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cp package*.json ../out + +npm pack && mv *.tgz ../out/ diff --git a/.buildbot/node/test.sh b/.buildbot/node/test.sh new file mode 100755 index 0000000..b41801e --- /dev/null +++ b/.buildbot/node/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +npm test diff --git a/docker-test.sh b/docker-test.sh new file mode 100755 index 0000000..0057d6b --- /dev/null +++ b/docker-test.sh @@ -0,0 +1,3 @@ +#!/bin/sh +docker build --tag eccrypto -f .buildbot/node/Dockerfile . +docker run -it --rm eccrypto:latest .buildbot/node/test.sh