Полный продакшн-фикс: parity с old bash, drift-recovery, status/runtime и builder separation
This commit is contained in:
+20
-7
@@ -10,10 +10,12 @@ RUST_TOOLCHAIN_VERSION="1.95.0"
|
||||
PREPARE_BUILD_ENV=false
|
||||
PREPARE_RUNTIME_ENV=false
|
||||
BOOTSTRAP_RUST=false
|
||||
DO_BUILD=false
|
||||
INSTALL=false
|
||||
ENABLE=false
|
||||
YES=false
|
||||
SKIP_FMT=false
|
||||
HAS_ACTION=false
|
||||
|
||||
RUN_AS_ROOT=()
|
||||
|
||||
@@ -43,6 +45,7 @@ Usage:
|
||||
./tools/build.sh --prepare-build-env --yes
|
||||
./tools/build.sh --prepare-runtime-env --yes
|
||||
./tools/build.sh --bootstrap-rust --yes
|
||||
./tools/build.sh --build
|
||||
./tools/build.sh --install
|
||||
./tools/build.sh --enable
|
||||
|
||||
@@ -50,6 +53,7 @@ Flags:
|
||||
--prepare-build-env Install missing build dependencies via apt
|
||||
--prepare-runtime-env Install missing runtime dependencies via apt
|
||||
--bootstrap-rust Install rustup/toolchain pinned by this repo
|
||||
--build Run build gate (default when no action flags)
|
||||
--install Install binary and systemd unit (no enable/start)
|
||||
--enable Enable and start awg2-harness.service
|
||||
--yes Confirm system mutations (apt/rustup)
|
||||
@@ -60,11 +64,12 @@ EOF
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--prepare-build-env) PREPARE_BUILD_ENV=true ;;
|
||||
--prepare-runtime-env) PREPARE_RUNTIME_ENV=true ;;
|
||||
--bootstrap-rust) BOOTSTRAP_RUST=true ;;
|
||||
--install) INSTALL=true ;;
|
||||
--enable) ENABLE=true ;;
|
||||
--prepare-build-env) PREPARE_BUILD_ENV=true; HAS_ACTION=true ;;
|
||||
--prepare-runtime-env) PREPARE_RUNTIME_ENV=true; HAS_ACTION=true ;;
|
||||
--bootstrap-rust) BOOTSTRAP_RUST=true; HAS_ACTION=true ;;
|
||||
--build) DO_BUILD=true; HAS_ACTION=true ;;
|
||||
--install) INSTALL=true; HAS_ACTION=true ;;
|
||||
--enable) ENABLE=true; HAS_ACTION=true ;;
|
||||
--yes) YES=true ;;
|
||||
--skip-fmt) SKIP_FMT=true ;;
|
||||
--help|-h) usage; exit 0 ;;
|
||||
@@ -72,6 +77,10 @@ for arg in "$@"; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$HAS_ACTION" == false ]]; then
|
||||
DO_BUILD=true
|
||||
fi
|
||||
|
||||
require_cmd() {
|
||||
command -v "$1" >/dev/null 2>&1 || {
|
||||
echo "Missing command: $1"
|
||||
@@ -239,7 +248,9 @@ if [[ "$BOOTSTRAP_RUST" == true ]]; then
|
||||
bootstrap_rust
|
||||
fi
|
||||
|
||||
prepare_build_gate
|
||||
if [[ "$DO_BUILD" == true ]]; then
|
||||
prepare_build_gate
|
||||
fi
|
||||
|
||||
if [[ "$INSTALL" == true ]]; then
|
||||
install_artifacts
|
||||
@@ -249,4 +260,6 @@ if [[ "$ENABLE" == true ]]; then
|
||||
enable_service
|
||||
fi
|
||||
|
||||
echo "Build completed: $TARGET_BIN"
|
||||
if [[ "$DO_BUILD" == true ]]; then
|
||||
echo "Build completed: $TARGET_BIN"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user