Skip to content

Commit 771e70d

Browse files
authored
Automation and coderefresh (#2)
* code validation * update readme * Add GitHub actions
1 parent ce19ecb commit 771e70d

13 files changed

+76
-47
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: pre-commit
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
jobs:
9+
pre-commit:
10+
uses: cybcon/github_workflows/.github/workflows/pre-commit.yaml@v1.0.0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: release
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
jobs:
7+
release:
8+
uses: cybcon/github_workflows/.github/workflows/release-from-label.yaml@v1.0.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: release-label-validation
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
- reopened
9+
- labeled
10+
- unlabeled
11+
jobs:
12+
release-label-validation:
13+
uses: cybcon/github_workflows/.github/workflows/release-label-validation.yaml@v1.0.0

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ local.properties
5252
.worksheet
5353

5454
### Eclipse Patch ###
55-
# Eclipse Core
55+
# Eclipse Core
5656
.project
5757

58-
# JDT-specific (Eclipse Java Development Tools)
58+
# JDT-specific (Eclipse Java Development Tools)
5959
.classpath
6060

6161
### Intellij ###
@@ -223,4 +223,3 @@ $RECYCLE.BIN/
223223
*.lnk
224224

225225
# End of https://www.gitignore.io/api/osx,java,linux,eclipse,windows,netbeans,java-web,intellij
226-

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-ast
6+
- id: check-json
7+
- id: debug-statements
8+
- id: end-of-file-fixer
9+
- id: fix-encoding-pragma
10+
- id: mixed-line-ending
11+
- id: requirements-txt-fixer
12+
- id: trailing-whitespace
13+
- repo: https://github.com/hadolint/hadolint
14+
rev: v2.12.0
15+
hooks:
16+
- id: hadolint-docker

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit 2.20.0

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
FROM python:3.8-alpine
1+
FROM python:3.10.9-alpine3.17
2+
23
LABEL maintainer="Michael Oberdorf IT-Consulting <info@oberdorf-itc.de>"
34
LABEL site.local.vendor="Michael Oberdorf IT-Consulting"
45
LABEL site.local.os.main="Linux"
56
LABEL site.local.os.dist="Alpine"
7+
LABEL site.local.os.version="3.17"
68
LABEL site.local.runtime.name="Python"
7-
LABEL site.local.runtime.version="3.8"
9+
LABEL site.local.runtime.version="3.10.9"
810
LABEL site.local.program.name="Python Modbus TCP Server"
911
LABEL site.local.program.version="1.1.2"
1012

11-
RUN addgroup -g 1000 -S pythonuser && \
12-
adduser -u 1000 -S pythonuser -G pythonuser && \
13-
mkdir -p /app && \
14-
pip3 install 'pymodbus>=2,<3'
15-
ADD --chown=root:root app/* /app/
13+
RUN addgroup -g 1000 -S pythonuser \
14+
&& adduser -u 1000 -S pythonuser -G pythonuser \
15+
&& mkdir -p /app \
16+
&& pip3 install --no-cache-dir 'pymodbus>=2,<3'
17+
COPY --chown=root:root app/* /app/
1618

1719
USER pythonuser
1820
EXPOSE 5020/tcp

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Michael Oberdorf IT-Consulting
3+
Copyright (c) 2020-2023 Michael Oberdorf IT-Consulting
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Source code: [GitHub](https://github.com/cybcon/modbus-server)
66

77
# Supported tags and respective `Dockerfile` links
88

9-
* [`latest`, `1.1.2`](https://github.com/cybcon/modbus-server/blob/1.1.2/Dockerfile)
9+
* [`latest`, `1.1.3`](https://github.com/cybcon/modbus-server/blob/v1.1.2/Dockerfile)
10+
* [`1.1.2`](https://github.com/cybcon/modbus-server/blob/1.1.2/Dockerfile)
1011

1112
# What is Modbus TCP Server?
1213

1314
The Modbus TCP Server is a simple, in python written, Modbus TCP server. It listens to port 5020 and respond to any register types with a `0x0000`.
14-
The Modbus registers can be also predefined with values.
15+
The Modbus registers can be also predefined with values.
1516

1617
# QuickStart with Modbus TCP Server and Docker
1718

@@ -118,8 +119,8 @@ docker run --rm -p 5020:5020 -v ./server_config.json:/server_config.json oitc/mo
118119
119120
120121
# License
121-
122-
Copyright (c) 2020 Michael Oberdorf IT-Consulting
122+
123+
Copyright (c) 2020-2023 Michael Oberdorf IT-Consulting
123124
124125
Permission is hereby granted, free of charge, to any person obtaining a copy
125126
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)