diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03ee507..9450ec7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,4 +14,4 @@ jobs: - name: Install & lint run: npm install && npm run ci-lint - name: Run tests against InfluxDb2 - run: docker-compose run plugintest \ No newline at end of file + run: npm run test diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c67cb64..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -ARG NODE_VERSION=16 -FROM node:$NODE_VERSION - - -WORKDIR /plugin -RUN chown node:node /plugin - -USER node - -COPY --chown=node:node package.json ./ - -RUN npm install --quiet - -COPY marker ./marker -COPY --chown=node:node tsconfig.json ./ -COPY src ./src -COPY generate-schema ./ - -RUN npm run build - -ENTRYPOINT npm run mocha \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0b9431b..2616148 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,5 @@ version: '2' services: - plugintest: - build: . - depends_on: - - influxdb - environment: - - INFLUX_HOST=influx2 influxdb: container_name: influx2 image: "influxdb:2.3" @@ -19,5 +13,4 @@ services: - DOCKER_INFLUXDB_INIT_PASSWORD=klangisklangis - DOCKER_INFLUXDB_INIT_ORG=signalk_org - DOCKER_INFLUXDB_INIT_BUCKET=signalk_bucket - # - DOCKER_INFLUXDB_INIT_RETENTION: The duration the system's initial bucket should retain data. If not set, the initial bucket will retain data forever. - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=signalk_token diff --git a/package.json b/package.json index b0e7ad7..fcb5041 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "author": "Teppo Kurki ", "repository": "https://github.com/tkurki/signalk-to-influxdb2", "scripts": { - "test": "docker-compose run plugintest", - "mocha": "mocha --require ts-node/register --extensions ts src/*.test.ts --timeout 5000", + "test": "docker compose up -d && npm run build && npm run mocha", + "mocha": "mocha --require ts-node/register --extensions ts src/*.test.ts --timeout 5000 --exit", "lint:only": "eslint src --ext .ts", "prettier": "prettier -w src/", "lint": "eslint -c .eslintrc.js --ext .ts --ext .js --fix src/",