@@ -32,11 +32,12 @@ jobs:
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.IMAGE }}
|
||||
# main-<sha>-<unix time> sorts by build time, for Flux image automation
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=raw,value=main-{{sha}}-{{date 'X'}},enable={{is_default_branch}}
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,format=short
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# Heatpump cycle analysis
|
||||
# Interval Viz
|
||||
|
||||
A small static web app that visualises when a heat pump compressor is running,
|
||||
based on Home Assistant history exports (`binary_sensor.*` on/off states).
|
||||
A small static web app that visualises on/off intervals, such as when a heat
|
||||
pump compressor is running. It reads Home Assistant history exports
|
||||
(`binary_sensor.*` on/off states).
|
||||
|
||||
- Interactive timeline (pan, zoom, mouse-wheel, quick ranges 6 h / 24 h / 3 d / 7 d;
|
||||
double-click or Esc resets the zoom)
|
||||
@@ -87,19 +88,25 @@ docker compose up -d --build
|
||||
|
||||
Open <http://localhost:8080> and log in as `dev` / `dev`. These development
|
||||
credentials are set in `docker-compose.yml`. The host port can be changed with
|
||||
`HEATPUMP_PORT=9000 docker compose up -d`.
|
||||
`INTERVAL_VIZ_PORT=9000 docker compose up -d`.
|
||||
|
||||
## CI: build and push
|
||||
|
||||
`.gitea/workflows/docker.yml` builds the image with Gitea Actions and pushes it
|
||||
to the Harbor registry as `registry.traberph.de/public/interval_viz`.
|
||||
|
||||
| Trigger | Tags pushed |
|
||||
|--------------------|-----------------------------------|
|
||||
| push to `main` | `latest`, `sha-<short>` |
|
||||
| tag `v1.2.3` | `1.2.3`, `1.2`, `sha-<short>` |
|
||||
| pull request | build only, nothing pushed |
|
||||
| manual dispatch | as for the selected ref |
|
||||
| Trigger | Tags pushed |
|
||||
|--------------------|------------------------------------------------------|
|
||||
| push to `main` | `latest`, `main-<sha>-<unix time>` (e.g. `main-6cecbcf-1790415657`) |
|
||||
| tag `v1.2.3` | `1.2.3`, `1.2` |
|
||||
| pull request | build only, nothing pushed |
|
||||
| manual dispatch | as for the selected ref |
|
||||
|
||||
The `main-…` tags sort by build time via the trailing timestamp. Flux image
|
||||
automation can pick the newest one with this filter:
|
||||
`pattern: '^main-[a-f0-9]+-(?P<ts>[0-9]+)$'`, `extract: '$ts'`, `numerical: asc`.
|
||||
|
||||
Old tags are cleaned up by a tag retention policy in Harbor, not by this workflow.
|
||||
|
||||
Setup:
|
||||
|
||||
|
||||
+4
-2
@@ -1,10 +1,12 @@
|
||||
name: interval_viz
|
||||
|
||||
services:
|
||||
heatpump:
|
||||
interval_viz:
|
||||
build: .
|
||||
image: registry.traberph.de/public/interval_viz:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${HEATPUMP_PORT:-8080}:80"
|
||||
- "${INTERVAL_VIZ_PORT:-8080}:80"
|
||||
environment:
|
||||
BASIC_AUTH_USER: dev
|
||||
BASIC_AUTH_PASSWORD: dev
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const LANG_KEY = 'heatpump.lang';
|
||||
const DATASET_KEY = 'heatpump.dataset';
|
||||
const LANG_KEY = 'intervalviz.lang';
|
||||
const DATASET_KEY = 'intervalviz.dataset';
|
||||
const DATA_DIR = 'data/';
|
||||
const HOUR = 3600e3;
|
||||
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
const I18N = {
|
||||
en: {
|
||||
locale: 'en-GB',
|
||||
title: 'Heatpump compressor cycles',
|
||||
title: 'Interval Viz',
|
||||
loading: 'loading…',
|
||||
dataHeading: 'Data',
|
||||
rangeHeading: 'Selected range',
|
||||
@@ -45,7 +45,7 @@ const I18N = {
|
||||
},
|
||||
de: {
|
||||
locale: 'de-DE',
|
||||
title: 'Wärmepumpe – Verdichterzyklen',
|
||||
title: 'Interval Viz',
|
||||
loading: 'lädt…',
|
||||
dataHeading: 'Daten',
|
||||
rangeHeading: 'Ausgewählter Zeitraum',
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Heatpump Cycles</title>
|
||||
<title>Interval Viz</title>
|
||||
<link rel="icon" href="favicon.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="vendor/plotly.min.js" defer></script>
|
||||
@@ -14,7 +14,7 @@
|
||||
<body>
|
||||
<main>
|
||||
<header>
|
||||
<h1 data-i18n="title">Heatpump compressor cycles</h1>
|
||||
<h1 data-i18n="title">Interval Viz</h1>
|
||||
<div class="header-right">
|
||||
<select id="dataset" hidden aria-label="Dataset"></select>
|
||||
<span class="sub" id="source"></span>
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ server {
|
||||
gzip_comp_level 6;
|
||||
gzip_types text/css text/csv application/javascript application/json;
|
||||
|
||||
auth_basic "Heatpump";
|
||||
auth_basic "Interval Viz";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
|
||||
location / {
|
||||
|
||||
Reference in New Issue
Block a user