Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into deps-and-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Mcl committed Aug 28, 2024
2 parents 5b519b3 + 4868f09 commit bec9e8f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 16 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,47 @@ jobs:
matrix:
node-version: [16, 18]

services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1433:1433
options: >-
--health-cmd "exit 0"
--health-interval 10s
--health-timeout 10s
--health-retries 5
env:
SA_PASSWORD: "P@ssw0rdP@ssw0rd"
ACCEPT_EULA: "Y"

steps:
- uses: actions/checkout@v4

- name: config
run: cp .env.dev .env

- uses: isbang/[email protected]
with:
services: mssql
- name: Wait for SQL Server to be ready
run: |
for i in {1..30}; do
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssw0rdP@ssw0rd -Q "SELECT 1" && break
sleep 1
done
# - name: Start MSSQL containers
# working-directory: ./
# run: docker-compose up -d mssql
- name: Create database
run: |
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssw0rdP@ssw0rd -Q "CREATE DATABASE testdb"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# cache: npm

- name: npm install and test
- name: npm install
run: |
cp ./test/_config.docker.json ./test/config.json
cp ./test/_config.github.json ./test/config.json
npm install
npm test
- name: npm test
run: npm test
13 changes: 10 additions & 3 deletions README_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cp .env.dev .env

```shell
docker compose build --no-cache --pull
docker-compose up -d mssql
docker compose up -d mssql
```

```shell
Expand All @@ -42,13 +42,20 @@ run node-red and mssql use docker

```shell
docker compose build --no-cache
docker-compose up -d
docker compose up -d
```

```shell
docker compose exec nodered npm install node-red-contrib-mssql-plus-mssql
docker compose exec nodered npm install [email protected]
docker compose exec nodered npm install /workspace/node-red-contrib-mssql-plus-mssql
docker compose restart nodered
```

view node-red container log output

```shell
docker-compose logs -f node-red
docker compose logs -f node-red
```

Open `http://127.0.0.1:1880`
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version: "3"

services:

nodered:
image: nodered/node-red
# image: nodered/node-red
build:
context: ./docker/nodered
environment:
- TZ=${TZ}
ports:
- 1880:1880
- 9229:9229
volumes:
- .:/workspace
- .:/workspace/node-red-contrib-mssql-plus-mssql
depends_on:
- mssql

Expand Down
5 changes: 5 additions & 0 deletions docker/nodered/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nodered/node-red:latest-18

WORKDIR /usr/src/node-red

RUN npm install node-red-contrib-inspector
14 changes: 14 additions & 0 deletions test/_config.github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"server": "localhost",
"port": 1433,
"username": "sa",
"password": "P@ssw0rdP@ssw0rd",
"database": "testdb",
"encyption": false,
"tdsVersion": "7_4",
"trustServerCertificate": true,
"useUTC": true,
"connectTimeout": 15000,
"requestTimeout": 15000,
"cancelTimeout": 5000
}

0 comments on commit bec9e8f

Please sign in to comment.