Compare commits
2 Commits
v1.29.41
...
paho-v2-up
| Author | SHA1 | Date | |
|---|---|---|---|
| 2adc527693 | |||
| af92529ac8 |
27
.gitea/workflows/publish.yaml
Normal file
27
.gitea/workflows/publish.yaml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
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,64 +1,63 @@
|
|||||||
name: ci
|
name: Semantic Release and Changelog
|
||||||
|
run-name: ${{ gitea.actor }} is running Semantic Release
|
||||||
on:
|
on:
|
||||||
schedule:
|
|
||||||
- cron: "0 10 * * *"
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- 'master'
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
Patch:
|
||||||
|
name: Patch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4.1.1
|
||||||
uses: actions/checkout@v4.2.2
|
with:
|
||||||
- name: Docker meta
|
fetch-depth: '0'
|
||||||
id: meta
|
- name: Minor version for each merge
|
||||||
uses: docker/metadata-action@v5.6.1
|
id: taggerDryRun
|
||||||
with:
|
uses: anothrNick/github-tag-action@1.67.0
|
||||||
# list of Docker images to use as base name for tags
|
env:
|
||||||
images: |
|
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
|
||||||
harbor.evanshome.io/library/py-eagle-mqtt
|
WITH_V: true
|
||||||
# generate Docker tags based on the following events/attributes
|
DRY_RUN: true
|
||||||
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.9.0
|
|
||||||
- name: Login to Harbor
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3.3.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@v6.13.0
|
|
||||||
# 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.2.0
|
||||||
|
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
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
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.2.2
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.merge_commit_sha }}
|
|
||||||
fetch-depth: '0'
|
|
||||||
|
|
||||||
- name: Create Release Tag
|
|
||||||
id: taggerFinal
|
|
||||||
uses: anothrNick/github-tag-action@1.71.0
|
|
||||||
with:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
|
|
||||||
WITH_V: true
|
|
||||||
GIT_API_TAGGING: false
|
|
||||||
DEFAULT_BUMP: patch
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5.6.1
|
|
||||||
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.9.0
|
|
||||||
- name: Login to Harbor
|
|
||||||
uses: docker/login-action@v3.3.0
|
|
||||||
with:
|
|
||||||
registry: harbor.evanshome.io
|
|
||||||
username: ${{ secrets.HARBOR_USERNAME }}
|
|
||||||
password: ${{ secrets.HARBOR_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6.13.0
|
|
||||||
with:
|
|
||||||
context: ./Docker/
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
@@ -11,14 +11,14 @@ stages:
|
|||||||
##- push_dockerhub
|
##- push_dockerhub
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: docker:27.5.1-dind
|
image: docker:24.0.7-dind
|
||||||
stage: build
|
stage: build
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- tags
|
- tags
|
||||||
- branches
|
- branches
|
||||||
services:
|
services:
|
||||||
- name: docker:27.5.1-dind
|
- name: docker:24.0.7-dind
|
||||||
command: ["--tls=false"]
|
command: ["--tls=false"]
|
||||||
variables:
|
variables:
|
||||||
DOCKER_DRIVER: overlay2
|
DOCKER_DRIVER: overlay2
|
||||||
@@ -31,7 +31,7 @@ build:
|
|||||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
|
|
||||||
release:
|
release:
|
||||||
image: node:22.12.0-alpine3.19
|
image: node:20.11.1-alpine3.18
|
||||||
stage: release
|
stage: release
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
@@ -57,10 +57,10 @@ release:
|
|||||||
- CHANGELOG.md
|
- CHANGELOG.md
|
||||||
|
|
||||||
push local:
|
push local:
|
||||||
image: docker:27.5.1-dind
|
image: docker:24.0.7-dind
|
||||||
stage: push_local
|
stage: push_local
|
||||||
services:
|
services:
|
||||||
- name: docker:27.5.1-dind
|
- name: docker:24.0.7-dind
|
||||||
command: ["--tls=false"]
|
command: ["--tls=false"]
|
||||||
variables:
|
variables:
|
||||||
DOCKER_DRIVER: overlay2
|
DOCKER_DRIVER: overlay2
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.13-alpine
|
FROM python:3.12-alpine
|
||||||
LABEL maintainer="Evan Richardson (evanrich81[at]gmail.com)"
|
LABEL maintainer="Evan Richardson (evanrich81[at]gmail.com)"
|
||||||
|
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
paho-mqtt==2.1.0
|
paho-mqtt~=2.0.0
|
||||||
bottle==0.13.2
|
bottle==0.12.25
|
||||||
defusedxml==0.7.1
|
defusedxml==0.7.1
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class Client ( mqtt.Client ):
|
|||||||
self.on_connect = Client.on_connect
|
self.on_connect = Client.on_connect
|
||||||
self.on_message = Client.on_message
|
self.on_message = Client.on_message
|
||||||
|
|
||||||
def on_connect( self, userdata, flags, reason_code, properties ):
|
def on_connect( self, userData, flags, reason_code, properties ):
|
||||||
self.subscribe( '#' )
|
self.subscribe( '#' )
|
||||||
|
|
||||||
def on_message( self, userData, msg ):
|
def on_message( self, userData, msg ):
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ from . import config
|
|||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
|
|
||||||
#===========================================================================
|
#===========================================================================
|
||||||
class Client( mqtt.Client ):
|
class Client( mqtt.Client ):
|
||||||
"""Logging client
|
"""Logging client
|
||||||
"""
|
"""
|
||||||
def __init__( self, log=None ):
|
def __init__( self, log=None ):
|
||||||
mqtt.Client.__init__( self, mqtt.CallbackAPIVersion.VERSION2 )
|
mqtt.Client.__init__( self )
|
||||||
self._logger = log
|
self._logger = log
|
||||||
# Restore callbacks overwritten by stupid mqtt library
|
# Restore callbacks overwritten by stupid mqtt library
|
||||||
self.on_log = Client.on_log
|
self.on_log = Client.on_log
|
||||||
|
|||||||
Reference in New Issue
Block a user