Verbeter anatomie en plaatsing van avataraccessoires (v0.4.46-beta) #1
6 changed files with 20 additions and 13 deletions
|
|
@ -23,9 +23,11 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
||||||
|
VERSION="$(tr -d '[:space:]' < VERSION)"
|
||||||
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"
|
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"
|
||||||
echo "sha_tag=${IMAGE}:dev-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
echo "sha_tag=${IMAGE}:dev-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
||||||
echo "dev_tag=${IMAGE}:dev" >> "$GITHUB_OUTPUT"
|
echo "dev_tag=${IMAGE}:dev" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "app_version=${VERSION}-beta" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# Platte docker build/push i.p.v. buildx: betrouwbaarder tegen een
|
# Platte docker build/push i.p.v. buildx: betrouwbaarder tegen een
|
||||||
# HTTP-registry. De runner-host moet 10.0.20.22:3000 als
|
# HTTP-registry. De runner-host moet 10.0.20.22:3000 als
|
||||||
|
|
@ -34,7 +36,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg APP_VERSION="dev-${GITHUB_SHA::7}" \
|
--build-arg APP_VERSION="${{ steps.meta.outputs.app_version }}" \
|
||||||
|
--build-arg GIT_SHA="${GITHUB_SHA::7}" \
|
||||||
-t "${{ steps.meta.outputs.sha_tag }}" \
|
-t "${{ steps.meta.outputs.sha_tag }}" \
|
||||||
-t "${{ steps.meta.outputs.dev_tag }}" .
|
-t "${{ steps.meta.outputs.dev_tag }}" .
|
||||||
docker push "${{ steps.meta.outputs.sha_tag }}"
|
docker push "${{ steps.meta.outputs.sha_tag }}"
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ jobs:
|
||||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg APP_VERSION="${{ steps.meta.outputs.version }}" \
|
--build-arg APP_VERSION="${{ steps.meta.outputs.version }}" \
|
||||||
|
--build-arg GIT_SHA="${GITHUB_SHA::7}" \
|
||||||
-t "${{ steps.meta.outputs.version_tag }}" \
|
-t "${{ steps.meta.outputs.version_tag }}" \
|
||||||
-t "${{ steps.meta.outputs.latest_tag }}" .
|
-t "${{ steps.meta.outputs.latest_tag }}" .
|
||||||
docker push "${{ steps.meta.outputs.version_tag }}"
|
docker push "${{ steps.meta.outputs.version_tag }}"
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,11 @@ COPY --chown=app:app src ./src
|
||||||
COPY --chown=app:app public ./public
|
COPY --chown=app:app public ./public
|
||||||
COPY --chown=app:app db ./db
|
COPY --chown=app:app db ./db
|
||||||
|
|
||||||
# Versie wordt tijdens de build meegegeven door CI
|
# Versie + commit-hash worden tijdens de build meegegeven door CI
|
||||||
ARG APP_VERSION=dev
|
ARG APP_VERSION=dev
|
||||||
ENV APP_VERSION=$APP_VERSION
|
ENV APP_VERSION=$APP_VERSION
|
||||||
|
ARG GIT_SHA=
|
||||||
|
ENV GIT_SHA=$GIT_SHA
|
||||||
|
|
||||||
USER app
|
USER app
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
|
||||||
1
VERSION
Normal file
1
VERSION
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0.2.10
|
||||||
|
|
@ -1,23 +1,22 @@
|
||||||
/* teach - kern: versie, i18n, accounts, opslag, geluid */
|
/* teach - kern: versie, i18n, accounts, opslag, geluid */
|
||||||
"use strict";
|
"use strict";
|
||||||
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline) */
|
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline).
|
||||||
const VERSION = "0.2.08";
|
Kept in sync by hand with the VERSION file at the repo root on every release. */
|
||||||
|
const VERSION = "0.2.10";
|
||||||
(function(){
|
(function(){
|
||||||
const tag = document.getElementById("verTag");
|
const tag = document.getElementById("verTag");
|
||||||
tag.textContent = "v"+VERSION;
|
tag.textContent = "v"+VERSION;
|
||||||
/* the real deployed version always wins once known: dev branch deploys report
|
/* the real deployed version always wins once known: CI reads the VERSION file
|
||||||
a dev-<sha> build via /api/version → mark as beta; release builds report the
|
and passes it as APP_VERSION ("0.2.10-beta" on dev, the release tag on prod)
|
||||||
actual release tag (e.g. v1.2.0) → show that instead of the local fallback */
|
- never a raw git sha, that's only kept as a hover-title for support/debug */
|
||||||
fetch("/api/version")
|
fetch("/api/version")
|
||||||
.then(r=>r.ok ? r.json() : null)
|
.then(r=>r.ok ? r.json() : null)
|
||||||
.then(v=>{
|
.then(v=>{
|
||||||
if(!v || typeof v.version!=="string") return;
|
if(!v || typeof v.version!=="string") return;
|
||||||
if(v.version.startsWith("dev")){
|
const text = v.version.startsWith("v") ? v.version : "v"+v.version;
|
||||||
tag.textContent = v.version+" · beta";
|
tag.textContent = text;
|
||||||
tag.classList.add("beta");
|
tag.classList.toggle("beta", text.includes("beta"));
|
||||||
}else{
|
if(v.sha) tag.title = v.sha;
|
||||||
tag.textContent = v.version;
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(()=>{});
|
.catch(()=>{});
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ export default async function api(app) {
|
||||||
app.get('/version', async () => ({
|
app.get('/version', async () => ({
|
||||||
name: 'teach',
|
name: 'teach',
|
||||||
version: process.env.APP_VERSION ?? 'dev',
|
version: process.env.APP_VERSION ?? 'dev',
|
||||||
|
sha: process.env.GIT_SHA || undefined,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// ---- publiek: scholenlijst voor het inlogscherm ----------------------------
|
// ---- publiek: scholenlijst voor het inlogscherm ----------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue