Skip to content

Commit 0de3085

Browse files
tomhollingworthTom Hollingworth
andauthored
v2.0.6 (#45)
### 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]>
1 parent 414388e commit 0de3085

File tree

10 files changed

+57
-27
lines changed

10 files changed

+57
-27
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
11
name: Publish Docker
22
on:
3-
# Trigger the workflow on push request,
4-
# but only for the master branch
53
push:
6-
branches:
7-
- master
8-
release:
9-
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
10-
types: [published, created, edited]
4+
tags:
5+
- v*
6+
# # Temporary to test the action
7+
# branches:
8+
# - my/current-branch
119
jobs:
1210
build:
1311
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
1415
steps:
1516
- uses: actions/checkout@master
16-
- name: Publish to Registry
17+
- name: Login to GitHub Container Registry
18+
uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Publish to GitHub Container Registry
24+
if: ${{ github.ref_type == 'tag' }} # Only useful when testing actions on a branch
25+
uses: docker/build-push-action@v6
26+
with:
27+
push: true
28+
tags: |
29+
ghcr.io/libremfg/packml-simulator:${{ github.ref_name }}
30+
ghcr.io/libremfg/packml-simulator:latest
31+
# # Uncomment when testing actions on a branch
32+
# - name: Publish to GitHub Container Registry on Branch
33+
# if: ${{ github.ref_type == 'branch' }}
34+
# uses: docker/build-push-action@v6
35+
# with:
36+
# push: true
37+
# tags: |
38+
# ghcr.io/libremfg/packml-simulator:test
39+
- name: Publish to DockerHub Registry
40+
if: ${{ github.ref_type == 'tag' }} # Only useful when testing actions on a branch
1741
uses: elgohr/Publish-Docker-Github-Action@v5
1842
with:
19-
name: libremfg/packml-simulator
43+
name: spruiktec/packml-simulator
2044
username: ${{ secrets.DOCKER_USERNAME }}
21-
password: ${{ secrets.DOCKER_PASSWORD }}
45+
password: ${{ secrets.DOCKER_PASSWORD }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LABEL org.opencontainers.image.authors="[email protected]"
66
LABEL org.opencontainers.image.source="https://github.com/libremfg/PackML-MQTT-Simulator"
77
LABEL org.opencontainers.image.url="https://www.libremfg.com/"
88
LABEL org.opencontainers.image.vendor="Libre Technologies Inc"
9-
LABEL org.opencontainers.image.version="2.0.5"
9+
LABEL org.opencontainers.image.version="2.0.6"
1010

1111
WORKDIR /machine
1212

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Start your container with environmental variables.
2222
#### Basic MQTT Structure
2323

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

3535
```shell
36-
$ 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
36+
$ 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
3737
2020-06-22T03:13:49.301Z | info: Initializing
3838
2020-06-22T03:13:49.817Z | info: Connected to mqtt://broker.hivemq.com:1883
3939
2020-06-22T03:13:49.819Z | info: Site/Area/Line/Status/UnitModeCurrent : Production
@@ -263,23 +263,23 @@ version: "2.4"
263263

264264
services:
265265
greenville-packaging-line1:
266-
image: libremfg/packml-simulator
266+
image: ghcr.io/libremfg/packml-simulator
267267
environment:
268268
SITE: Greenville
269269
AREA: Packaging
270270
LINE: 'Line 1'
271271
mem_limit: 30MB
272272

273273
greenville-packaging-line2:
274-
image: libremfg/packml-simulator
274+
image: ghcr.io/libremfg/packml-simulator
275275
environment:
276276
SITE: Greenville
277277
AREA: Packaging
278278
LINE: 'Line 2'
279279
mem_limit: 30MB
280280

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

300300
## Changelog
301301

302+
- 2.0.6
303+
- Fix host reference on shutdown
304+
- Change to GitHub Container Registry
305+
- Update CI/CD to build to GitHub Container Registry
306+
- Bump Revision
307+
302308
- 2.0.5
303309
- Bump Revision
304310
- Change base docker image from node:12-alpine to node:20-alpine

chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: packml-sim
33
description: PackML Machine Simulator
44
type: application
55
version: 0.0.2
6-
appVersion: 2.0.5
6+
appVersion: 2.0.6

chart/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
replicaCount: 3
22
image:
3-
repository: libremfg/packml-simulator
3+
repository: ghcr.io/libremfg/packml-simulator
44
pullPolicy: IfNotPresent
55

66
config:

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "2.4"
22

33
services:
44
bathurst-packaging-line1:
5-
image: libremfg/packml-simulator
5+
image: ghcr.io/libremfg/packml-simulator
66
environment:
77
SITE: Bathurst
88
AREA: Packaging
@@ -13,7 +13,7 @@ services:
1313
mem_limit: 30MB
1414

1515
bathurst-packaging-line2:
16-
image: libremfg/packml-simulator
16+
image: ghcr.io/libremfg/packml-simulator
1717
environment:
1818
SITE: Bathurst
1919
AREA: Packaging
@@ -24,7 +24,7 @@ services:
2424
mem_limit: 30MB
2525

2626
greenville-cnc-line1:
27-
image: libremfg/packml-simulator
27+
image: ghcr.io/libremfg/packml-simulator
2828
environment:
2929
SITE: Greenville
3030
AREA: CNC

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "packaging-machine-language-mqtt-simulator",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "Manufacturing line simulator interfaced using PackML over MQTT.",
55
"keywords": [
66
"packml",
@@ -22,7 +22,7 @@
2222
"test": "echo \"Error: no test specified\" && exit 1",
2323
"style": "standard",
2424
"quality": "sonar-scanner",
25-
"build": "docker build . -t libremfg/packml-simulator"
25+
"build": "docker build . -t ghcr.io/libremfg/packml-simulator"
2626
},
2727
"author": "Libre Technologies Inc",
2828
"license": "MIT",

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sonar.projectKey=PackagingMachineLanguageSimulator
22
sonar.projectName=Packaging Machine Language Simulator
3-
sonar.projectVersion=2.0.5
3+
sonar.projectVersion=2.0.6
44
sonar.language=js
55
sonar.sources=src
66
sonar.sourceEncoding=UTF-8

src/clients/sparkplug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Client extends events.EventEmitter {
118118
{
119119
name: "Properties/OS Version",
120120
timestamp: timestamp,
121-
value: "2.0.5",
121+
value: "2.0.6",
122122
type: "String"
123123
},
124124
{

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ switch (global.config.CLIENT_TYPE) {
121121
}
122122

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

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

145145
// Handle PackML Commands

0 commit comments

Comments
 (0)