Skip to content

Commit

Permalink
Consolidate versions and Renovate config to a single file (#48)
Browse files Browse the repository at this point in the history
* Consolidate versions and renovate config to a single file

* Remove unneeded lint check

* Add BUILD_FROM
  • Loading branch information
lildude authored Oct 27, 2024
1 parent 7bfa32b commit 826c07a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,3 @@ jobs:
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"
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions build.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"build_from": {
"aarch64": "teslamate/teslamate:not-used",
"amd64": "teslamate/teslamate:not-used",
"armv7": "teslamate/teslamate:not-used"
"aarch64": "teslamate/teslamate:1.30.1",
"amd64": "teslamate/teslamate:1.30.1",
"armv7": "teslamate/teslamate:1.30.1"
},
"args": {
"teslamate_version": "1.30.1"
Expand Down

0 comments on commit 826c07a

Please sign in to comment.