| 1 | #!/usr/bin/env bash |
| 2 | # Installs Ghost with setup.sh exactly as a self-hoster would, then drives it |
| 3 | # from the outside with e2e.mjs. Tears everything down afterwards unless KEEP=1. |
| 4 | # docker/test/e2e.sh |
| 5 | # E2E_COMPOSE_EXTRA adds one more compose file, for example to move ports that |
| 6 | # are taken on this machine; the E2E_* URLs in e2e.mjs then follow it. |
| 7 | set -euo pipefail |
| 8 | |
| 9 | here=$(cd "$( |
| 10 | docker_dir=$(dirname "$here |
| 11 | cd "$docker_dir" |
| 12 | |
| 13 | [[ ! -f .env ]] || |
| 14 | |
| 15 | export COMPOSE_FILE="compose.yaml:test/compose.e2e.yaml${ |
| 16 | |
| 17 | cleanup() { |
| 18 | status=$? |
| 19 | if [[ $status != |
| 20 | docker compose ps -a |
| 21 | docker compose logs --no-color |
| 22 | fi |
| 23 | if [[ ${KEEP:- |
| 24 | docker compose down -v |
| 25 | rm -f .env |
| 26 | fi |
| 27 | exit $status |
| 28 | } |
| 29 | trap cleanup EXIT |
| 30 | |
| 31 | # Answers, in order: address, SSH port, SMTP, host, port, user, password, |
| 32 | # sender, require verification, bundled storage, then three generated secrets. |
| 33 | printf '%s\n' localhost |
| 34 | |
| 35 | node "$here/e2e.mjs" |