mirror of
git://f0xx.org/android_cast
synced 2026-07-29 06:18:42 +03:00
sync landing 2
This commit is contained in:
@@ -22,6 +22,25 @@ Landing uses **`index.php`** (shared footer from `examples/platform/footer.confi
|
||||
|
||||
**Multipage landing (2026-06):** sync `hub-landing.css`, `landing-pages.inc.php`, `assets/hub-landing.js`, `assets/hub-i18n.js`, `assets/i18n/hub-en.json`, `assets/i18n/hub-ru.json` with `index.php`.
|
||||
|
||||
**One-shot sync (recommended):**
|
||||
|
||||
```bash
|
||||
# sshfs mount at tmp/BE_alpine/... OR pass BE path:
|
||||
./examples/app_hub/scripts/sync-landing-to-be.sh
|
||||
|
||||
# Or direct to Alpine BE:
|
||||
REMOTE=alpine-be ./examples/app_hub/scripts/sync-landing-to-be.sh
|
||||
```
|
||||
|
||||
**Verify deploy actually landed** (old hub title is `Project hub`; new is `Landing`):
|
||||
|
||||
```bash
|
||||
curl -sS 'https://apps.f0xx.org/app/androidcast_project/' | grep -E '<title>|hub-landing|landing-top'
|
||||
curl -sS -o /dev/null -w '%{http_code}\n' 'https://apps.f0xx.org/app/androidcast_project/hub-landing.css'
|
||||
```
|
||||
|
||||
Expect `Android Cast — Landing`, `hub-landing.css`, and HTTP **200** (not 404).
|
||||
|
||||
```bash
|
||||
cp .../android_cast/examples/app_hub/index.php \
|
||||
.../htdocs/apps/app/androidcast_project/index.php
|
||||
|
||||
@@ -7,7 +7,7 @@ location = /app/androidcast_project {
|
||||
|
||||
location /app/androidcast_project/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/;
|
||||
index index.html;
|
||||
index index.php index.html;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/crashes/assets/ {
|
||||
|
||||
96
examples/app_hub/scripts/sync-landing-to-be.sh
Executable file
96
examples/app_hub/scripts/sync-landing-to-be.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
# Sync multipage landing from repo to BE hub root.
|
||||
# Usage:
|
||||
# ./scripts/sync-landing-to-be.sh
|
||||
# ./scripts/sync-landing-to-be.sh /path/to/BE/.../androidcast_project
|
||||
# REMOTE=alpine-be ./scripts/sync-landing-to-be.sh
|
||||
#
|
||||
# After sync, verify:
|
||||
# curl -sS 'https://apps.f0xx.org/app/androidcast_project/' | head -20
|
||||
# Expect: title "Android Cast — Landing", link hub-landing.css, body hub-landing
|
||||
set -euo pipefail
|
||||
|
||||
SRC="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
REPO="$(cd "$SRC/../.." && pwd)"
|
||||
DEFAULT_DEST="$REPO/tmp/BE_alpine/var/www/localhost/htdocs/apps/app/androidcast_project"
|
||||
DEST="${1:-$DEFAULT_DEST}"
|
||||
REMOTE="${REMOTE:-}"
|
||||
|
||||
hub_files=(
|
||||
index.php
|
||||
index.html
|
||||
hub.css
|
||||
hub-logo-layers.css
|
||||
hub-landing.css
|
||||
landing-pages.inc.php
|
||||
)
|
||||
|
||||
asset_files=(
|
||||
assets/hub-landing.js
|
||||
assets/hub-i18n.js
|
||||
assets/hub-globe.js
|
||||
assets/analytics.config.js
|
||||
assets/i18n/hub-en.json
|
||||
assets/i18n/hub-ru.json
|
||||
)
|
||||
|
||||
sync_local() {
|
||||
local dest="$1"
|
||||
if [[ ! -d "$dest" ]]; then
|
||||
echo "DEST not found: $dest" >&2
|
||||
echo "Mount BE sshfs or pass the BE androidcast_project path as arg 1." >&2
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$dest/assets/i18n"
|
||||
for f in "${hub_files[@]}"; do
|
||||
install -m 0644 "$SRC/$f" "$dest/$f"
|
||||
echo " $f"
|
||||
done
|
||||
for f in "${asset_files[@]}"; do
|
||||
install -D -m 0644 "$SRC/$f" "$dest/$f"
|
||||
echo " $f"
|
||||
done
|
||||
PLATFORM_SRC="$REPO/examples/platform"
|
||||
PLATFORM_DEST="$dest/android_cast/examples/platform"
|
||||
if [[ -d "$PLATFORM_SRC" ]]; then
|
||||
mkdir -p "$PLATFORM_DEST"
|
||||
rsync -a --no-group --no-owner "$PLATFORM_SRC/" "$PLATFORM_DEST/"
|
||||
echo " platform/ (footer)"
|
||||
fi
|
||||
}
|
||||
|
||||
verify_hint() {
|
||||
cat <<'EOF'
|
||||
|
||||
Verify on BE or public URL:
|
||||
curl -sS 'https://apps.f0xx.org/app/androidcast_project/' | grep -E 'Landing|hub-landing|landing-top'
|
||||
curl -sS -o /dev/null -w '%{http_code}\n' 'https://apps.f0xx.org/app/androidcast_project/hub-landing.css'
|
||||
|
||||
Expect: title "Android Cast — Landing", HTTP 200 for hub-landing.css.
|
||||
Then hard-refresh the browser (Ctrl+Shift+R).
|
||||
EOF
|
||||
}
|
||||
|
||||
echo "Sync landing hub → $DEST"
|
||||
if [[ -n "$REMOTE" ]]; then
|
||||
tmp="$(mktemp -d)"
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
for f in "${hub_files[@]}"; do cp "$SRC/$f" "$tmp/"; done
|
||||
mkdir -p "$tmp/assets/i18n"
|
||||
for f in "${asset_files[@]}"; do
|
||||
mkdir -p "$tmp/$(dirname "$f")"
|
||||
cp "$SRC/$f" "$tmp/$f"
|
||||
done
|
||||
scp "$tmp/index.php" "$tmp/index.html" "$tmp/hub.css" "$tmp/hub-logo-layers.css" \
|
||||
"$tmp/hub-landing.css" "$tmp/landing-pages.inc.php" \
|
||||
"$REMOTE:/var/www/localhost/htdocs/apps/app/androidcast_project/"
|
||||
scp -r "$tmp/assets/hub-landing.js" "$tmp/assets/hub-i18n.js" "$tmp/assets/hub-globe.js" \
|
||||
"$tmp/assets/analytics.config.js" "$tmp/assets/i18n" \
|
||||
"$REMOTE:/var/www/localhost/htdocs/apps/app/androidcast_project/assets/"
|
||||
echo "Remote sync via $REMOTE complete."
|
||||
else
|
||||
sync_local "$DEST"
|
||||
echo "Local sync complete."
|
||||
fi
|
||||
|
||||
verify_hint
|
||||
Reference in New Issue
Block a user