Skip to content

Commit

Permalink
Merge pull request #9 from Trickfilm400/7-mqtt-support
Browse files Browse the repository at this point in the history
Added mqtt support, winston logger, bug fixes, ci pipeline, dependency updates
  • Loading branch information
Trickfilm400 authored Mar 10, 2022
2 parents bccd10c + 2824742 commit 2108a5a
Show file tree
Hide file tree
Showing 16 changed files with 2,487 additions and 1,361 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node-test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}


jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
# - run: npm run build --if-present
- run: npm test
build:
needs: test

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
tags: |
type=sha,prefix=sha-
type=ref,event=branch
type=raw,value=latest
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine3.14 AS builder
FROM node:16-alpine3.15 AS builder

WORKDIR /build

Expand All @@ -8,7 +8,7 @@ RUN npm ci
RUN npm run build
RUN npm ci --only=production

FROM node:14-alpine3.14
FROM node:16-alpine3.15

MAINTAINER Trickfilm400, [email protected]

Expand Down
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Get Data from Vantage Pro Weatherstation from Davis Instruments via telnet conne
2. Configuration with environment variables (mostly for docker / kubernetes)

#### `config.json`
````json
````json5
{
"vantage": {
"url": "192.168.178.xxx" //REQUIRED, default ""
Expand Down Expand Up @@ -91,7 +91,7 @@ The Packages have the following structure:

if healthcheck is ok (HTTP Statuscode: 200):

```json
```json5
{
"message": "Packages are valid",
"code": 200,
Expand All @@ -101,7 +101,7 @@ if healthcheck is ok (HTTP Statuscode: 200):

if healthcheck is **not valid**: (HTTP Statuscode: 500)

```json
```json5
{
"message": "Packages are outdated and invalid!",
"code": 500,
Expand Down
Loading

0 comments on commit 2108a5a

Please sign in to comment.