Compare commits

..

41 Commits

Author SHA1 Message Date
58a827b1aa Rebase to Python 3.9.6 - Alpine 3.14 2021-07-06 22:31:54 +00:00
semantic-release-bot
adb4cb6060 chore(release): 1.7.6 [skip ci]
## [1.7.6](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.5...v1.7.6) (2021-05-10)

### Build

* Change docker driver to overlay2 ([13cb517](13cb51706b))
2021-05-10 17:00:45 +00:00
13cb51706b Build: Change docker driver to overlay2 2021-05-10 16:58:56 +00:00
e83a7bbfae Don't semantic release on tags 2021-05-09 06:18:31 +00:00
semantic-release-bot
49a8693fc0 chore(release): 1.7.5 [skip ci]
## [1.7.5](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.4...v1.7.5) (2021-05-09)

### Build

* push all tags instead of just latest ([b143379](b143379f20))
2021-05-09 03:55:28 +00:00
b143379f20 Build: push all tags instead of just latest 2021-05-09 03:53:17 +00:00
semantic-release-bot
534a8b805e chore(release): 1.7.4 [skip ci]
## [1.7.4](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.3...v1.7.4) (2021-05-09)

### Build

* cleanup long install line ([de1d073](de1d073c6d))

### ci

* Add git to node image ([6eb2d01](6eb2d0145e))
* change semantic release image to alpine to save space, updated to node 16 ([b1ca049](b1ca0497b0))
* Update DinD base to 20.10.6 and semantic release to node:15.  Also pin sonar-scanner-cli to 4.6 ([589fb4f](589fb4fcf7))
2021-05-09 03:44:55 +00:00
de1d073c6d Build: cleanup long install line 2021-05-09 03:42:44 +00:00
d3e34871aa Update .releaserc.yml 2021-05-09 03:35:18 +00:00
3e8aead632 Update .releaserc.yml 2021-05-09 03:27:45 +00:00
9498554758 Merge branch 'update-semantic-release' into 'master'
Update semantic release

See merge request erichardson/py-eagle-mqtt!4
2021-05-09 03:24:02 +00:00
c2167d5d97 Update semantic release 2021-05-09 03:24:02 +00:00
6eb2d0145e ci: Add git to node image 2021-05-09 03:01:59 +00:00
b1ca0497b0 ci: change semantic release image to alpine to save space, updated to node 16 2021-05-09 02:48:42 +00:00
589fb4fcf7 ci: Update DinD base to 20.10.6 and semantic release to node:15. Also pin sonar-scanner-cli to 4.6 2021-05-09 02:41:44 +00:00
51213c51e0 Merge branch 'add-trivy-scanner' into 'master'
Add Trivy scanner stage

See merge request erichardson/py-eagle-mqtt!3
2021-05-09 02:37:51 +00:00
da20bbe045 Add Trivy scanner stage 2021-05-09 02:37:51 +00:00
bb17ad6135 Change Base directory to just the python stuff 2021-04-30 00:38:42 +00:00
40c7d020d2 Add sonarqube-check 2021-04-30 00:26:12 +00:00
9b5adba3ed Add sonar-project.properties 2021-04-30 00:19:32 +00:00
semantic-release-bot
73740ffa39 chore(release): 1.7.3 [skip ci]
## [1.7.3](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.2...v1.7.3) (2021-04-12)

### Bug Fixes

