Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1811bd2b75 | |||
| 6c2f1f26ee | |||
| 6c9e6f792e | |||
| 75152dc33b | |||
| 93baabb743 | |||
| 26b05b1030 | |||
| b6f5ecda3b | |||
| 54c2e5af98 | |||
| 2f12de623c | |||
| 15341383a8 | |||
| ad0b0e45ef | |||
| b891855f16 | |||
| 3de86aa168 | |||
| 140d07cd7a | |||
| 0d66761ae9 | |||
| 84aa71aaf1 | |||
| 0a9074c1e0 | |||
| 64b97c0e33 | |||
| 8faf6c9341 | |||
| 4baa37cc6c | |||
| dddebdda7d | |||
| 95554eadf0 | |||
| 335acc544b | |||
| e8333f4df1 | |||
| dca0f07a21 | |||
| a916aea59e | |||
| fe727724f0 | |||
| e1e0cf0ff2 | |||
| 62d935ba4a | |||
| e25118fc33 | |||
| 2a33fc9302 | |||
| 5b14168d6b |
@@ -1,27 +0,0 @@
|
||||
name: Build and publish Image
|
||||
run-name: ${{ gitea.actor }} is building py-eagle-mqtt image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*' # matches every branch that doesn't contain a '/'
|
||||
- '*/*' # matches every branch containing a single '/'
|
||||
- '**' # matches every branch
|
||||
- '!master' # excludes master
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t harbor.evanshome.io/library/py-eagle-mqtt:dev ./Docker/
|
||||
|
||||
- name: Login to Harbor
|
||||
run: docker login -u ${{ secrets.HARBOR_USERNAME }} -p ${{ secrets.HARBOR_PASSWORD }} harbor.evanshome.io
|
||||
|
||||
- name: Push Docker image to Harbor
|
||||
run: docker push harbor.evanshome.io/library/py-eagle-mqtt:dev
|
||||
|
||||
@@ -1,63 +1,59 @@
|
||||
name: Semantic Release and Changelog
|
||||
run-name: ${{ gitea.actor }} is running Semantic Release
|
||||
name: ci
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 10 * * *"
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- "**"
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
Patch:
|
||||
name: Patch
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
- name: Minor version for each merge
|
||||
id: taggerDryRun
|
||||
uses: anothrNick/github-tag-action@1.67.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
|
||||
WITH_V: true
|
||||
DRY_RUN: true
|
||||
- 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={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
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
|
||||
with:
|
||||
registry: harbor.evanshome.io
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./Docker/
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: echo new tag
|
||||
run: |
|
||||
echo "The next tag version will be: ${{ steps.taggerDryRun.outputs.new_tag }}"
|
||||
- name: echo tag
|
||||
run: |
|
||||
echo "The current tag is: ${{ steps.taggerDryRun.outputs.tag }}"
|
||||
- name: echo part
|
||||
run: |
|
||||
echo "The version increment was: ${{ steps.taggerDryRun.outputs.part }}"
|
||||
|
||||
Build-and-Publish:
|
||||
name: Build and Publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Login to Harbor
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: harbor.evanshome.io
|
||||
username: "robot$registry-bot"
|
||||
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t harbor.evanshome.io/library/py-eagle-mqtt:latest ./Docker/
|
||||
|
||||
- name: Minor version for each merge
|
||||
id: taggerFinal
|
||||
uses: anothrNick/github-tag-action@1.67.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
|
||||
WITH_V: true
|
||||
GIT_API_TAGGING: false
|
||||
|
||||
- name: tag with name
|
||||
run: docker tag harbor.evanshome.io/library/py-eagle-mqtt:latest harbor.evanshome.io/library/py-eagle-mqtt:${{ steps.taggerFinal.outputs.new_tag }}
|
||||
|
||||
- name: Push Docker image to Harbor
|
||||
run: docker push --all-tags harbor.evanshome.io/library/py-eagle-mqtt
|
||||
25
.gitea/workflows/tag-release.yaml
Normal file
25
.gitea/workflows/tag-release.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
@@ -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:
|
||||
|
||||
@@ -28,6 +28,6 @@ RUN apk --update add --no-cache logrotate && \
|
||||
|
||||
COPY . /app
|
||||
|
||||
CMD ["python3", "-u", "/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
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
paho-mqtt==1.6.1
|
||||
paho-mqtt==2.0.0
|
||||
bottle==0.12.25
|
||||
defusedxml==0.7.1
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user