Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6d42086a7 | |||
| 35c97c45d6 | |||
| ff6c893b84 | |||
| 30ab208c1b | |||
| ac744a76e3 | |||
| 582260f918 | |||
| bebb06254c | |||
| a151cab3a8 | |||
| 3f98fc33d4 | |||
| 1bf75e3791 | |||
| d6f4ac9a12 | |||
| 423b291203 | |||
| 642ea750bb | |||
| 31f7d5aaaa | |||
| 90cf8c55cf | |||
| 48f508dee3 | |||
| 499c6d50da | |||
| 49e3d56b1c |
30
.gitea/workflows/publish.yaml
Normal file
30
.gitea/workflows/publish.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
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@v2
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- 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
|
||||
|
||||
61
.gitea/workflows/semantic-release.yaml
Normal file
61
.gitea/workflows/semantic-release.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
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@v2
|
||||
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@v2
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
@@ -18,6 +18,7 @@ COPY requirements.txt /app
|
||||
COPY ./src/conf/logrotate/tHome /etc/logrotate.d/
|
||||
ENV PYTHONPATH=/app/src/python
|
||||
RUN apk --update add --no-cache logrotate \
|
||||
&& apk upgrade \
|
||||
&& pip3 install --no-cache-dir --upgrade pip \
|
||||
&& pip3 install --no-cache-dir -r requirements.txt
|
||||
COPY . /app
|
||||
|
||||
@@ -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__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user