diff --git a/Makefile b/Makefile index 6fcdaad7..8793763a 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ optimizer-test: optimizer/.venv/.installed optimizer/.venv/bin/pytest -q optimizer/tests compose-migration-test: - bash -n scripts/enable-modular-stack.sh scripts/migrate-legacy-compose.sh scripts/install-macos.sh + bash -n scripts/enable-modular-stack.sh scripts/migrate-legacy-compose.sh scripts/install-macos.sh scripts/deploy-home-link-web.sh bash scripts/test-modular-compose.sh container-boundary-test: diff --git a/scripts/deploy-home-link-web.sh b/scripts/deploy-home-link-web.sh new file mode 100755 index 00000000..1a62ef83 --- /dev/null +++ b/scripts/deploy-home-link-web.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# Deploy web/home-link.html + home-link-session.js + components/theme.css to +# home.sourceful.energy. Run from the FTW repo root, on the commit you want +# live. Mirrors the existing hand-rolled release layout; the previous +# release directory is left in place so a rollback is one container recreate. +set -euo pipefail + +INSTANCE=i-08351b29352efc64e +REGION=eu-central-1 +IMAGE=sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648 +NETWORK=buzz-prod_buzz-net +CONTAINER=ftw-home-link-web + +for f in web/home-link.html web/home-link-session.js web/components/theme.css; do + test -f "$f" || { echo "run me from the repo root; missing $f" >&2; exit 1; } +done + +SHA=$(git rev-parse --short=7 HEAD) +LABEL="${1:-$SHA}" +REL="/srv/ftw-home-link/releases/${LABEL}" +WORK=$(mktemp -d) +trap 'rm -rf "$WORK"' EXIT + +echo "==> packaging $LABEL" +mkdir -p "$WORK/bundle/components" +cp web/home-link.html web/home-link-session.js "$WORK/bundle/" +cp web/components/theme.css "$WORK/bundle/components/" +tar -czf "$WORK/web.tgz" -C "$WORK/bundle" . + +run_ssm() { # run_ssm