feat(ops): add aliyun runtime shortcut

This commit is contained in:
binfan5 2026-03-15 13:37:10 +08:00
parent f5c029fbe8
commit bc4b0dcad1
2 changed files with 13 additions and 3 deletions

View file

@ -137,11 +137,10 @@ Recommended image tags:
- `SKILLHUB_VERSION=edge` for the latest `main` build
- `SKILLHUB_VERSION=vX.Y.Z` for a fixed release
If you maintain a closer registry mirror, start the runtime with:
Use the bundled Aliyun mirror shortcut when a nearer registry is configured:
```bash
curl -fsSL https://raw.githubusercontent.com/iflytek/skillhub/main/scripts/runtime.sh | sh -s -- up \
--mirror-registry <registry>/<namespace>
curl -fsSL https://raw.githubusercontent.com/iflytek/skillhub/main/scripts/runtime.sh | sh -s -- up --aliyun
```
Start the runtime:

View file

@ -12,6 +12,8 @@ SKILLHUB_REF="${SKILLHUB_REF:-main}"
SKILLHUB_HOME_DEFAULT="${TMPDIR:-/tmp}/skillhub-runtime"
SKILLHUB_HOME="${SKILLHUB_HOME:-$SKILLHUB_HOME_DEFAULT}"
SKILLHUB_VERSION_VALUE="${SKILLHUB_VERSION:-}"
SKILLHUB_ALIYUN_REGISTRY="${SKILLHUB_ALIYUN_REGISTRY:-crpi-ptu2rqimrigtq0qx.cn-hangzhou.personal.cr.aliyuncs.com}"
SKILLHUB_ALIYUN_NAMESPACE="${SKILLHUB_ALIYUN_NAMESPACE:-test1245}"
SKILLHUB_MIRROR_REGISTRY_VALUE="${SKILLHUB_MIRROR_REGISTRY:-}"
SKILLHUB_SERVER_IMAGE_VALUE="${SKILLHUB_SERVER_IMAGE:-}"
SKILLHUB_WEB_IMAGE_VALUE="${SKILLHUB_WEB_IMAGE:-}"
@ -25,6 +27,14 @@ while [ "$#" -gt 0 ]; do
SKILLHUB_VERSION_VALUE="$2"
shift 2
;;
--aliyun)
if [ -z "$SKILLHUB_ALIYUN_REGISTRY" ] || [ -z "$SKILLHUB_ALIYUN_NAMESPACE" ]; then
echo "SKILLHUB_ALIYUN_REGISTRY and SKILLHUB_ALIYUN_NAMESPACE must be configured for --aliyun" >&2
exit 1
fi
SKILLHUB_MIRROR_REGISTRY_VALUE="${SKILLHUB_ALIYUN_REGISTRY%/}/${SKILLHUB_ALIYUN_NAMESPACE}"
shift
;;
--mirror-registry)
[ "$#" -ge 2 ] || { echo "Missing value for --mirror-registry" >&2; exit 1; }
SKILLHUB_MIRROR_REGISTRY_VALUE="$2"
@ -66,6 +76,7 @@ Usage: sh runtime.sh [up|down|clean|ps|logs|pull] [options]
Options:
--version <tag> Use a specific image tag, for example v0.1.0
--aliyun Use the configured Aliyun mirror registry
--mirror-registry <r> Use mirrored images from <registry>/<namespace>
--home <dir> Store runtime files in a specific directory
--ref <git-ref> Download runtime files from a specific Git ref