Compare commits
No commits in common. "06ce2c58d1117de33c81bb5095dabfda41b656b2" and "83b1616ed65cf422beb1a2f1f64584126bfe07c6" have entirely different histories.
06ce2c58d1
...
83b1616ed6
4 changed files with 13 additions and 150 deletions
|
|
@ -147,31 +147,6 @@ podman exec taler-hacktivism-bank crontab -l # inspect
|
|||
curl -sS https://bank.hacktivism.ch/intro/stats.json | python3 -m json.tool | head
|
||||
```
|
||||
|
||||
## Publish / trigger deploy (laptop → koopa)
|
||||
|
||||
SoT is this git tree. Live CTR is `goa-regio-ng` on koopa (`hernani@192.168.100.95`).
|
||||
There is **no** CI hook: publish is an explicit script run after commit (or after stamp).
|
||||
|
||||
```bash
|
||||
# A) Publish current SoT HTML/nginx/js into CTR (usual after pull/edit):
|
||||
./scripts/taler-landing/deploy-landings.sh --ssh
|
||||
# same with explicit host / CTR:
|
||||
./scripts/taler-landing/deploy-landings.sh --ssh hernani@192.168.100.95 --ctr goa-regio-ng
|
||||
|
||||
# B) Stamp stack-bar from live dpkg, then publish in one shot:
|
||||
./scripts/taler-landing/stamp-landing-stack.sh --deploy
|
||||
|
||||
# C) Bump landing version footer(s), then publish:
|
||||
./scripts/taler-landing/stamp-landing-version.sh --bump bank --deploy
|
||||
./scripts/taler-landing/stamp-landing-version.sh --bump --all --deploy
|
||||
|
||||
# On koopa only (tree already synced under ~/src/koopa/koopa-admin-log):
|
||||
./scripts/taler-landing/deploy-landings.sh --local
|
||||
```
|
||||
|
||||
`--deploy` on the stamp scripts always chains into `deploy-landings.sh --ssh` (or `--local`
|
||||
when already on the host), so stamp cannot leave Live behind SoT.
|
||||
|
||||
## Landing content version (per site)
|
||||
|
||||
Each landing footer shows **Bank|Exchange|Merchant landing vN** + last content
|
||||
|
|
@ -180,8 +155,9 @@ change + linkified git commit. Versions are **independent** (start **v42** each)
|
|||
- State: `configs/shared/landing-version.json` → `sites.bank|exchange|merchant`
|
||||
- After editing one site (example bank):
|
||||
```bash
|
||||
./scripts/taler-landing/stamp-landing-version.sh --bump bank --deploy
|
||||
git add configs/ scripts/taler-landing/ && git commit # subject via git-worker
|
||||
./scripts/taler-landing/stamp-landing-version.sh --bump bank
|
||||
git add configs/ && git commit -m "landing(bank): …"
|
||||
./scripts/taler-landing/stamp-landing-version.sh bank
|
||||
git add configs/ && git commit --amend --no-edit # optional pin
|
||||
```
|
||||
- Re-stamp all without bump: `./scripts/taler-landing/stamp-landing-version.sh --all`
|
||||
- Re-stamp + publish: `./scripts/taler-landing/stamp-landing-version.sh --all --deploy`
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
# Install bank + exchange + merchant landing pages inside containers and ensure
|
||||
# nginx listens on 9013 (bank) / 9014 (exchange) / 9015 (merchant).
|
||||
#!/bin/bash
|
||||
# Install exchange + merchant landing pages inside containers and ensure nginx
|
||||
# listens on 9014 (exchange) / 9015 (merchant).
|
||||
#
|
||||
# Port map (wire these in Caddy / podman -p):
|
||||
# 9013 bank landing
|
||||
|
|
@ -9,18 +9,10 @@
|
|||
# Unified vanilla CTR: set LANDING_CTR=goa-regio-ng (default) so all three
|
||||
# landings land in the same container publishing 9010-9015.
|
||||
#
|
||||
# Usage:
|
||||
# # on koopa (podman local):
|
||||
# LANDING_CTR=goa-regio-ng ./scripts/taler-landing/deploy-landings.sh
|
||||
# # from laptop (rsync SoT → remote tree, then deploy there):
|
||||
# ./scripts/taler-landing/deploy-landings.sh --ssh hernani@192.168.100.95
|
||||
# ./scripts/taler-landing/deploy-landings.sh --ssh # uses LANDING_SSH
|
||||
#
|
||||
# After stamp-landing-stack / stamp-landing-version, prefer --deploy on those
|
||||
# scripts so publish cannot be skipped.
|
||||
# Run on koopa (host) with podman access.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
|
||||
# allow override when files already on host /tmp
|
||||
SRC_EX="${SRC_EX:-$ROOT/configs/exchange-landing}"
|
||||
SRC_MER="${SRC_MER:-$ROOT/configs/merchant-landing}"
|
||||
|
|
@ -33,33 +25,6 @@ C_EX="${C_EX:-$LANDING_CTR}"
|
|||
C_MER="${C_MER:-$LANDING_CTR}"
|
||||
C_BANK="${C_BANK:-$LANDING_CTR}"
|
||||
|
||||
SSH_HOST="${LANDING_SSH:-hernani@192.168.100.95}"
|
||||
# Remote sync tree on koopa (not a git checkout — laptop SoT is Freigabe-pushed).
|
||||
REMOTE_ROOT="${LANDING_REMOTE_ROOT:-src/koopa/koopa-admin-log}"
|
||||
USE_SSH=0
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--ctr) LANDING_CTR="${2:-}"; C_EX="$LANDING_CTR"; C_MER="$LANDING_CTR"; C_BANK="$LANDING_CTR"; shift 2 ;;
|
||||
--ssh)
|
||||
if [ $# -ge 2 ] && [[ "${2:-}" != -* ]]; then
|
||||
SSH_HOST="$2"
|
||||
shift 2
|
||||
else
|
||||
shift
|
||||
fi
|
||||
USE_SSH=1
|
||||
;;
|
||||
--local) USE_SSH=0; shift ;;
|
||||
--remote-root) REMOTE_ROOT="${2:-}"; shift 2 ;;
|
||||
-h|--help)
|
||||
sed -n '2,22p' "$0"
|
||||
exit 0
|
||||
;;
|
||||
*) echo "unknown arg: $1" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Prefer per-landing copy, then shared (keeps bank/exchange/merchant in sync)
|
||||
resolve_goa_amount() {
|
||||
local local_copy="$1"
|
||||
|
|
@ -83,44 +48,6 @@ copy_goa_amount() {
|
|||
fi
|
||||
}
|
||||
|
||||
deploy_via_ssh() {
|
||||
local host="$1"
|
||||
local remote_root="$2"
|
||||
echo "=== sync landings → ${host}:${remote_root} ==="
|
||||
ssh -o BatchMode=yes -o ConnectTimeout=12 "$host" "mkdir -p $(printf '%q' "$remote_root")/configs/shared $(printf '%q' "$remote_root")/scripts/taler-landing $(printf '%q' "$remote_root")/configs/bank-landing $(printf '%q' "$remote_root")/configs/exchange-landing $(printf '%q' "$remote_root")/configs/merchant-landing"
|
||||
|
||||
# SoT HTML / nginx / shared JS + this script (so remote deploy matches laptop).
|
||||
rsync -az --relative \
|
||||
"$ROOT/./configs/bank-landing/index.html" \
|
||||
"$ROOT/./configs/exchange-landing/index.html" \
|
||||
"$ROOT/./configs/exchange-landing/nginx-landing.conf" \
|
||||
"$ROOT/./configs/merchant-landing/index.html" \
|
||||
"$ROOT/./configs/merchant-landing/nginx-landing.conf" \
|
||||
"$ROOT/./configs/shared/goa-amount.js" \
|
||||
"$ROOT/./scripts/taler-landing/deploy-landings.sh" \
|
||||
"${host}:${remote_root}/"
|
||||
|
||||
if [ -f "$SRC_QR" ]; then
|
||||
rsync -az "$SRC_QR" "${host}:${remote_root}/configs/bank-landing/qrcode.min.js"
|
||||
fi
|
||||
for site in bank exchange merchant; do
|
||||
if [ -f "$ROOT/configs/${site}-landing/goa-amount.js" ]; then
|
||||
rsync -az "$ROOT/configs/${site}-landing/goa-amount.js" \
|
||||
"${host}:${remote_root}/configs/${site}-landing/goa-amount.js"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "=== remote deploy ctr=${LANDING_CTR} ==="
|
||||
# shellcheck disable=SC2029
|
||||
ssh -o BatchMode=yes -o ConnectTimeout=12 "$host" \
|
||||
"cd $(printf '%q' "$remote_root") && LANDING_CTR=$(printf '%q' "$LANDING_CTR") ./scripts/taler-landing/deploy-landings.sh --local"
|
||||
}
|
||||
|
||||
if [ "$USE_SSH" = 1 ]; then
|
||||
deploy_via_ssh "$SSH_HOST" "$REMOTE_ROOT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "=== bank landing → $C_BANK :9013 (html + goa-amount) ==="
|
||||
if podman inspect -f '{{.State.Running}}' "$C_BANK" 2>/dev/null | grep -qx true; then
|
||||
podman exec "$C_BANK" mkdir -p /var/www/bank-landing
|
||||
|
|
@ -185,4 +112,3 @@ echo " 9014 exchange landing ($C_EX)"
|
|||
echo " 9015 merchant landing ($C_MER)"
|
||||
echo
|
||||
echo "If host curl to :9014/:9015 fails, republish pasta ports (commit+replace) — see README."
|
||||
echo "OK deploy-landings: ctr=${LANDING_CTR} mode=local"
|
||||
|
|
|
|||
|
|
@ -9,14 +9,11 @@
|
|||
# ./scripts/taler-landing/stamp-landing-stack.sh
|
||||
# ./scripts/taler-landing/stamp-landing-stack.sh --ctr goa-regio-ng --ssh hernani@192.168.100.95
|
||||
# ./scripts/taler-landing/stamp-landing-stack.sh bank exchange
|
||||
# ./scripts/taler-landing/stamp-landing-stack.sh --deploy
|
||||
# stamp then publish via deploy-landings.sh --ssh (same host/ctr)
|
||||
#
|
||||
# After this, bump footer dates with:
|
||||
# ./scripts/taler-landing/stamp-landing-version.sh --bump --all
|
||||
# One-shot stamp+live (preferred — avoids stamped-but-not-deployed lag):
|
||||
# ./scripts/taler-landing/stamp-landing-stack.sh --deploy
|
||||
# ./scripts/taler-landing/stamp-landing-version.sh --bump --all --deploy
|
||||
# Then deploy (unified vanilla CTR):
|
||||
# LANDING_CTR=goa-regio-ng ./scripts/taler-landing/deploy-landings.sh
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
|
|
@ -26,7 +23,6 @@ VERS_OUT="$ROOT/configs/shared/landing-stack-versions.json"
|
|||
CTR="${LANDING_CTR:-goa-regio-ng}"
|
||||
SSH_HOST="${LANDING_SSH:-hernani@192.168.100.95}"
|
||||
USE_SSH=1
|
||||
DO_DEPLOY=0
|
||||
sites=()
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
|
|
@ -34,10 +30,9 @@ while [ $# -gt 0 ]; do
|
|||
--ctr) CTR="${2:-}"; shift 2 ;;
|
||||
--ssh) SSH_HOST="${2:-}"; USE_SSH=1; shift 2 ;;
|
||||
--local) USE_SSH=0; shift ;;
|
||||
--deploy) DO_DEPLOY=1; shift ;;
|
||||
bank|exchange|merchant) sites+=("$1"); shift ;;
|
||||
-h|--help)
|
||||
sed -n '2,24p' "$0"
|
||||
sed -n '2,20p' "$0"
|
||||
exit 0
|
||||
;;
|
||||
*) echo "unknown arg: $1" >&2; exit 2 ;;
|
||||
|
|
@ -182,15 +177,3 @@ print(f"OK stack stamped: {' '.join(sites)} @ {human}")
|
|||
PY
|
||||
|
||||
echo "OK stamp-landing-stack: ${sites[*]} ← ${CTR}"
|
||||
|
||||
if [ "$DO_DEPLOY" = 1 ]; then
|
||||
deploy="$ROOT/scripts/taler-landing/deploy-landings.sh"
|
||||
[ -x "$deploy" ] || { echo "missing $deploy" >&2; exit 1; }
|
||||
if [ "$USE_SSH" = 1 ]; then
|
||||
echo "=== --deploy → deploy-landings.sh --ssh ${SSH_HOST} --ctr ${CTR} ==="
|
||||
LANDING_CTR="$CTR" "$deploy" --ssh "$SSH_HOST" --ctr "$CTR"
|
||||
else
|
||||
echo "=== --deploy → deploy-landings.sh --local --ctr ${CTR} ==="
|
||||
LANDING_CTR="$CTR" "$deploy" --local --ctr "$CTR"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -21,17 +21,11 @@
|
|||
# 3) git add configs/ && git commit -m "landing(bank): …"
|
||||
# 4) ./scripts/taler-landing/stamp-landing-version.sh bank
|
||||
# git add configs/ && git commit --amend --no-edit # optional pin
|
||||
# 5) ./scripts/taler-landing/deploy-landings.sh --ssh
|
||||
# or combine: stamp-landing-version.sh --bump bank --deploy
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
VER_FILE="$ROOT/configs/shared/landing-version.json"
|
||||
REPO_WEB="${LANDING_REPO_WEB:-https://git.hacktivism.ch/hernani/koopa-admin-log}"
|
||||
SSH_HOST="${LANDING_SSH:-hernani@192.168.100.95}"
|
||||
CTR="${LANDING_CTR:-goa-regio-ng}"
|
||||
DO_DEPLOY=0
|
||||
USE_SSH=1
|
||||
|
||||
declare -A SITE_HTML=(
|
||||
[bank]="$ROOT/configs/bank-landing/index.html"
|
||||
|
|
@ -61,13 +55,9 @@ while [ $# -gt 0 ]; do
|
|||
--bump) bump=1; shift ;;
|
||||
--set) set_ver="${2:-}"; shift 2 ;;
|
||||
--all) do_all=1; shift ;;
|
||||
--deploy) DO_DEPLOY=1; shift ;;
|
||||
--ssh) SSH_HOST="${2:-}"; USE_SSH=1; shift 2 ;;
|
||||
--local) USE_SSH=0; shift ;;
|
||||
--ctr) CTR="${2:-}"; shift 2 ;;
|
||||
bank|exchange|merchant) sites+=("$1"); shift ;;
|
||||
-h|--help)
|
||||
sed -n '2,32p' "$0"
|
||||
sed -n '2,28p' "$0"
|
||||
exit 0
|
||||
;;
|
||||
*) echo "unknown arg: $1 (sites: bank exchange merchant)" >&2; exit 2 ;;
|
||||
|
|
@ -201,15 +191,3 @@ PY
|
|||
done
|
||||
|
||||
echo "OK stamped: ${sites[*]}"
|
||||
|
||||
if [ "$DO_DEPLOY" = 1 ]; then
|
||||
deploy="$ROOT/scripts/taler-landing/deploy-landings.sh"
|
||||
[ -x "$deploy" ] || { echo "missing $deploy" >&2; exit 1; }
|
||||
if [ "$USE_SSH" = 1 ]; then
|
||||
echo "=== --deploy → deploy-landings.sh --ssh ${SSH_HOST} --ctr ${CTR} ==="
|
||||
LANDING_CTR="$CTR" "$deploy" --ssh "$SSH_HOST" --ctr "$CTR"
|
||||
else
|
||||
echo "=== --deploy → deploy-landings.sh --local --ctr ${CTR} ==="
|
||||
LANDING_CTR="$CTR" "$deploy" --local --ctr "$CTR"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue