Compare commits

...

85 Commits

Author SHA1 Message Date
91eec28708 Merge pull request 'chore(deps): update dependency docker/login-action to v3.1.0' (#61) from renovate/docker-login-action-3.x into master
All checks were successful
ci / docker (push) Successful in 19s
Reviewed-on: #61
2024-03-15 07:39:46 +00:00
90f5a16def Merge pull request 'chore(deps): update dependency docker/build-push-action to v5.3.0' (#60) from renovate/docker-build-push-action-5.x into master
Some checks are pending
ci / docker (push) Waiting to run
Reviewed-on: #60
2024-03-15 07:39:39 +00:00
7c9b777e64 chore(deps): update dependency docker/login-action to v3.1.0
All checks were successful
ci / docker (push) Successful in 22s
Bump version / create_release_tag (pull_request) Successful in 36s
2024-03-15 07:37:46 +00:00
0b728fad30 chore(deps): update dependency docker/build-push-action to v5.3.0
All checks were successful
ci / docker (push) Successful in 16s
Bump version / create_release_tag (pull_request) Successful in 50s
2024-03-15 07:37:43 +00:00
c586229d98 Merge pull request 'remove constraint on docker login' (#59) from erichardson-patch-1 into master
All checks were successful
ci / docker (push) Successful in 37s
Reviewed-on: #59
2024-03-07 08:36:50 +00:00
8594359d52 remove constraint on docker login
All checks were successful
ci / docker (push) Successful in 17s
Bump version / create_release_tag (pull_request) Successful in 37s
2024-03-07 08:36:44 +00:00
7e06b6ee40 Merge pull request 'add push' (#58) from erichardson-patch-1 into master
All checks were successful
ci / docker (push) Successful in 17s
Reviewed-on: #58
2024-03-07 08:34:29 +00:00
6ba8a26016 add push
Some checks failed
ci / docker (push) Successful in 19s
Bump version / create_release_tag (pull_request) Failing after 34s
2024-03-07 08:34:22 +00:00
39708d18c0 Merge pull request 'add build/tag to tagging code' (#57) from erichardson-patch-1 into master
All checks were successful
ci / docker (push) Successful in 14s
Reviewed-on: #57
2024-03-07 07:48:26 +00:00
5b6286ef14 add build/tag to tagging code
All checks were successful
ci / docker (push) Successful in 17s
Bump version / create_release_tag (pull_request) Successful in 34s
2024-03-07 07:47:36 +00:00
fde3bec39e Merge pull request 'Update .gitea/workflows/tag-release.yaml' (#56) from erichardson-patch-1 into master
All checks were successful
ci / docker (push) Successful in 16s
Reviewed-on: #56
2024-03-07 07:36:51 +00:00
8241d28a33 Update .gitea/workflows/tag-release.yaml
All checks were successful
ci / docker (push) Successful in 15s
Bump version / create_release_tag (pull_request) Successful in 5s
2024-03-07 07:36:45 +00:00
b76b24277c Merge pull request 'test changing git tagging to true' (#55) from erichardson-patch-1 into master
All checks were successful
ci / docker (push) Successful in 12s
Reviewed-on: #55
2024-03-07 07:35:47 +00:00
58cf4dab0e change tagging formats
Some checks failed
ci / docker (push) Successful in 16s
Bump version / create_release_tag (pull_request) Failing after 9s
2024-03-07 07:35:16 +00:00
4e52811a9a test changing git tagging to true
All checks were successful
ci / docker (push) Successful in 12s
test
2024-03-07 07:32:56 +00:00
5c41159b09 typo
All checks were successful
ci / docker (push) Successful in 16s
2024-03-07 07:29:18 +00:00
059a3ce1db add debug step to see labels 2024-03-07 07:28:16 +00:00
babea68dd1 Merge pull request 'test using ref tag instead' (#54) from erichardson-patch-1 into master
All checks were successful
ci / docker (push) Successful in 36s
Reviewed-on: #54
2024-03-07 07:19:48 +00:00
8213007523 test using ref tag instead
All checks were successful
ci / docker (push) Successful in 36s
Bump version / create_release_tag (pull_request) Successful in 8s
2024-03-07 07:19:39 +00:00
2a3aa28dd1 Merge pull request 'Add Raw format for semver' (#53) from fix-semver-match into master
All checks were successful
ci / docker (push) Successful in 36s
Reviewed-on: #53
2024-03-07 06:40:25 +00:00
867c752d84 Add Raw format for semver
All checks were successful
Bump version / create_release_tag (pull_request) Successful in 8s
ci / docker (push) Successful in 37s
2024-03-06 22:39:20 -08:00
7903e31e4b Merge pull request 'Empty commit' (#52) from dummycommit into master
All checks were successful
ci / docker (push) Successful in 37s
Reviewed-on: #52
2024-03-07 06:31:28 +00:00
02f5ca5a13 Empty commit
All checks were successful
ci / docker (push) Successful in 35s
Bump version / create_release_tag (pull_request) Successful in 7s
2024-03-06 22:30:20 -08:00
297c03b467 remove old file
All checks were successful
ci / docker (push) Successful in 34s
2024-03-06 22:25:39 -08:00
1811bd2b75 add semver tagging workflow
All checks were successful
ci / docker (push) Successful in 37s
Bump version / create_release_tag (pull_request) Successful in 7s
2024-03-07 06:20:06 +00:00
6c2f1f26ee replace image name
All checks were successful
ci / docker (push) Successful in 38s
2024-03-07 06:07:37 +00:00
6c9e6f792e fix context path
Some checks failed
ci / docker (push) Failing after 33s
2024-03-07 06:04:50 +00:00
75152dc33b Delete .gitea/workflows/publish.yaml
Some checks failed
ci / docker (push) Failing after 21s
2024-03-07 06:04:07 +00:00
93baabb743 fix indent typo and remove qemu
Some checks failed
Build and publish Image / build-and-push (push) Successful in 14s
ci / docker (push) Failing after 17s
2024-03-07 06:01:37 +00:00
26b05b1030 Try recommended workflow
Some checks failed
Build and publish Image / build-and-push (push) Successful in 16s
ci / docker (push) Failing after 37s
2024-03-07 05:59:52 +00:00
b6f5ecda3b Update Docker/src/python/tHome/broker/connect.py
All checks were successful
Build and publish Image / build-and-push (push) Successful in 15s
2024-03-06 23:54:04 +00:00
54c2e5af98 Update Docker/src/python/tHome/broker/connect.py
All checks were successful
Build and publish Image / build-and-push (push) Successful in 12s
2024-03-06 23:51:02 +00:00
2f12de623c Update Docker/src/python/tHome/broker/connect.py
All checks were successful
Build and publish Image / build-and-push (push) Successful in 15s
2024-03-06 23:49:30 +00:00
15341383a8 Update Docker/src/python/tHome/broker/connect.py
All checks were successful
Build and publish Image / build-and-push (push) Successful in 15s
2024-03-06 23:46:14 +00:00
ad0b0e45ef try placing callback version
All checks were successful
Build and publish Image / build-and-push (push) Successful in 17s
2024-03-06 23:42:05 +00:00
b891855f16 Update .gitea/workflows/publish.yaml
All checks were successful
Build and publish Image / build-and-push (push) Successful in 15s
2024-03-06 08:26:23 +00:00
3de86aa168 Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 11s
2024-03-06 08:18:01 +00:00
140d07cd7a Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 11s
2024-03-06 08:15:51 +00:00
0d66761ae9 Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 9s
2024-03-06 08:14:00 +00:00
84aa71aaf1 Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 13s
2024-03-06 08:12:29 +00:00
0a9074c1e0 Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 13s
2024-03-06 08:10:42 +00:00
64b97c0e33 Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 14s
2024-03-06 08:07:50 +00:00
8faf6c9341 Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 49s
2024-03-06 07:59:49 +00:00
4baa37cc6c use build and push action
Some checks failed
Build and publish Image / build-and-push (push) Failing after 25s
2024-03-06 07:54:30 +00:00
09905cf8f1 use build and push action
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 10s
Semantic Release and Changelog / Build and Publish (push) Failing after 10s
2024-03-06 07:37:46 +00:00
dddebdda7d Update .gitea/workflows/publish.yaml
Some checks failed
Build and publish Image / build-and-push (push) Failing after 17s
2024-03-06 07:33:28 +00:00
95554eadf0 use docker login action 2024-03-06 07:33:09 +00:00
335acc544b bump paho-mqtt to 2.0.0
Some checks failed
Build and publish Image / build-and-push (push) Failing after 9s
2024-03-06 07:21:03 +00:00
e8333f4df1 Prep for pahoo-mqtt 2
Some checks failed
Build and publish Image / build-and-push (push) Failing after 15s
2024-03-06 07:20:14 +00:00
dca0f07a21 revert fe727724f0
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Failing after 13s
revert chore(deps): update docker/login-action action to v3
2024-02-20 00:24:32 +00:00
a916aea59e Merge pull request 'chore(deps): update docker/login-action action to v3' (#50) from renovate/docker-login-action-3.x into master
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Has been cancelled
Reviewed-on: #50
2024-02-20 00:20:45 +00:00
fe727724f0 chore(deps): update docker/login-action action to v3
Some checks failed
Build and publish Image / build-and-push (push) Failing after 12s
2024-02-20 00:13:49 +00:00
e1e0cf0ff2 Merge pull request 'chore(deps): update dependency docker/login-action to v2.2.0' (#48) from renovate/docker-login-action-2.x into master
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 8s
Semantic Release and Changelog / Build and Publish (push) Failing after 58s
Reviewed-on: #48
2024-02-18 03:05:57 +00:00
62d935ba4a Merge pull request 'chore(deps): update node.js to v20.11.1' (#49) from renovate/node-20.x into master
Some checks are pending
Semantic Release and Changelog / Patch (push) Waiting to run
Semantic Release and Changelog / Build and Publish (push) Waiting to run
Reviewed-on: #49
2024-02-18 03:05:39 +00:00
e25118fc33 chore(deps): update node.js to v20.11.1
Some checks failed
Build and publish Image / build-and-push (push) Failing after 9s
2024-02-18 03:04:31 +00:00
2a33fc9302 chore(deps): update dependency docker/login-action to v2.2.0
Some checks failed
Build and publish Image / build-and-push (push) Failing after 9s
2024-02-18 03:04:28 +00:00
5b14168d6b log to screen
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Failing after 13s
2024-02-10 21:48:04 +00:00
b55c3df231 Update .gitea/workflows/semantic-release.yaml
All checks were successful
Semantic Release and Changelog / Patch (push) Successful in 6s
Semantic Release and Changelog / Build and Publish (push) Successful in 21s
2024-02-10 21:35:42 +00:00
ac3ad18d84 Update .gitea/workflows/semantic-release.yaml
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Failing after 6s
2024-02-10 21:32:35 +00:00
dadbccbebf allow logging output of container
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Failing after 8s
2024-02-10 21:16:23 +00:00
fa0c5dd0c5 Refactor docker file and remove cache to clean up packages after
All checks were successful
Semantic Release and Changelog / Patch (push) Successful in 9s
Semantic Release and Changelog / Build and Publish (push) Successful in 31s
2024-02-10 07:51:16 +00:00
14ec31d1cc Update .gitea/workflows/semantic-release.yaml
All checks were successful
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Successful in 17s
2024-02-08 06:04:58 +00:00
42be3b4f0c Update .gitea/workflows/publish.yaml
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 22s
Semantic Release and Changelog / Build and Publish (push) Failing after 1m27s
2024-02-08 03:45:45 +00:00
e70036617a Merge pull request 'chore(deps): update dependency actions/checkout to v4.1.1' (#45) from renovate/actions-checkout-4.x into master
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 11s
Semantic Release and Changelog / Build and Publish (push) Failing after 48s
Reviewed-on: #45
2024-02-06 07:08:07 +00:00
78c9ae57b4 chore(deps): update dependency actions/checkout to v4.1.1
All checks were successful
Build and publish Image / build-and-push (push) Successful in 47s
2024-02-04 22:01:36 +00:00
154ccb0c91 Merge pull request 'chore(deps): update actions/checkout action to v4' (#44) from renovate/actions-checkout-4.x into master
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 5s
Semantic Release and Changelog / Build and Publish (push) Failing after 42s
Reviewed-on: #44
Reviewed-by: Evan Richardson <evanrich81@gmail.com>
2024-02-04 21:41:55 +00:00
60249b9c1e chore(deps): update actions/checkout action to v4
All checks were successful
Build and publish Image / build-and-push (push) Successful in 47s
2024-02-04 21:36:01 +00:00
a6d42086a7 change secret name
All checks were successful
Semantic Release and Changelog / Patch (push) Successful in 6s
Semantic Release and Changelog / Build and Publish (push) Successful in 42s
2024-02-04 09:27:07 +00:00
35c97c45d6 Merge pull request 'erichardson-patch-1' (#42) from erichardson-patch-1 into master
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 6s
Semantic Release and Changelog / Build and Publish (push) Failing after 39s
Reviewed-on: #42
2024-02-04 09:21:47 +00:00
ff6c893b84 erichardson-patch-1 (#41)
Some checks failed
Semantic Release and Changelog / Patch (push) Successful in 7s
Semantic Release and Changelog / Build and Publish (push) Failing after 43s
Reviewed-on: #41
2024-02-04 09:20:03 +00:00
30ab208c1b build on everything but master, also change non master build name to dev
All checks were successful
Build and publish Image / build-and-push (push) Successful in 42s
2024-02-04 09:19:28 +00:00
ac744a76e3 publish new tagged image on push to master
All checks were successful
Build and publish Image / build-and-push (push) Successful in 46s
2024-02-04 09:16:57 +00:00
582260f918 Test auto-versioning
All checks were successful
Build and publish Image / build-and-push (push) Successful in 46s
Semantic Release and Changelog / Patch (push) Successful in 18s
2024-02-04 08:49:20 +00:00
bebb06254c upgrade apk packages
All checks were successful
Build and publish Image / build-and-push (push) Successful in 1m2s
2024-02-04 07:52:17 +00:00
a151cab3a8 add docker install
All checks were successful
Build and publish Image / build-and-push (push) Successful in 1m9s
2024-02-04 07:33:59 +00:00
3f98fc33d4 change runner to ubuntu
Some checks failed
Build and publish Image / build-and-push (push) Failing after 3s
2024-02-04 06:08:23 +00:00
1bf75e3791 fix runner name
Some checks failed
Build and publish Image / build-and-push (push) Failing after 2s
2024-02-04 06:03:36 +00:00
d6f4ac9a12 add publish workflow
Some checks are pending
Build and publish Image / build-and-push (push) Waiting to run
2024-02-04 06:03:04 +00:00
423b291203 test
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
2024-02-04 02:34:25 +00:00
642ea750bb change label to shared
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
2024-02-04 02:31:35 +00:00
31f7d5aaaa add demo workflow to test actions
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2024-02-04 02:28:26 +00:00
90cf8c55cf Update fimport.py 2023-12-22 07:35:14 +00:00
48f508dee3 Update fimport.py for importlib module syntax 2023-12-22 07:28:30 +00:00
499c6d50da Merge branch 'fix-imp' into 'master'
Update fimport.py

See merge request erichardson/py-eagle-mqtt!36
2023-12-22 07:23:16 +00:00
49e3d56b1c Update fimport.py 2023-12-22 07:21:41 +00:00
8 changed files with 144 additions and 12 deletions

View File

@@ -0,0 +1,64 @@
name: ci
on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
harbor.evanshome.io/library/py-eagle-mqtt
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Harbor
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.1.0
with:
registry: harbor.evanshome.io
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: echo new tag
run: |
echo "${{ steps.meta.outputs.tags }}"
# - name: Build and push
# uses: docker/build-push-action@v5.3.0
# with:
# context: ./Docker/
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}

View File

@@ -0,0 +1,60 @@
name: Bump version
on:
pull_request:
types:
- closed
branches:
- master
jobs:
create_release_tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Create Release Tag
id: taggerFinal
uses: anothrNick/github-tag-action@1.67.0
with:
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
WITH_V: true
GIT_API_TAGGING: false
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
harbor.evanshome.io/library/py-eagle-mqtt
# generate Docker tags based on the following events/attributes
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=raw,value=${{ steps.taggerFinal.outputs.new_tag }}
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Harbor
uses: docker/login-action@v3.1.0
with:
registry: harbor.evanshome.io
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5.3.0
with:
context: ./Docker/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -31,7 +31,7 @@ build:
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
release:
image: node:20.10.0-alpine3.18
image: node:20.11.1-alpine3.18
stage: release
only:
refs:

View File

@@ -14,13 +14,20 @@ LABEL org.label-schema.vendor="Evan Richardson"
LABEL org.label-schema.docker.cmd="docker run --name=py-eagle-mqtt -e MQTT_BROKER_IP=<IP> -e MQTT_BROKER_PORT=1883 -p 22042:22042 -d evanrich/py-eagle-mqtt"
WORKDIR /app
COPY requirements.txt /app
COPY ./src/conf/logrotate/tHome /etc/logrotate.d/
ENV PYTHONPATH=/app/src/python
RUN apk --update add --no-cache logrotate \
&& pip3 install --no-cache-dir --upgrade pip \
&& pip3 install --no-cache-dir -r requirements.txt
RUN apk --update add --no-cache logrotate && \
apk upgrade && \
pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt && \
rm -rf /var/cache/apk/*
COPY . /app
CMD ["/app/src/bin/tHome-eagle.py", "-c", "/app/src/conf"]
CMD ["python3", "-u", "/app/src/bin/tHome-eagle.py", "-c", "/app/src/conf", "-l", "stdout"]
EXPOSE 22042

View File

@@ -1,3 +1,3 @@
paho-mqtt==1.6.1
paho-mqtt==2.0.0
bottle==0.12.25
defusedxml==0.7.1

View File

@@ -26,7 +26,7 @@ class Client ( mqtt.Client ):
self.on_connect = Client.on_connect
self.on_message = Client.on_message
def on_connect( self, userData, flags, rc ):
def on_connect( self, userdata, flags, reason_code, properties ):
self.subscribe( '#' )
def on_message( self, userData, msg ):
@@ -62,4 +62,4 @@ client.loop_start()
while True:
pass
client.loop_stop( force=True )
client.loop_stop()

View File

@@ -7,11 +7,11 @@ from . import config
import paho.mqtt.client as mqtt
#===========================================================================
class Client( mqtt.Client ):
class Client( mqtt.Client ):
"""Logging client
"""
def __init__( self, log=None ):
mqtt.Client.__init__( self )
mqtt.Client.__init__( self, mqtt.CallbackAPIVersion.VERSION2 )
self._logger = log
# Restore callbacks overwritten by stupid mqtt library
self.on_log = Client.on_log

View File

@@ -3,8 +3,9 @@
# Arbitrary file importing utility. Does NOT modify sys.modules
#
#===========================================================================
import imp
#import importlib
import os
import types
def fimport( filePath ):
# Read the file and compile the code. This will fail if the file
@@ -19,7 +20,7 @@ def fimport( filePath ):
rootName, ext = os.path.splitext( fileName )
# Create a new module and exec the code in it's context.
m = imp.new_module( rootName )
m = types.ModuleType( rootName )
m.__file__ = absPath
exec(code, m.__dict__)