From c10e2830f5db931b0b8853ef5ea1092de1e82a08 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Tue, 3 Jan 2023 05:05:12 +0200 Subject: [PATCH] Add a buildbot dir and a script for local testing --- .buildbot/node/Dockerfile | 13 +++++++++++++ .buildbot/node/build.sh | 6 ++++++ .buildbot/node/test.sh | 3 +++ docker-test.sh | 3 +++ 4 files changed, 25 insertions(+) create mode 100644 .buildbot/node/Dockerfile create mode 100644 .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..22b48ab --- /dev/null +++ b/.buildbot/node/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16 + +RUN apt-get update +RUN apt-get install -yq --no-install-suggests --no-install-recommends xauth xvfb + +WORKDIR /app +ADD src ./src +COPY package*.json binding.gyp ./ + +RUN npm install +# RUN npm audit fix + +COPY . . diff --git a/.buildbot/node/build.sh b/.buildbot/node/build.sh new file mode 100644 index 0000000..da381c9 --- /dev/null +++ b/.buildbot/node/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +mkdir -p ../out +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..a752603 --- /dev/null +++ b/docker-test.sh @@ -0,0 +1,3 @@ +#!/bin/sh +docker build --tag bitmessage-js -f .buildbot/node/Dockerfile . +docker run -it --rm bitmessage-js:latest .buildbot/node/test.sh