ework-aio 0.2.11 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-aio",
3
- "version": "0.2.11",
3
+ "version": "0.3.1",
4
4
  "description": "All-in-one installer for ework (issue tracker) + ework-daemon (AI bridge) + opencode-ework (plugin). One command: npm i -g ework-aio && ework-aio install.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,8 +46,8 @@
46
46
  "postinstall": "echo '\\n ework-aio installed. Run \\033[1mework-aio install\\033[0m to set up services.\\n Help: ework-aio --help\\n'"
47
47
  },
48
48
  "dependencies": {
49
- "ework-web": "^0.1.0",
50
- "ework-daemon": "^0.1.0",
49
+ "ework-web": "^0.3.0",
50
+ "ework-daemon": "^0.2.0",
51
51
  "opencode-ework": "^0.1.0",
52
52
  "zod": "^3.23.0"
53
53
  },
@@ -54,6 +54,39 @@ DAEMON_PORT="14101"
54
54
  # readonly so the container preflight sees it on PATH. Override via env.
55
55
  OPENCODE_HOST_BIN="${OPENCODE_HOST_BIN:-/home/dog/.local/bin/opencode}"
56
56
 
57
+ # Optional MySQL backend: E2E_DB=mysql starts a throwaway MySQL 8.0 sidecar
58
+ # reachable via the host network and passes WORK_DB_* through to ework-web.
59
+ # Default sqlite (no sidecar). Needs a published ework-web with MySQL support.
60
+ E2E_DB="${E2E_DB:-sqlite}"
61
+ MYSQL_FLAGS=()
62
+ MYSQL_CONTAINER=""
63
+ cleanup_mysql() { [[ -n "$MYSQL_CONTAINER" ]] && docker rm -f "$MYSQL_CONTAINER" >/dev/null 2>&1 || true; }
64
+ trap cleanup_mysql EXIT
65
+ if [[ "$E2E_DB" == "mysql" ]]; then
66
+ MYSQL_PORT="${E2E_MYSQL_PORT:-3312}"
67
+ MYSQL_CONTAINER="ework-e2e-mysql-$$"
68
+ info "E2E_DB=mysql: starting MySQL 8.0 sidecar (container $MYSQL_CONTAINER, host port $MYSQL_PORT)"
69
+ docker run -d --rm --name "$MYSQL_CONTAINER" -p "$MYSQL_PORT:3306" \
70
+ -e MYSQL_ROOT_PASSWORD=testpw -e MYSQL_DATABASE=ework_e2e mysql:8.0 >/dev/null
71
+ info "waiting for MySQL readiness (TCP+query gate, up to 60s)"
72
+ ready=0
73
+ for _ in $(seq 1 60); do
74
+ if docker exec "$MYSQL_CONTAINER" mysql -h 127.0.0.1 -ptestpw -e "SELECT 1" --silent 2>/dev/null; then
75
+ ready=1; break
76
+ fi
77
+ sleep 1
78
+ done
79
+ [[ "$ready" -eq 1 ]] || fail "MySQL sidecar did not become ready in 60s"
80
+ MYSQL_FLAGS=(
81
+ -e WORK_DB_DRIVER=mysql
82
+ -e WORK_DB_HOST=127.0.0.1
83
+ -e WORK_DB_PORT="$MYSQL_PORT"
84
+ -e WORK_DB_USER=root
85
+ -e WORK_DB_PASSWORD=testpw
86
+ -e WORK_DB_NAME=ework_e2e
87
+ )
88
+ fi
89
+
57
90
  "$RUNTIME" run --rm -i --network host \
58
91
  -v "$OPENCODE_HOST_BIN:/usr/local/bin/opencode:ro" \
59
92
  -e WORK_PORT="$WORK_PORT" \
@@ -64,6 +97,7 @@ OPENCODE_HOST_BIN="${OPENCODE_HOST_BIN:-/home/dog/.local/bin/opencode}"
64
97
  -e http_proxy="${HTTP_PROXY:-}" \
65
98
  -e https_proxy="${HTTPS_PROXY:-}" \
66
99
  -e NO_PROXY="127.0.0.1,localhost" \
100
+ "${MYSQL_FLAGS[@]}" \
67
101
  "$IMAGE" bash -euo pipefail <<'EOSCRIPT'
68
102
  set -euo pipefail
69
103