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

Docker and Actions Creations #32

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
502c7cb
Create Resources to build dockerfile.
kd9lsv Jan 2, 2023
ec52522
Create Workflows to help automate CI/CD integrations.
kd9lsv Jan 2, 2023
c129ab0
Correct File name typo.
kd9lsv Jan 2, 2023
c27fc5e
Add Node-Red to dependencies.
kd9lsv Jan 2, 2023
0c2b98e
Upload settings.js for NodeRed
kd9lsv Jul 21, 2022
a933dc5
Initial Upload for Contesting Script.
kd9lsv Jul 21, 2022
17d97b6
Fix for clear wording up. & Home Directory
kd9lsv Aug 4, 2022
4bfac79
Add Progress bar
kd9lsv Sep 26, 2022
f472229
logic error fix
kd9lsv Sep 26, 2022
0787fed
Add Wait command for SQLITE
kd9lsv Sep 26, 2022
3bb7d7f
Split Schema and able to Update to latest version
kd9lsv Oct 1, 2022
1e72b09
Kill progress bar.
kd9lsv Oct 1, 2022
8fabfcd
install git and Sqlite fix.
kd9lsv Oct 1, 2022
2a4d125
Update SQLITE and git regardless of node-red.
kd9lsv Oct 1, 2022
5b21446
Moved Progress Bars.
kd9lsv Oct 1, 2022
24e0f53
Relative to Absolute Paths.
kd9lsv Oct 1, 2022
754a4ac
Git Pull to Null
kd9lsv Oct 1, 2022
5f94c32
Allow git to pull without any issues.
kd9lsv Oct 26, 2022
87349c5
Changed to enable from restart
kd9lsv Nov 5, 2022
ca7c71b
update on command.
kd9lsv Nov 5, 2022
d2043dd
Linked settings file directly to github.
kd9lsv Nov 16, 2022
1cdd753
Update Context Storage Enable (#7)
kylekrieg Dec 30, 2022
96e2519
Modified Install script and create assoicated docker-compose.
kd9lsv Jan 1, 2023
2f3fdd4
Moved script to Main Repo.
kd9lsv Jan 2, 2023
3667982
Add Watchtower to Docker-Compose.
kd9lsv Jan 2, 2023
2b996b2
Update Docker-Compose and Script
kd9lsv Jan 2, 2023
86d86d5
Merge branch 'master' into docker
kd9lsv Aug 12, 2023
5147c15
Remove 32bit Arm
kd9lsv Aug 12, 2023
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: 18 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hello. Thanks for submitting an issue about the Node-Red Contesting Dashboard. Please give the team some time to triage and reply with a more detailed response. \n 73, \n Connor KD9LSV"
pr-message: "Thank you for submitting a pull request. A notification has been sent to the team to review your work and see if it is adaquate for us to merge into the project. If we have any questions, we will reach out. Please be patience with the status of the PR.\n 73,\n Connor KD9LSV"

88 changes: 88 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This is a basic workflow to help you get started with Actions

name: Docker Build

# Controls when the action will run.
on:
release:
types: [released]
pull_request:
branches:
- 'master'
- 'dev'


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
env:
# Setting the defaults up front
LATEST_NODE: 16
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
runs-on: ubuntu-latest

strategy:
matrix:
node: [16, 18]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
-
name: Checkout
uses: actions/checkout@v3
- name: Show Env
run: env
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
flavor: |
latest=auto
suffix=-${{matrix.node}}
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{raw}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=semver,pattern=v{{major}}.{{minor}}

-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
-
name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Get Date
id: date
run: echo "dateval=$(date +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: build-push
uses: docker/build-push-action@v3
continue-on-error: true
with:
context: .
platforms: linux/amd64, linux/arm64
file: docker/Dockerfile
build-args: |
NODE_VERSION=${{ matrix.node }}
BUILD_DATE=${{ env.dateval }}
BUILD_REF=${{ github.ref_name }}
CONTEST_DASHBOARD_VERSION=${{ steps.meta.outpus.tags }}
TAG_SUFFIX=${{ github.ref_type }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


55 changes: 55 additions & 0 deletions .github/workflows/npm_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- master
- dev
paths-ignore:
- '.gitignore'
- '.github/**/.yml'

jobs:

Create-Version-Tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token : ${{ secrets.GITHUB_TOKEN }}
- name: version value
id: versioning
run: |
git config --global user.name 'kd9lsv'
git config --global user.email '[email protected]'
echo "npmversion=$(npm version patch -m "[RELEASE] %s")" >> $GITHUB_ENV
git push
- name: Get Date
id: date
run: echo "dateval::$(date +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: Create an Tag
uses: simpleactions/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.sha }}
# The tag name
tag: ${{env.npmversion}}
# The message
message: ${{env.npmversion}} Update on ${{env.dateval}}
- name: Generate changelog
id: changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: ncipollo/release-action@v1
if: steps.changelog.outputs.changelog
with:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{env.npmversion}}
tag: ${{env.npmversion}}
body: |
```bash
See docker package for updated version ${{env.npmversion}} updated on ${{env.dateval}}
```
${{ steps.changelog.outputs.changelog }}
20 changes: 20 additions & 0 deletions .github/workflows/updatepackagejson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

