Compare commits

...
9 Commits
Author SHA1 Message Date
Colin Seymour 86fe972431 Switch to new S6 service configuration (#40)
* Add new service files

* Remove moved file

* Move files

* Add exec perm

* Update for new services

* Remove xz-utils after use

* Check labels

* Move labels to build

* Typo

* List images

* Fixit

* Add super lint

* Update labels

* Whoops

* Remove superlint

* Add teslamate dependency

* Fix url
2024-10-27 16:43:53 +00:00
renovate[bot]andColin Seymour 3d167fc6ee Update TeslaMate to v1.31.0 (#51)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Colin Seymour <colin@symr.io>
2024-10-27 16:02:40 +00:00
renovate[bot] 0013f5605b Update actions/checkout action to v4.2.2 (#49)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-27 15:56:16 +00:00
Colin Seymour 826c07ace9 Consolidate versions and Renovate config to a single file (#48)
* Consolidate versions and renovate config to a single file

* Remove unneeded lint check

* Add BUILD_FROM
2024-10-27 15:55:21 +00:00
renovate[bot] 7bfa32be3f Update actions/checkout action to v4.2.1 (#47)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-08 08:51:44 +01:00
renovate[bot] b9e37e9f32 Update actions/checkout action to v4.2.0 (#46)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-26 10:14:52 +01:00
Colin Seymour 945a7c4822 Fix release note gathering (#44)
Parse json
2024-09-22 12:27:00 +01:00
Colin Seymour 4567555071 Quote DB name in existance check (#43)
Quote DB name
2024-09-13 09:56:26 +01:00
Colin Seymour 694b43eb93 Only include Teslamate release notes if updated since last release (#38) 2024-08-30 13:10:24 +01:00
20 changed files with 39 additions and 48 deletions
+2 -1
View File
@@ -8,12 +8,13 @@
"prBodyTemplate": "{{{table}}}{{{warnings}}}{{{notes}}}{{{changelogs}}}",
"semanticCommits": "disabled",
"commitMessageTopic": "{{#if (containsString depName 'teslamate')}}TeslaMate{{else}}{{depName}}{{/if}}",
"enabledManagers": ["custom.regex", "github-actions", "dockerfile"],
"enabledManagers": ["custom.regex", "github-actions"],
"customManagers": [
{
"customType": "regex",
"fileMatch": "^build.json$",
"matchStrings": [
"\"teslamate/teslamate:(?<currentValue>\\d+\\.\\d+\\.\\d+)\"",
"\"teslamate_version\": \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\""
],
"datasourceTemplate": "github-releases",
+1 -11
View File
@@ -14,19 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
- name: 🚀 Run Home Assistant Add-on Lint
uses: frenck/action-addon-linter@v2
with:
path: "./"
- name: Check versions match
run: |
docker_ver=$(grep "FROM teslamate/teslamate" Dockerfile | cut -d':' -f2)
build_ver=$(jq -r ".args.teslamate_version" build.json)
if [ "$docker_ver" != "$build_ver" ]; then
echo -e "\033[31;1mTeslaMate versions don't match: Dockerfile => ${docker_ver} | build.json => ${build_ver}\033[0m"
exit 1
fi
echo -e "\033[32;1mTeslaMate versions match: Dockerfile => ${docker_ver} | build.json => ${build_ver}\033[0m"
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
- name: Get version
run: |
+4 -3
View File
@@ -35,12 +35,13 @@ jobs:
- name: Get TeslaMate release notes
run: |
touch CHANGELOG.txt
gh pr list --repo lildude/ha-addon-teslamate --state=merged --search="Update TeslaMate" --limit=1 --json=body --jq '.[].body' | sed -n "/<\/summary>/,/<\/details>/p" | sed '1d;$d' > changelog.tmp
last_release_date=$(gh release list --repo lildude/ha-addon-teslamate --limit=1 --json=publishedAt | jq -r '.[].publishedAt')
gh pr list --repo lildude/ha-addon-teslamate --state=merged --search="Update TeslaMate in:title closed:>$last_release_date" --limit=1 --json=body --jq '.[].body' | sed -n "/<\/summary>/,/<\/details>/p" | sed '1d;$d' > changelog.tmp
if [ -s changelog.tmp ]; then
echo "## TeslaMate Release Notes" > CHANGELOG.txt
cat changelog.tmp >> CHANGELOG.txt
echo -e "---\n\n## Add-on Release Notes\n\n" >> CHANGELOG.txt
fi
echo -e "---\n\n## Add-on Release Notes\n\n" >> CHANGELOG.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag
@@ -60,7 +61,7 @@ jobs:
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout addon repo
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
with:
path: repo
repository: lildude/ha-addons
+5 -1
View File
@@ -32,7 +32,7 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
- name: Build add-on
uses: home-assistant/builder@2024.08.2
@@ -42,3 +42,7 @@ jobs:
--${{ matrix.arch }} \
--target /data/ \
--addon
- name: Image labels
run: |
docker inspect ghcr.io/lildude/ha-addon-teslamate-${{ matrix.arch }} --format='{{json .Config.Labels}}' | jq
+10 -26
View File
@@ -1,8 +1,11 @@
FROM teslamate/grafana:1.30.1 as grafana
ARG BUILD_FROM
ARG teslamate_version
FROM teslamate/grafana:${teslamate_version} as grafana
#---
FROM teslamate/teslamate:1.30.1
ARG BUILD_FROM
FROM $BUILD_FROM
ARG BUILD_ARCH
ARG BASHIO_VERSION=0.16.2
@@ -22,7 +25,6 @@ RUN \
set -x \
&& apt-get update && apt-get install -y --no-install-recommends \
bash \
bind9utils \
ca-certificates \
curl \
jq \
@@ -30,7 +32,6 @@ RUN \
postgresql-client \
tzdata \
xz-utils \
&& rm -rf /var/lib/apt/lists/* \
&& S6_ARCH="${BUILD_ARCH}" \
&& if [ "${BUILD_ARCH}" = "amd64" ]; then S6_ARCH="x86_64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then S6_ARCH="arm"; fi \
@@ -38,33 +39,16 @@ RUN \
&& curl -Ls "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" | tar xpJ -C / \
&& curl -Ls "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" | tar Jxp -C / \
&& curl -Ls "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" | tar Jxp -C / \
&& mkdir -p /etc/fix-attrs.d \
&& mkdir -p /etc/services.d \
&& mkdir -p /tmp/bashio \
&& curl -Ls "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar xz --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& apt purge -y xz-utils \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio
&& rm -rf /var/lib/apt/lists/* /tmp/*
COPY --chown=root scripts/*.sh /
RUN chmod a+x /*.sh
COPY --chown=root services/teslamate/run services/teslamate/finish /etc/services.d/teslamate/
RUN chmod a+x /etc/services.d/teslamate/*
COPY --chown=root services/nginx/run services/nginx/finish /etc/services.d/nginx/
RUN chmod a+x /etc/services.d/nginx/*
COPY --chown=root services/nginx/teslamate.conf /etc/nginx/conf.d/
COPY --from=grafana --chown=root /dashboards /dashboards
COPY --from=grafana --chown=root /dashboards_internal /dashboards
COPY rootfs /
COPY --from=grafana /dashboards /dashboards
COPY --from=grafana /dashboards_internal /dashboards
# S6-Overlay
ENTRYPOINT ["/init"]
LABEL \
org.opencontainers.image.title="Home Assistant Add-on: TeslaMate" \
org.opencontainers.image.description="A self-hosted data logger for your Tesla." \
org.opencontainers.image.source="https://github.com/lildude/ha-addon-ghostfolio/" \
org.opencontainers.image.licenses="MIT"
+13 -4
View File
@@ -1,13 +1,22 @@
{
"build_from": {
"aarch64": "teslamate/teslamate:not-used",
"amd64": "teslamate/teslamate:not-used",
"armv7": "teslamate/teslamate:not-used"
"aarch64": "teslamate/teslamate:1.31.0",
"amd64": "teslamate/teslamate:1.31.0",
"armv7": "teslamate/teslamate:1.31.0"
},
"args": {
"teslamate_version": "1.30.1"
"teslamate_version": "1.31.0"
},
"codenotary": {
"signer": "colin@symr.io"
},
"labels":{
"maintainer": "Colin Seymour (https://github.com/lildude)",
"org.opencontainers.image.authors": "Colin Seymour (https://github.com/lildude)",
"org.opencontainers.image.description": "A self-hosted data logger for your Tesla.",
"org.opencontainers.image.documentation": "https://github.com/lildude/ha-addon-teslamate/blob/main/DOCS.md",
"org.opencontainers.image.licenses": "MIT",
"org.opencontainers.image.source": "https://github.com/lildude/ha-addon-teslamate/",
"org.opencontainers.image.title": "Home Assistant Add-on: TeslaMate"
}
}
View File
View File
View File
+1
View File
@@ -0,0 +1 @@
longrun
+1 -1
View File
@@ -61,7 +61,7 @@ fi
if pg_isready -h "$DATABASE_HOST" -p "$DATABASE_PORT" > /dev/null 2>&1; then
bashio::log.info "Creating database '$DATABASE_NAME' on $DATABASE_HOST"
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list $DATABASE_NAME") ]]; then
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list \"$DATABASE_NAME\"") ]]; then
bashio::log.info "Database $DATABASE_NAME already exists"
else
if PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -qc "CREATE DATABASE \"$DATABASE_NAME\""; then
@@ -0,0 +1 @@
longrun