fix(deploy): remove embedded install from script; pin sass-embedded linux runtime
This commit is contained in:
@@ -11,55 +11,6 @@ LOG_FILE="/var/log/bssapp_deploy.log"
|
|||||||
APP_DIR="/opt/bssapp"
|
APP_DIR="/opt/bssapp"
|
||||||
LOCK_FILE="/tmp/bssapp_deploy.lock"
|
LOCK_FILE="/tmp/bssapp_deploy.lock"
|
||||||
|
|
||||||
pick_sass_embedded_pkg() {
|
|
||||||
local arch
|
|
||||||
arch="$(uname -m)"
|
|
||||||
|
|
||||||
case "$arch" in
|
|
||||||
x86_64|amd64)
|
|
||||||
if ldd --version 2>&1 | grep -qi musl; then
|
|
||||||
echo "sass-embedded-linux-musl-x64@1.93.2"
|
|
||||||
else
|
|
||||||
echo "sass-embedded-linux-x64@1.93.2"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
aarch64|arm64)
|
|
||||||
if ldd --version 2>&1 | grep -qi musl; then
|
|
||||||
echo "sass-embedded-linux-musl-arm64@1.93.2"
|
|
||||||
else
|
|
||||||
echo "sass-embedded-linux-arm64@1.93.2"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
armv7l|armhf)
|
|
||||||
echo "sass-embedded-linux-arm@1.93.2"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo ""
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
ensure_sass_embedded() {
|
|
||||||
local platform_pkg check_output
|
|
||||||
|
|
||||||
platform_pkg="$(pick_sass_embedded_pkg)"
|
|
||||||
if [[ -z "$platform_pkg" ]]; then
|
|
||||||
echo "Unsupported CPU architecture for sass-embedded: $(uname -m)"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Installing sass-embedded packages: sass-embedded@1.93.2 + $platform_pkg"
|
|
||||||
npm i --no-save --no-audit --no-fund sass-embedded@1.93.2 "$platform_pkg"
|
|
||||||
|
|
||||||
check_output="$(./node_modules/.bin/sass --embedded --version 2>&1 || true)"
|
|
||||||
echo "$check_output"
|
|
||||||
|
|
||||||
if echo "$check_output" | grep -qi "unavailable in pure JS mode"; then
|
|
||||||
echo "sass --embedded is still unavailable."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
build_api_binary() {
|
build_api_binary() {
|
||||||
if ! command -v go >/dev/null 2>&1; then
|
if ! command -v go >/dev/null 2>&1; then
|
||||||
echo "go command not found; cannot build backend binary."
|
echo "go command not found; cannot build backend binary."
|
||||||
@@ -92,7 +43,6 @@ run_deploy() {
|
|||||||
echo "== BUILD UI =="
|
echo "== BUILD UI =="
|
||||||
cd "$APP_DIR/ui"
|
cd "$APP_DIR/ui"
|
||||||
npm ci --no-audit --no-fund --include=optional
|
npm ci --no-audit --no-fund --include=optional
|
||||||
ensure_sass_embedded
|
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
echo "== BUILD API =="
|
echo "== BUILD API =="
|
||||||
|
|||||||
Reference in New Issue
Block a user