on: workflow_dispatch
name: Update
jobs:
package-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: set remote url
run: git remote set-url --push origin https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- name: package-update
uses: taichi/actions-package-update@master
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: kd9lsv
EXECUTE: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_LEVEL: debug
with:
args: -u --packageFile package.json --loglevel verbose
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.backup
node_modules/*
*.code-workspace
uibuilder/node_modules
package-lock.json
node_modules

4 changes: 4 additions & 0 deletions docker/.config.projects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"activeProject": "Node-Red-Contesting-Dashboard",
"projects": {}
}
30 changes: 30 additions & 0 deletions docker/.config.users.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"_": {
"editor": {
"view": {
"view-store-zoom": false,
"view-store-position": false,
"view-show-grid": true,
"view-snap-grid": true,
"view-grid-size": "20",
"view-node-status": true,
"view-node-show-label": true,
"view-show-tips": true,
"view-show-welcome-tours": true
}
},
"git": {
"user": {
"name": "nobody",
"email": "[email protected]"
},
"workflow": {
"mode": "manual"
}
},
"debug": {
"filter": "filterAll",
"filteredNodes": []
}
}
}
47 changes: 47 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM nodered/node-red as base
ARG QEMU_ARCH
USER root
RUN apk add sqlite grep
USER node-red

COPY docker/settings.js /data/settings.js
COPY docker/.config.projects.json /data
COPY docker/.config.users.json /data
COPY schema.db /data

RUN mkdir -p /data/projects && mkdir -p /data/node_modules/

COPY package.json .
COPY . /data/projects/Node-Red-Contesting-Dashboard/

RUN npm install --unsafe-perm --no-update-notifier --no-fund --omit=dev
# Copy package.json to the WORKDIR so npm builds all
# of your added nodes modules for Node-RED


# 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.
RUN sqlite3 /usr/src/node-red/qsos < /data/schema.db

ENV NODE_RED_ENABLE_PROJECTS=true
HEALTHCHECK CMD curl http://localhost:1880/ || exit 1

LABEL org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.docker.dockerfile=".docker/Dockerfile" \
org.label-schema.license="Apache-2.0" \
org.label-schema.name="Node-RED-Contest-Dashboard" \
org.label-schema.version=${BUILD_VERSION} \
org.label-schema.description="Low-code programming for event-driven applications." \
org.label-schema.url="https://github.com/kylekrieg/Node-Red-Contesting-Dashboard" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-type="Git" \
org.label-schema.vcs-url="https://github.com/kylekrieg/Node-Red-Contesting-Dashboard" \
org.label-schema.arch=${QEMU_ARCH} \
authors="Connor Dickey KD9LSV, Kyle Krieg AA0Z"

# You should add extra nodes via your package.json file but you can also add them here:
#WORKDIR /usr/src/node-red
#RUN npm install node-red-node-smooth

Loading