mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c729d4f75 | ||
|
|
89abf45735 | ||
|
|
3c1545d9e4 | ||
|
|
64f0213e30 | ||
|
|
213a2205fc | ||
|
|
a9c53f4cd5 | ||
|
|
b964d2dbc9 | ||
|
|
4ab0062498 |
@@ -8,12 +8,13 @@
|
|||||||
"prBodyTemplate": "{{{table}}}{{{warnings}}}{{{notes}}}{{{changelogs}}}",
|
"prBodyTemplate": "{{{table}}}{{{warnings}}}{{{notes}}}{{{changelogs}}}",
|
||||||
"semanticCommits": "disabled",
|
"semanticCommits": "disabled",
|
||||||
"commitMessageTopic": "{{#if (containsString depName 'teslamate')}}TeslaMate{{else}}{{depName}}{{/if}}",
|
"commitMessageTopic": "{{#if (containsString depName 'teslamate')}}TeslaMate{{else}}{{depName}}{{/if}}",
|
||||||
|
"enabledManagers": ["custom.regex", "github-actions", "dockerfile"],
|
||||||
"customManagers": [
|
"customManagers": [
|
||||||
{
|
{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"fileMatch": "^build\\.json$",
|
"fileMatch": "^build.json$",
|
||||||
"matchStrings": [
|
"matchStrings": [
|
||||||
"\"teslamate_version\": \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\""
|
"\"teslamate_version\": \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\"",
|
||||||
],
|
],
|
||||||
"datasourceTemplate": "github-releases",
|
"datasourceTemplate": "github-releases",
|
||||||
"depNameTemplate": "teslamate-org/teslamate"
|
"depNameTemplate": "teslamate-org/teslamate"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: ⤵️ Check out code from GitHub
|
- name: ⤵️ Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.6
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: 🚀 Run Home Assistant Add-on Lint
|
- name: 🚀 Run Home Assistant Add-on Lint
|
||||||
uses: frenck/action-addon-linter@v2
|
uses: frenck/action-addon-linter@v2
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4.1.6
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Get version
|
- name: Get version
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -32,6 +32,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
semver-input: ${{ env.latest_release }}
|
semver-input: ${{ env.latest_release }}
|
||||||
increment: ${{ github.event.inputs.semverIncrement }}
|
increment: ${{ github.event.inputs.semverIncrement }}
|
||||||
|
- 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
|
||||||
|
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
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Create tag
|
- name: Create tag
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "actions.no-reply@github.com"
|
git config --global user.email "actions.no-reply@github.com"
|
||||||
@@ -40,15 +51,16 @@ jobs:
|
|||||||
git push --tags
|
git push --tags
|
||||||
working-directory: ${{ github.workspace }}/teslamate
|
working-directory: ${{ github.workspace }}/teslamate
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: softprops/action-gh-release@v2.0.5
|
uses: softprops/action-gh-release@v2.0.7
|
||||||
with:
|
with:
|
||||||
tag_name: v${{ steps.semver.outputs.semver }}
|
tag_name: v${{ steps.semver.outputs.semver }}
|
||||||
|
body_path: CHANGELOG.txt
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Checkout addon repo
|
- name: Checkout addon repo
|
||||||
uses: actions/checkout@v4.1.6
|
uses: actions/checkout@v4.1.7
|
||||||
with:
|
with:
|
||||||
path: repo
|
path: repo
|
||||||
repository: lildude/ha-addons
|
repository: lildude/ha-addons
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4.1.6
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Build add-on
|
- name: Build add-on
|
||||||
uses: home-assistant/builder@master
|
uses: home-assistant/builder@master
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
FROM teslamate/grafana:1.29.1 as grafana
|
FROM teslamate/grafana:1.30.1 as grafana
|
||||||
|
|
||||||
#---
|
#---
|
||||||
|
|
||||||
FROM teslamate/teslamate:1.29.1
|
FROM teslamate/teslamate:1.30.1
|
||||||
|
|
||||||
ARG BUILD_ARCH
|
ARG BUILD_ARCH
|
||||||
ARG BASHIO_VERSION=0.16.2
|
ARG BASHIO_VERSION=0.16.2
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
"armv7": "teslamate/teslamate:not-used"
|
"armv7": "teslamate/teslamate:not-used"
|
||||||
},
|
},
|
||||||
"args": {
|
"args": {
|
||||||
"teslamate_version": "1.29.1"
|
"teslamate_version": "1.30.1"
|
||||||
},
|
},
|
||||||
"codenotary": {
|
"codenotary": {
|
||||||
"signer": "colin@symr.io"
|
"signer": "colin@symr.io"
|
||||||
|
|||||||
@@ -2,8 +2,13 @@
|
|||||||
# -*- bash -*-
|
# -*- bash -*-
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
||||||
bashio::log.warning "Nginx crashed, halting add-on"
|
case "${1}" in
|
||||||
|
1)
|
||||||
|
bashio::log.error "Nginx encountered an error, halting add-on"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
bashio::log.error "Nginx crashed, halting add-on"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
/run/s6/basedir/bin/halt
|
/run/s6/basedir/bin/halt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bashio::log.info "Nginx stopped, restarting..."
|
|
||||||
@@ -2,8 +2,14 @@
|
|||||||
# -*- bash -*-
|
# -*- bash -*-
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
||||||
bashio::log.warning "TeslaMate crashed, halting add-on"
|
case "${1}" in
|
||||||
|
1)
|
||||||
|
bashio::log.error "TeslaMate encountered an error, halting add-on"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
bashio::log.error "TeslaMate crashed, halting add-on"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
/run/s6/basedir/bin/halt
|
/run/s6/basedir/bin/halt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bashio::log.info "TeslaMate stopped, restarting..."
|
|
||||||
+11
-14
@@ -51,23 +51,20 @@ fi
|
|||||||
|
|
||||||
# Create the PostgreSQL database if it doesn't exist
|
# Create the PostgreSQL database if it doesn't exist
|
||||||
if pg_isready -h "$DATABASE_HOST" -p "$DATABASE_PORT" > /dev/null 2>&1; then
|
if pg_isready -h "$DATABASE_HOST" -p "$DATABASE_PORT" > /dev/null 2>&1; then
|
||||||
bashio::log.info "Creating database $DATABASE_NAME on $DATABASE_HOST"
|
bashio::log.info "Creating database '$DATABASE_NAME' on $DATABASE_HOST"
|
||||||
|
|
||||||
res=$(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -c "CREATE DATABASE $DATABASE_NAME" 2>&1) || true
|
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list $DATABASE_NAME") ]]; then
|
||||||
case "$res" in
|
|
||||||
"CREATE DATABASE")
|
|
||||||
bashio::log.info "Database $DATABASE_NAME created"
|
|
||||||
;;
|
|
||||||
*"already exists"*)
|
|
||||||
bashio::log.info "Database $DATABASE_NAME already exists"
|
bashio::log.info "Database $DATABASE_NAME already exists"
|
||||||
;;
|
|
||||||
*)
|
|
||||||
bashio::log.error "Failed to create database $DATABASE_NAME: $res"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
else
|
||||||
bashio::log.error "PostgreSQL is not ready"
|
if PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -qc "CREATE DATABASE \"$DATABASE_NAME\""; then
|
||||||
|
bashio::log.info "Database $DATABASE_NAME created"
|
||||||
|
else
|
||||||
|
bashio::log.error "Failed to create database $DATABASE_NAME"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
bashio::log.error "PostgreSQL at '$DATABASE_HOST' is not ready or unreachable"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user