Compare commits

..

26 Commits

Author SHA1 Message Date
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
4 changed files with 100 additions and 6 deletions

View 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

View File

@@ -0,0 +1,59 @@
name: Semantic Release and Changelog
run-name: ${{ gitea.actor }} is running Semantic Release
on:
push:
branches:
- 'master'
jobs:
Patch:
name: Patch
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: 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: 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: 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 --all-tags harbor.evanshome.io/library/py-eagle-mqtt

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" 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 WORKDIR /app
COPY requirements.txt /app COPY requirements.txt /app
COPY ./src/conf/logrotate/tHome /etc/logrotate.d/ COPY ./src/conf/logrotate/tHome /etc/logrotate.d/
ENV PYTHONPATH=/app/src/python ENV PYTHONPATH=/app/src/python
RUN apk --update add --no-cache logrotate \
&& pip3 install --no-cache-dir --upgrade pip \ RUN apk --update add --no-cache logrotate && \
&& pip3 install --no-cache-dir -r requirements.txt apk upgrade && \
pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt && \
rm -rf /var/cache/apk/*
COPY . /app 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"]
EXPOSE 22042 EXPOSE 22042

View File

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