forked from farhoodlabs/skills
feat: add playwright-ephemeral skill for ephemeral browser provisioning
Adds a new skill that provisions ephemeral Playwright MCP browser sessions as Kubernetes Jobs for E2E testing. Includes provision and teardown scripts, K8s Job/Service YAML templates, and agent-facing SKILL.md documentation. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
die() { echo "ERROR: $*" >&2; exit 1; }
|
||||
|
||||
# --- Dependencies ---
|
||||
command -v kubectl >/dev/null 2>&1 || die "kubectl is not installed or not in PATH"
|
||||
|
||||
# --- Arguments ---
|
||||
SESSION_NAME="${1:-}"
|
||||
[ -n "$SESSION_NAME" ] || die "Usage: teardown.sh <session-name>"
|
||||
|
||||
NAMESPACE="${PLAYWRIGHT_NAMESPACE:-playwright-sessions}"
|
||||
|
||||
# --- Delete Job and Service ---
|
||||
echo "Tearing down session: ${SESSION_NAME} in namespace: ${NAMESPACE}" >&2
|
||||
|
||||
kubectl delete job "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2
|
||||
echo "Job deleted." >&2
|
||||
|
||||
kubectl delete service "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2
|
||||
echo "Service deleted." >&2
|
||||
|
||||
echo "Session ${SESSION_NAME} torn down successfully." >&2
|
||||
Reference in New Issue
Block a user