Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84ad19a47e | ||
|
|
058acd6325 | ||
|
|
497209fc9a | ||
|
|
2289480812 | ||
|
|
de418c0da8 | ||
|
|
713e328138 | ||
|
|
6a5a80d7af | ||
|
|
88f0439f79 | ||
|
|
c244424af9 | ||
|
|
c26d888263 | ||
|
|
f8dbd01358 | ||
|
|
e3d5d8b0d3 | ||
|
|
1b7511f6ca | ||
|
|
9d2cc2fcb3 | ||
|
|
44480221db | ||
|
|
4d13a4ef25 | ||
|
|
22f408cc60 | ||
|
|
927459344b | ||
|
|
08ab9ba069 | ||
|
|
1918c8d9c7 | ||
|
|
381254ed4d | ||
|
|
a11a6ef59f | ||
|
|
086e4682d4 | ||
|
|
bf22dc2511 | ||
|
|
6585c9ffcb | ||
|
|
13585491a4 | ||
|
|
72a629e88b | ||
|
|
f57bec560a | ||
|
|
1f49486870 | ||
|
|
06f7cfbfad | ||
|
|
e1b92278a5 | ||
|
|
b3c50f4694 | ||
|
|
7dd05ac92f | ||
|
|
800a82045d | ||
|
|
c96dec4692 | ||
|
|
417c126777 | ||
|
|
1205192e8a | ||
|
|
aa2f547856 | ||
|
|
57e72de021 | ||
|
|
15ae2b8221 | ||
|
|
f895b7979d | ||
|
|
bec7f067bc | ||
|
|
e50a3e80e9 | ||
|
|
afb0b931c5 | ||
|
|
fb1568259b | ||
|
|
c1049bf69d | ||
|
|
b05fe5b302 | ||
|
|
505eda01a3 | ||
|
|
d329cbd6ef | ||
|
|
1e4dcaaf3b | ||
|
|
4c5ec099d0 |
@@ -17,9 +17,15 @@ COPY assets/favicon /usr/share/nginx/html/assets/favicon
|
||||
COPY assets/video /usr/share/nginx/html/assets/video
|
||||
|
||||
# Le immagini e i font citati da index.html e style.css prendono ?v=<versione>, come quelli caricati dal codice.
|
||||
# Alla versione si aggiunge l'impronta del contenuto di assets/: uno sfondo rifatto senza cambiare versione (in
|
||||
# locale, fra un bump e l'altro) ha un indirizzo nuovo, e il browser non tiene quello vecchio dalla cache lunga.
|
||||
RUN cd /usr/share/nginx/html \
|
||||
&& V=$(sed -n "s/^export const VERSION = '\([0-9.]*\)';$/\1/p" src/version.js) \
|
||||
&& test -n "$V" \
|
||||
&& H=$(find assets -type f -exec md5sum {} + | sort -k2 | md5sum | cut -c1-8) \
|
||||
&& sed -i -E 's#v=\$\{VERSION\}#v=${VERSION}-'"$H"'#' src/version.js \
|
||||
&& grep -q "VERSION}-$H" src/version.js \
|
||||
&& V="$V-$H" \
|
||||
&& sed -i -E "s#url\((assets/[^)]*)\)#url(\1?v=$V)#g" style.css \
|
||||
&& sed -i -E "s#src=\"(assets/[^\"]*)\"#src=\"\1?v=$V\"#g" index.html \
|
||||
&& grep -q "?v=$V" style.css && grep -q "?v=$V" index.html
|
||||
|
||||
@@ -24,7 +24,7 @@ CROP ?=
|
||||
COLORS ?= 64
|
||||
|
||||
.PHONY: help serve open test browser verify check-public bump voci voci-elenco sfondi sfondi-genera sfondi-confronto background character \
|
||||
build up down restart logs ps shell image-size deploy deploy-logs clean distclean
|
||||
build up down restart logs ps shell image-size deploy deploy-vps deploy-logs clean distclean
|
||||
|
||||
## ------------------------------------------------------------ sviluppo
|
||||
|
||||
@@ -124,6 +124,8 @@ image-size: ## Dimensione dell'immagine
|
||||
# Host e indirizzo stanno in deploy.local.mk, fuori da git, per esempio:
|
||||
# DEPLOY_HOST = root@mio-server
|
||||
# DEPLOY_URL = https://gioco.esempio
|
||||
# VPS_HOST = mio-vps (facoltativo: una seconda copia, con make deploy-vps)
|
||||
# VPS_DIR = docker/leggenda-regolo
|
||||
-include deploy.local.mk
|
||||
DEPLOY_DIR ?= /root/leggenda-regolo
|
||||
DEPLOY_TMP := $(shell mktemp -d -u /tmp/regolo-deploy.XXXXXX)
|
||||
@@ -151,6 +153,16 @@ deploy: ## Pubblica l'ultimo commit: test, immagine costruita e provata qui, spe
|
||||
xargs -r -I{} docker image rm -f $(IMAGE):{} >/dev/null
|
||||
@echo "→ $(DEPLOY_URL) ($$(git log -1 --format='%h %s'))"
|
||||
|
||||
deploy-vps: ## Spedisce al VPS (VPS_HOST, VPS_DIR in deploy.local.mk) l'immagine dell'ultimo commit già provata da make deploy
|
||||
@test -n "$(VPS_HOST)" -a -n "$(VPS_DIR)" || { echo "mancano VPS_HOST e VPS_DIR: scrivili in deploy.local.mk"; exit 2; }
|
||||
@docker image inspect $(IMAGE):$$(git rev-parse --short HEAD) >/dev/null 2>&1 || \
|
||||
{ echo "manca l'immagine dell'ultimo commit ($$(git rev-parse --short HEAD)): prima make deploy"; exit 1; }
|
||||
ssh $(VPS_HOST) 'mkdir -p $(VPS_DIR)'
|
||||
git show HEAD:docker-compose.homeserver.yml | ssh $(VPS_HOST) 'cat > $(VPS_DIR)/docker-compose.yml'
|
||||
docker save $(IMAGE):$$(git rev-parse --short HEAD) $(IMAGE):latest | gzip | \
|
||||
ssh $(VPS_HOST) 'gunzip | docker load -q && cd $(VPS_DIR) && docker compose up -d && docker image prune -f >/dev/null'
|
||||
@ssh $(VPS_HOST) "docker exec $(IMAGE) grep -o \"VERSION = '[^']*'\" /usr/share/nginx/html/src/version.js" | sed 's/^/→ $(VPS_HOST): /'
|
||||
|
||||
deploy-logs: ## Log del container sul server di deploy
|
||||
@test -n "$(DEPLOY_HOST)" || { echo "manca DEPLOY_HOST: scrivilo in deploy.local.mk"; exit 2; }
|
||||
ssh $(DEPLOY_HOST) 'cd $(DEPLOY_DIR) && docker compose logs -f --tail 50'
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"image": "bertovo.png",
|
||||
"height": 120,
|
||||
"frames": {
|
||||
"stand": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 53,
|
||||
"h": 120,
|
||||
"ax": 27.4,
|
||||
"ay": 120
|
||||
},
|
||||
"blink": {
|
||||
"x": 55,
|
||||
"y": 0,
|
||||
"w": 52,
|
||||
"h": 121,
|
||||
"ax": 26.1,
|
||||
"ay": 121
|
||||
},
|
||||
"talk": {
|
||||
"x": 109,
|
||||
"y": 0,
|
||||
"w": 79,
|
||||
"h": 121,
|
||||
"ax": 31.3,
|
||||
"ay": 121
|
||||
},
|
||||
"explain": {
|
||||
"x": 190,
|
||||
"y": 0,
|
||||
"w": 58,
|
||||
"h": 121,
|
||||
"ax": 30.2,
|
||||
"ay": 121
|
||||
},
|
||||
"laugh": {
|
||||
"x": 250,
|
||||
"y": 0,
|
||||
"w": 54,
|
||||
"h": 122,
|
||||
"ax": 28.6,
|
||||
"ay": 122
|
||||
},
|
||||
"chalk": {
|
||||
"x": 306,
|
||||
"y": 0,
|
||||
"w": 55,
|
||||
"h": 121,
|
||||
"ax": 25.0,
|
||||
"ay": 121
|
||||
},
|
||||
"shrug": {
|
||||
"x": 363,
|
||||
"y": 0,
|
||||
"w": 91,
|
||||
"h": 122,
|
||||
"ax": 45.4,
|
||||
"ay": 122
|
||||
},
|
||||
"cheer": {
|
||||
"x": 456,
|
||||
"y": 0,
|
||||
"w": 58,
|
||||
"h": 125,
|
||||
"ax": 31.0,
|
||||
"ay": 125
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 95 KiB |
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"image": "chiaru.png",
|
||||
"height": 120,
|
||||
"frames": {
|
||||
"explain": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 56,
|
||||
"h": 120,
|
||||
"ax": 31.5,
|
||||
"ay": 120
|
||||
},
|
||||
"talk": {
|
||||
"x": 58,
|
||||
"y": 0,
|
||||
"w": 64,
|
||||
"h": 119,
|
||||
"ax": 38.5,
|
||||
"ay": 119
|
||||
},
|
||||
"blink": {
|
||||
"x": 124,
|
||||
"y": 0,
|
||||
"w": 44,
|
||||
"h": 120,
|
||||
"ax": 24.2,
|
||||
"ay": 120
|
||||
},
|
||||
"stand": {
|
||||
"x": 170,
|
||||
"y": 0,
|
||||
"w": 44,
|
||||
"h": 120,
|
||||
"ax": 24.2,
|
||||
"ay": 120
|
||||
},
|
||||
"cheer": {
|
||||
"x": 216,
|
||||
"y": 0,
|
||||
"w": 66,
|
||||
"h": 118,
|
||||
"ax": 31.5,
|
||||
"ay": 118
|
||||
},
|
||||
"shrug": {
|
||||
"x": 284,
|
||||
"y": 0,
|
||||
"w": 79,
|
||||
"h": 119,
|
||||
"ax": 42.2,
|
||||
"ay": 119
|
||||
},
|
||||
"watch": {
|
||||
"x": 365,
|
||||
"y": 0,
|
||||
"w": 63,
|
||||
"h": 98,
|
||||
"ax": 30.3,
|
||||
"ay": 98
|
||||
},
|
||||
"laugh": {
|
||||
"x": 430,
|
||||
"y": 0,
|
||||
"w": 52,
|
||||
"h": 120,
|
||||
"ax": 30.3,
|
||||
"ay": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 100 KiB |
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"image": "zio_mario.png",
|
||||
"height": 120,
|
||||
"frames": {
|
||||
"explain": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 67,
|
||||
"h": 120,
|
||||
"ax": 33.8,
|
||||
"ay": 120
|
||||
},
|
||||
"talk": {
|
||||
"x": 69,
|
||||
"y": 0,
|
||||
"w": 79,
|
||||
"h": 120,
|
||||
"ax": 44.8,
|
||||
"ay": 120
|
||||
},
|
||||
"blink": {
|
||||
"x": 150,
|
||||
"y": 0,
|
||||
"w": 57,
|
||||
"h": 120,
|
||||
"ax": 28.1,
|
||||
"ay": 120
|
||||
},
|
||||
"stand": {
|
||||
"x": 209,
|
||||
"y": 0,
|
||||
"w": 57,
|
||||
"h": 120,
|
||||
"ax": 27.8,
|
||||
"ay": 120
|
||||
},
|
||||
"shrug": {
|
||||
"x": 268,
|
||||
"y": 0,
|
||||
"w": 94,
|
||||
"h": 120,
|
||||
"ax": 48.1,
|
||||
"ay": 120
|
||||
},
|
||||
"point": {
|
||||
"x": 364,
|
||||
"y": 0,
|
||||
"w": 87,
|
||||
"h": 120,
|
||||
"ax": 51.0,
|
||||
"ay": 120
|
||||
},
|
||||
"think": {
|
||||
"x": 453,
|
||||
"y": 0,
|
||||
"w": 58,
|
||||
"h": 121,
|
||||
"ax": 29.2,
|
||||
"ay": 121
|
||||
},
|
||||
"laugh": {
|
||||
"x": 513,
|
||||
"y": 0,
|
||||
"w": 59,
|
||||
"h": 121,
|
||||
"ax": 30.1,
|
||||
"ay": 121
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 526 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 388 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 1006 B |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 475 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 456 KiB |
|
After Width: | Height: | Size: 280 KiB |
|
After Width: | Height: | Size: 233 KiB |
|
After Width: | Height: | Size: 228 KiB |
|
After Width: | Height: | Size: 235 KiB |