Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating project #767

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ permissions:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: install mongodb tools
run: sudo apt-get install -y mongodb-org-shell
- name: Setup mongo tools
uses: boly38/action-mongo-tools@stable
- name: install dependencies
run: npm ci
- name: run unit tests
Expand Down Expand Up @@ -65,6 +65,12 @@ jobs:
# Artifact name
name: coverage-report-${{ matrix.node-version }}
path: coverage/lcov-report/**
- uses: actions/upload-artifact@v4
if: success() || failure() # run this step even if previous step failed
with:
# Artifact name
name: npm-logs-${{ matrix.node-version }}
path: /home/runner/.npm/_logs
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ---- Base Node ----
FROM node:14-stretch AS base
FROM node:20-bullseye AS base

# ---- Dependencies ----
FROM base AS dependencies
Expand All @@ -16,7 +16,7 @@ WORKDIR /app
COPY app ./app

## ---- UI ----
FROM base AS ui
FROM node:14-stretch AS ui
WORKDIR /app
RUN git config --global url."https://github.com/".insteadOf git://github.com/ \
&& git clone --depth=1 https://github.com/OpenTMI/opentmi-default-gui.git . \
Expand All @@ -25,7 +25,7 @@ RUN git config --global url."https://github.com/".insteadOf git://github.com/ \
&& rm -r node_modules

# --- Release with Alpine ----
FROM node:14-alpine AS release
FROM node:20-alpine AS release
WORKDIR /app
RUN apk add --no-cache git
# copy package.json
Expand Down
2 changes: 1 addition & 1 deletion app/config.defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"port": 8000,
"webtoken": "OpenTMI-toP-SeCRet-tOKEn",
"webtokenExpirationDays": 5,
"db": "mongodb://localhost/opentmi",
"db": "mongodb://127.0.0.1/opentmi",
"filedb": "./data",
"auto-reload": false,
"autoInstallAddonDeps": false,
Expand Down
4 changes: 2 additions & 2 deletions app/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const config = require('./tools/config');
let dbUrl = config.get('db');
const dbOptions = config.get('mongo') || {};
mongoose.Promise = Promise;
mongoose.set('strictQuery', true);

let mongoServer = null;
let tearingDown = false;
Expand All @@ -24,13 +25,12 @@ const initialize = async function () {

const connect = async function () {
const must = {
logger: logger.info.bind(logger),
useNewUrlParser: true,
useUnifiedTopology: true
};
const overwritable = {
appname: 'opentmi',
loggerLevel: 'info'
loggerLevel: 'info',
};
const options = _.merge(overwritable, dbOptions, must);

Expand Down
Loading
Loading