Перевести тестовый контур на t.shineup.me

This commit is contained in:
AidarKC
2026-06-25 13:44:22 +04:00
parent 112ab4d5d5
commit f0e1ab3af8
22 changed files with 131 additions and 58 deletions
+12
View File
@@ -26,6 +26,8 @@ export CLIENT_VERSION
TARGET_URL="${TARGET_URL:-https://${EXPECTED_CADDY_SITE}}"
REMOTE_DIR="${REMOTE_UI_DIR}"
DEPLOY_SERVER_LOGIN="${DEPLOY_SERVER_LOGIN:-}"
DEPLOY_SERVER_ADDRESS="${DEPLOY_SERVER_ADDRESS:-}"
cleanup() {
rm -rf "$TMP_DIR"
@@ -42,6 +44,16 @@ echo "==> Client version from $VERSION_FILE: $CLIENT_VERSION"
echo "==> Deploy target: $TARGET_URL ($REMOTE_DIR)"
rsync -a "$SRC_DIR"/ "$TMP_DIR"/
DEPLOY_CONFIG_FILE="$TMP_DIR/js/deploy-config.js"
if [[ -f "$DEPLOY_CONFIG_FILE" ]]; then
if [[ -n "$DEPLOY_SERVER_LOGIN" ]]; then
perl -0pi -e "s/export const defaultServerLogin = '.*?';/export const defaultServerLogin = '$DEPLOY_SERVER_LOGIN';/s" "$DEPLOY_CONFIG_FILE"
fi
if [[ -n "$DEPLOY_SERVER_ADDRESS" ]]; then
perl -0pi -e "s/export const defaultServerAddress = '.*?';/export const defaultServerAddress = '$DEPLOY_SERVER_ADDRESS';/s" "$DEPLOY_CONFIG_FILE"
fi
fi
INDEX_FILE="$TMP_DIR/index.html"
if [[ ! -f "$INDEX_FILE" ]]; then
echo "ERROR: index.html not found in staged UI: $INDEX_FILE" >&2