mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
- Add docker/sandbox/entrypoint.sh to auto-copy /ui-dist → internal/server/dist/ when missing, fixing the gitignore regression for all Docker workflows - Add scripts/_sandbox_common.sh with shared SCRIPT_DIR, PROJECT_ROOT, COMPOSE_FILE, and require_docker() function - Refactor all 5 sandbox scripts to source _sandbox_common.sh - Use YAML extension fields (x-sandbox-common) in docker-compose.sandbox.yml to eliminate duplicated service config - Break sandbox_playground_up.sh one-liner into readable steps, add skillshare-ui alias and init hint - Change test.sh to use `make build` for placeholder consistency
22 lines
674 B
Bash
Executable File
22 lines
674 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Enter the running Docker playground or execute a command inside it.
|
|
set -euo pipefail
|
|
|
|
source "$(dirname "$0")/_sandbox_common.sh"
|
|
SERVICE="sandbox-playground"
|
|
|
|
require_docker
|
|
cd "$PROJECT_ROOT"
|
|
|
|
if [[ -z "$(docker compose -f "$COMPOSE_FILE" --profile playground ps -q "$SERVICE")" ]]; then
|
|
echo "Playground is not running. Start it first:"
|
|
echo " ./scripts/sandbox_playground_up.sh"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $# -gt 0 ]]; then
|
|
docker compose -f "$COMPOSE_FILE" --profile playground exec --user "$(id -u):$(id -g)" "$SERVICE" bash -c "$*"
|
|
else
|
|
docker compose -f "$COMPOSE_FILE" --profile playground exec --user "$(id -u):$(id -g)" "$SERVICE" bash
|
|
fi
|