Skip to content

Commit

Permalink
Node-RED: add minimal configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Guenther Meyer <g.meyer@signum-media.de>
  • Loading branch information
d-s-e committed Sep 7, 2023
1 parent 98edf59 commit 108c694
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/docker-build-publish-node-red.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# /********************************************************************************
# * Copyright (c) 2023 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: Node-RED

on:
workflow_dispatch:
workflow_call:
pull_request:
paths:
- ".github/workflows/docker-build-publish-node-red.yml"
- "node-red/**"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/leda-example-node-red

jobs:
build:
name: "Build multi-arch image"
runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# # This is used to complete the identity challenge
# # with sigstore/fulcio when running outside of PRs.
# id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup QEMU buildx
uses: docker/setup-qemu-action@v2

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
push: true
context: ./node-red/
file: ./node-red/Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ The **[Kuksa CarSim](kuksa-carsim)** example is based on [Kuksa.VAL Services](ht
It provides simulated physical motion telemetry of a moving vehicle to the [Databroker](https://github.com/eclipse/kuksa.val/tree/master/kuksa_databroker).
The databroker is an in-vehicle, in-memory database for signal information. Signal formats are standardized in the [Vehicle Signal Specification](https://github.com/COVESA/vehicle_signal_specification).

### Node-RED

*... TODO ...*

## Contributing

If you want to contribute bug reports or feature requests, please use *GitHub Issues*.
Expand Down
27 changes: 27 additions & 0 deletions node-red/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# /********************************************************************************
# * Copyright (c) 2023 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/


FROM nodered/node-red
# FROM nodered/node-red:latest-debian

COPY package.json .
RUN npm install --unsafe-perm --no-update-notifier --no-fund --only=production

# Copy _your_ Node-RED project files into place
# NOTE: This will only work if you DO NOT later mount /data as an external volume.
# If you need to use an external volume for persistence then
# copy your settings and flows files to that volume instead.
# COPY settings.js /data/settings.js
# COPY flows_cred.json /data/flows_cred.json
# COPY flows.json /data/flows.json
1 change: 1 addition & 0 deletions node-red/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*... TODO ...*
14 changes: 14 additions & 0 deletions node-red/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "sdv-node-red-examples",
"version": "0.0.1",
"description": "SDV example setup for node-RED",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"node-red": "3.0.2",
"node-red-dashboard": "3.6.0"
}
}

0 comments on commit 108c694

Please sign in to comment.