* Empty commit to get recent changes into build (last commit should've been labeled this) ([e513752](e513752c46))
2021-04-12 22:11:57 +00:00
Evan Richardson
e513752c46 fix: Empty commit to get recent changes into build (last commit should've been labeled this) 2021-04-12 14:53:10 -07:00
evanrich
cfb392dc6a refactor: Add new docker labels to better identify container properties 2021-04-09 17:14:51 -07:00
f3f78c4ad5 docs: Fix badges formatting, also add docker version and # of pulls 2021-04-08 23:58:44 +00:00
d1723db798 docs: Add build status 2021-04-08 23:49:27 +00:00
ba8486017a docs: add dependency badge 2021-04-08 22:50:03 +00:00
37d8b17076 docs: add semantic-release badge 2021-04-08 22:29:53 +00:00
semantic-release-bot
da83d88229 chore(release): 1.7.2 [skip ci]
## [1.7.2](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.1...v1.7.2) (2021-04-08)

### Bug Fixes

* Cleanup CHANGELOG.md since using new semantic-release format ([a72ac7a](a72ac7a1df))
* fix asset info for git commit ([00c95c4](00c95c42ea))
2021-04-08 22:17:41 +00:00
evanrich
00c95c42ea fix: fix asset info for git commit 2021-04-08 15:16:21 -07:00
evanrich
a72ac7a1df fix: Cleanup CHANGELOG.md since using new semantic-release format
fix: Remove package-lock.json file (only commit CHANGELOG.md)
2021-04-08 15:11:32 -07:00
semantic-release-bot
ffbde1eff5 chore(release): 1.7.1 [skip ci]
## [1.7.1](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.0...v1.7.1) (2021-04-08)

### Bug Fixes

* refactor Dockerfile to improve build ([40ac8c5](40ac8c5ada))
2021-04-08 22:06:11 +00:00
1e58da7572 Merge branch 'dev' into 'master'
fix: refactor Dockerfile to improve build

See merge request erichardson/py-eagle-mqtt!2
2021-04-08 22:04:41 +00:00
evanrich
40ac8c5ada fix: refactor Dockerfile to improve build 2021-04-08 14:59:58 -07:00
evanrich
2c49af0f32 Merge branch 'master' of https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt 2021-04-08 14:47:21 -07:00
evanrich
a4c715068d Fix: Commit 3.9.4-alpine3.13 base change 2021-04-08 14:44:39 -07:00
91b6464e8c build: add missing npm install for git plugin 2021-04-08 21:34:14 +00:00
b9ad4e8ec1 build: add git plugin to sematic-release config file 2021-04-08 21:31:46 +00:00
evanrich
ac8c039b33 feat: remove astral again to try and fix semver (again?) 2021-04-07 15:12:30 -07:00
Evan Richardson
46cc86ed0b revert: add astral back in due to mistake in release system 2021-04-07 15:08:19 -07:00
Evan Richardson
3db668ff98 feat: remove astral package, since it actually isn't being used 2021-04-07 15:00:27 -07:00
evanrich
99661058bd Add Semver release mechanism 2021-04-06 20:59:01 -07:00
7 changed files with 198 additions and 17 deletions

View File

@@ -7,15 +7,18 @@ stages:
- test
- build
- push_local
- release
- push_dockerhub
.docker_base:
image: docker:18.09.7-dind
image: docker:20.10.6-dind
services:
- docker:18.09.7-dind
- name: docker:20.10.6-dind
command: ["--tls=false"]
variables:
DOCKER_DRIVER: overlay
DOCKER_HOST: tcp://localhost:2375/
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://127.0.0.1:2375/
DOCKER_TLS_CERTDIR: ""
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
before_script:
@@ -34,6 +37,8 @@ build:
--pull
--cache-from $CI_REGISTRY_IMAGE:latest
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
--build-arg VCS_REF=$CI_COMMIT_SHORT_SHA
./Docker/
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
@@ -65,9 +70,78 @@ push dockerhub:
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_DOCKERHUB_IMAGE:$CI_COMMIT_REF_NAME
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_DOCKERHUB_IMAGE:latest
- docker login -u "$CI_DOCKERHUB_USER" -p "$CI_DOCKERHUB_PASSWORD" $CI_DOCKERHUB_REGISTRY
- docker push $CI_DOCKERHUB_IMAGE
- docker push $CI_DOCKERHUB_IMAGE --all-tags
release:
image: node:16-alpine3.13
stage: release
only:
refs:
- master
- alpha
# This matches maintenance branches
- /^(([0-9]+)\.)?([0-9]+)\.x/
# This matches pre-releases
- /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
except:
refs:
- tags
script:
- touch CHANGELOG.md
- apk add --no-cache git
- npm install @semantic-release/gitlab @semantic-release/changelog
@semantic-release/git conventional-changelog-eslint
- npx semantic-release
artifacts:
paths:
- CHANGELOG.md
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
sonarqube-check:
stage: test
image:
name: sonarsource/sonar-scanner-cli:4.6
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
allow_failure: true
only:
- master # or the name of your main branch
- branches
trivy:
stage: test
extends:
- .docker_base
before_script:
- export TRIVY_VERSION=$(wget -qO - "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
- echo $TRIVY_VERSION
- wget --no-verbose https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz -O - | tar -zxvf -
allow_failure: true
script:
# Build image
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA ./Docker/
# Build report
- ./trivy --exit-code 0 --cache-dir .trivycache/ --no-progress --format template --template "@contrib/gitlab.tpl" -o gl-container-scanning-report.json image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
# Print report
- ./trivy --exit-code 0 --cache-dir .trivycache/ --no-progress --severity HIGH image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
# Fail on severe vulnerabilities
- ./trivy --exit-code 1 --cache-dir .trivycache/ --severity CRITICAL --no-progress image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
cache:
paths:
- .trivycache/
# Enables https://docs.gitlab.com/ee/user/application_security/container_scanning/ (Container Scanning report is available on GitLab EE Ultimate or GitLab.com Gold)
artifacts:
reports:
container_scanning: gl-container-scanning-report.json

45
.releaserc.yml Normal file
View File

@@ -0,0 +1,45 @@
plugins:
- - "@semantic-release/commit-analyzer"
- preset: eslint
releaseRules:
- tag: Breaking
release: major
- tag: Build
release: patch
- tag: Chore
release: minor
- tag: Fix
release: patch
- tag: New
release: minor
- tag: Update
release: minor
- tag: Upgrade
release: minor
- - "@semantic-release/release-notes-generator"
- preset: eslint
releaseRules:
- tag: Breaking
release: major
- tag: Build
release: patch
- tag: Chore
release: minor
- tag: Fix
release: patch
- tag: New
release: minor
- tag: Update
release: minor
- tag: Upgrade
release: minor
- - "@semantic-release/changelog"
- changelogFile: CHANGELOG.md
- "@semantic-release/gitlab"
- - "@semantic-release/git"
- assets: CHANGELOG.md
branches:
- "master"
- "+([0-9])?(.{+([0-9]),x}).x"
- name: "alpha"
prerelease: "alpha"

View File

@@ -1,9 +1,51 @@
# Changelog
## [1.7.6](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.5...v1.7.6) (2021-05-10)
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Build
* Change docker driver to overlay2 ([13cb517](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/13cb51706b97f25486f62dd6985903e834d28ee2))
## [1.7.5](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.4...v1.7.5) (2021-05-09)
### Build
* push all tags instead of just latest ([b143379](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/b143379f2018f410677a9646234e7b483d9277d3))
## [1.7.4](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.3...v1.7.4) (2021-05-09)
### Build
* cleanup long install line ([de1d073](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/de1d073c6daf5d43fb7d9b7dafddd3b0cbcffc9b))
### ci
* Add git to node image ([6eb2d01](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/6eb2d0145eff50c3243a364d821e769ae2ee06c9))
* change semantic release image to alpine to save space, updated to node 16 ([b1ca049](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/b1ca0497b0b51e0c50ca1e5f99e5c8abd4224d53))
* Update DinD base to 20.10.6 and semantic release to node:15. Also pin sonar-scanner-cli to 4.6 ([589fb4f](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/589fb4fcf7841d3c5f08327d7fb5d5c107562ed6))
## [1.7.3](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.2...v1.7.3) (2021-04-12)
### Bug Fixes
* Empty commit to get recent changes into build (last commit should've been labeled this) ([e513752](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/e513752c46cc0b3beb93530f6549661d67196905))
## [1.7.2](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.1...v1.7.2) (2021-04-08)
### Bug Fixes
* Cleanup CHANGELOG.md since using new semantic-release format ([a72ac7a](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/a72ac7a1df91cb2231e38e8bbceb5ccf9c93328a))
* fix asset info for git commit ([00c95c4](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/00c95c42ea98921a1b2da9d2069d41e8e32f34f5))
## [1.7.1](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.0...v1.7.1) (2021-04-08)
### Bug Fixes
* refactor Dockerfile to improve build ([40ac8c5](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/40ac8c5ada9b993f53b72dcc14b2d9b7cd183e2f))
## [1.6.10] - 2021-04-06

View File

@@ -1,17 +1,26 @@
FROM python:3.9.3-alpine3.12
FROM python:3.9.6-alpine3.14
LABEL maintainer="Evan Richardson (evanrich81[at]gmail.com)"
LABEL version="1.6.6"
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="evanrich/py-eagle-mqtt"
LABEL org.label-schema.description="Python Rainforest Eagle to MQTT Application"
LABEL org.label-schema.vcs-url="https://github.com/evanrich/py-eagle-mqtt"
LABEL org.label-schema.vcs-ref=$VCS_REF
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 . /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 rm -rf /var/cache/apk
COPY . /app
CMD ["/app/src/bin/tHome-eagle.py", "-c", "/app/src/conf"]
EXPOSE 22042

View File

@@ -1,4 +1,3 @@
astral==2.2
paho-mqtt==1.5.1
bottle==0.12.19
defusedxml==0.7.1

View File

@@ -1,8 +1,17 @@
# py-eagle-mqtt
Python3 based Docker for Eagle to MQTT reader
I have only ported this into a dockerfile, as well as made some changes to code for security or other purposes. All Original code is credit to [Ted Drain - TD22057](https://github.com/TD22057/T-Home).
This project utilizes the following tools:
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/evanrich/py-eagle-mqtt)]()
[![Gitlab pipeline status (self-hosted)](https://img.shields.io/gitlab/pipeline/erichardson/py-eagle-mqtt/master?gitlab_url=https%3A%2F%2Fgitlab.evanrichardsonphotography.com)]()
[![Docker Pulls](https://img.shields.io/docker/pulls/evanrich/py-eagle-mqtt)]()
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/evanrich/py-eagle-mqtt)]()
## UPDATES:
2020-04-06: Moved Updates to a CHANGELOG.md file to clean this up.

3
sonar-project.properties Normal file
View File

@@ -0,0 +1,3 @@
sonar.projectKey=erichardson_py-eagle-mqtt_AXkgI9tRLcemhRz3NCjo
sonar.qualitygate.wait=true
sonar.projectBaseDir=Docker/src