Skip to content

Commit

Permalink
v2.0.6 (#45)
Browse files Browse the repository at this point in the history
### Change
  - Change to GitHub Container Registry
  - Change CI/CD to build to GitHub Container Registry
  - Change version to v2.0.6

### Fix
  - Fix host reference on shutdown

---------

Co-authored-by: Tom Hollingworth <[email protected]>
  • Loading branch information
tomhollingworth and Tom Hollingworth authored Oct 11, 2024
1 parent 414388e commit 0de3085
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 27 deletions.
44 changes: 34 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
name: Publish Docker
on:
# Trigger the workflow on push request,
# but only for the master branch
push:
branches:
- master
release:
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
types: [published, created, edited]
tags:
- v*
# # Temporary to test the action
# branches:
# - my/current-branch
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@master
- name: Publish to Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to GitHub Container Registry
if: ${{ github.ref_type == 'tag' }} # Only useful when testing actions on a branch
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/libremfg/packml-simulator:${{ github.ref_name }}
ghcr.io/libremfg/packml-simulator:latest
# # Uncomment when testing actions on a branch
# - name: Publish to GitHub Container Registry on Branch
# if: ${{ github.ref_type == 'branch' }}
# uses: docker/build-push-action@v6
# with:
# push: true
# tags: |
# ghcr.io/libremfg/packml-simulator:test
- name: Publish to DockerHub Registry
if: ${{ github.ref_type == 'tag' }} # Only useful when testing actions on a branch
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: libremfg/packml-simulator
name: spruiktec/packml-simulator
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.DOCKER_PASSWORD }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/libremfg/PackML-MQTT-Simulator"
LABEL org.opencontainers.image.url="https://www.libremfg.com/"
LABEL org.opencontainers.image.vendor="Libre Technologies Inc"
LABEL org.opencontainers.image.version="2.0.5"
LABEL org.opencontainers.image.version="2.0.6"

WORKDIR /machine

Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Start your container with environmental variables.
#### Basic MQTT Structure

```shell
$ docker run -it -e SITE=Site -e AREA=Area -e LINE=Line -e MQTT_URL=mqtt://broker.hivemq.com -m 30m libremfg/packml-simulator
$ docker run -it -e SITE=Site -e AREA=Area -e LINE=Line -e MQTT_URL=mqtt://broker.hivemq.com -m 30m ghcr.io/libremfg/packml-simulator
2020-06-22T03:13:49.301Z | info: Initializing
2020-06-22T03:13:49.817Z | info: Connected to mqtt://broker.hivemq.com:1883
2020-06-22T03:13:49.819Z | info: Site/Area/Line/Status/UnitModeCurrent : Production
Expand All @@ -33,7 +33,7 @@ Once up and running, use an MQTT client to publish to .../Command/Reset and .../
#### SparkPlugB

```shell
$ docker run -it -e CLIENT_TYPE=sparkplugb -e SITE=Site -e AREA=Area -e LINE=Line -e MQTT_URL=mqtt://broker.hivemq.com -m 30m libremfg/packml-simulator
$ docker run -it -e CLIENT_TYPE=sparkplugb -e SITE=Site -e AREA=Area -e LINE=Line -e MQTT_URL=mqtt://broker.hivemq.com -m 30m ghcr.io/libremfg/packml-simulator
2020-06-22T03:13:49.301Z | info: Initializing
2020-06-22T03:13:49.817Z | info: Connected to mqtt://broker.hivemq.com:1883
2020-06-22T03:13:49.819Z | info: Site/Area/Line/Status/UnitModeCurrent : Production
Expand Down Expand Up @@ -263,23 +263,23 @@ version: "2.4"

services:
greenville-packaging-line1:
image: libremfg/packml-simulator
image: ghcr.io/libremfg/packml-simulator
environment:
SITE: Greenville
AREA: Packaging
LINE: 'Line 1'
mem_limit: 30MB

greenville-packaging-line2:
image: libremfg/packml-simulator
image: ghcr.io/libremfg/packml-simulator
environment:
SITE: Greenville
AREA: Packaging
LINE: 'Line 2'
mem_limit: 30MB

greenville-cnc-line1:
image: libremfg/packml-simulator
image: ghcr.io/libremfg/packml-simulator
environment:
SITE: Greenville
AREA: CNC
Expand All @@ -299,6 +299,12 @@ For any issue, there are fundamentally three ways an individual can contribute:

## Changelog

- 2.0.6
- Fix host reference on shutdown
- Change to GitHub Container Registry
- Update CI/CD to build to GitHub Container Registry
- Bump Revision

- 2.0.5
- Bump Revision
- Change base docker image from node:12-alpine to node:20-alpine
Expand Down
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: packml-sim
description: PackML Machine Simulator
type: application
version: 0.0.2
appVersion: 2.0.5
appVersion: 2.0.6
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
replicaCount: 3
image:
repository: libremfg/packml-simulator
repository: ghcr.io/libremfg/packml-simulator
pullPolicy: IfNotPresent

config:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "2.4"

services:
bathurst-packaging-line1:
image: libremfg/packml-simulator
image: ghcr.io/libremfg/packml-simulator
environment:
SITE: Bathurst
AREA: Packaging
Expand All @@ -13,7 +13,7 @@ services:
mem_limit: 30MB

bathurst-packaging-line2:
image: libremfg/packml-simulator
image: ghcr.io/libremfg/packml-simulator
environment:
SITE: Bathurst
AREA: Packaging
Expand All @@ -24,7 +24,7 @@ services:
mem_limit: 30MB

greenville-cnc-line1:
image: libremfg/packml-simulator
image: ghcr.io/libremfg/packml-simulator
environment:
SITE: Greenville
AREA: CNC
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "packaging-machine-language-mqtt-simulator",
"version": "2.0.5",
"version": "2.0.6",
"description": "Manufacturing line simulator interfaced using PackML over MQTT.",
"keywords": [
"packml",
Expand All @@ -22,7 +22,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"style": "standard",
"quality": "sonar-scanner",
"build": "docker build . -t libremfg/packml-simulator"
"build": "docker build . -t ghcr.io/libremfg/packml-simulator"
},
"author": "Libre Technologies Inc",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectKey=PackagingMachineLanguageSimulator
sonar.projectName=Packaging Machine Language Simulator
sonar.projectVersion=2.0.5
sonar.projectVersion=2.0.6
sonar.language=js
sonar.sources=src
sonar.sourceEncoding=UTF-8
Expand Down
2 changes: 1 addition & 1 deletion src/clients/sparkplug.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Client extends events.EventEmitter {
{
name: "Properties/OS Version",
timestamp: timestamp,
value: "2.0.5",
value: "2.0.6",
type: "String"
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ switch (global.config.CLIENT_TYPE) {
}

client.on('connect', (packet) => {
logger.info(`Connected to ${client.options().href || global.config.MQTT_URL}:${client.options().port}`)
logger.info(`Connected to ${client.options().href || client.options().host || global.config.MQTT_URL}:${client.options().port}`)
state.observe('onEnterState', (lifecycle) => {
const stateCurrent = helper.titleCase(lifecycle.to)
logger.debug(`Entering State ${stateCurrent}`)
Expand All @@ -139,7 +139,7 @@ client.on('connect', (packet) => {
})

client.on('close', () => {
logger.info(`Disconnected from ${client.options().href || globalConfig.MQTT_URL}:${client.options().port}`)
logger.info(`Disconnected from ${client.options().href || client.globalConfig.MQTT_URL}:${client.options().port}`)
})

// Handle PackML Commands
Expand Down

0 comments on commit 0de3085

Please sign in to comment.