feat: initial import (exclude templates and runtime temp files)
This commit is contained in:
16
app/scripts/bootstrap.sh
Executable file
16
app/scripts/bootstrap.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
echo "[1/3] Installing Python dependencies..."
|
||||
python3 -m pip install --user --break-system-packages -r requirements.txt
|
||||
|
||||
echo "[2/3] Pulling converter image..."
|
||||
docker pull minidocks/libreoffice
|
||||
|
||||
echo "[3/3] Verifying converter image..."
|
||||
docker image inspect minidocks/libreoffice >/dev/null
|
||||
|
||||
echo "Bootstrap complete. Converter image is ready."
|
||||
28
app/scripts/smoke_api.sh
Executable file
28
app/scripts/smoke_api.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL="${1:-https://zc.workyai.cn}"
|
||||
|
||||
require_ok() {
|
||||
local json="$1"
|
||||
if ! printf '%s' "$json" | rg -q '"ok"\s*:\s*true'; then
|
||||
printf 'Smoke failed: expected ok=true, got: %s\n' "$json" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
config_json="$(curl -fsS "$BASE_URL/api/config")"
|
||||
require_ok "$config_json"
|
||||
|
||||
issues_json="$(curl -fsS "$BASE_URL/api/issues?status=active&limit=5")"
|
||||
require_ok "$issues_json"
|
||||
|
||||
parse_json="$(curl -fsS -X POST "$BASE_URL/api/parse" \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data '{"raw_text":"#接龙\n1、营江路揽收现金10万存一年"}')"
|
||||
require_ok "$parse_json"
|
||||
|
||||
history_json="$(curl -fsS "$BASE_URL/api/history/view?limit=5")"
|
||||
require_ok "$history_json"
|
||||
|
||||
echo "Smoke passed: $BASE_URL"
|
||||
17
app/scripts/sync_vue_vendor.sh
Executable file
17
app/scripts/sync_vue_vendor.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
VUE_SRC="$ROOT_DIR/node_modules/vue/dist/vue.global.prod.js"
|
||||
VUE_DST_DIR="$ROOT_DIR/static/vendor"
|
||||
VUE_DST="$VUE_DST_DIR/vue.global.prod.js"
|
||||
|
||||
if [[ ! -f "$VUE_SRC" ]]; then
|
||||
echo "vue.global.prod.js not found. Run: npm install" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$VUE_DST_DIR"
|
||||
cp "$VUE_SRC" "$VUE_DST"
|
||||
|
||||
echo "Synced Vue vendor: $VUE_DST"
|
||||
Reference in New Issue
Block a user