From f163ae829b716f67d26d0799298086b9f1d6a05c Mon Sep 17 00:00:00 2001 From: Rafael Date: Fri, 29 Nov 2024 16:13:17 +0000 Subject: [PATCH] build: remove extra archs we no longer support --- deploy/codebase/ci-build.sh | 8 -------- deploy/codebase/lamassu-machine-manager.js | 1 - deploy/remove-modules.js | 23 ---------------------- package.json | 1 - 4 files changed, 33 deletions(-) delete mode 100755 deploy/remove-modules.js diff --git a/deploy/codebase/ci-build.sh b/deploy/codebase/ci-build.sh index 82d9676aa..a30b34ec1 100644 --- a/deploy/codebase/ci-build.sh +++ b/deploy/codebase/ci-build.sh @@ -12,18 +12,11 @@ setup_board_model() { supervisor_export_dir="$EXPORT_DIR/supervisor/$board/$model" # Create necessary directories - mkdir -p "$board_export_dir/node_modules" mkdir -p "$supervisor_export_dir" # Copy supervisor configuration files for the board and model cp "$SYSTEM_DIR/$board/$model/supervisor/conf.d/"* "$supervisor_export_dir/" - # Copy node_modules for the board - cp -R "$MACHINE_DIR/node_modules" "$board_export_dir/" - - # Remove interpreted modules for the board - node "$MACHINE_DIR/deploy/remove-modules.js" "$board_export_dir/node_modules" --rem-interpreted - # Optionally copy the device config mkdir $model_export_dir cp "$CODEBASE_DIR/$board/$model/device_config.json" "$model_export_dir/" @@ -70,7 +63,6 @@ cp $MACHINE_DIR/bin/lamassu-machine $TARGET_MACHINE_DIR/bin cp $MACHINE_DIR/bin/cam.js $TARGET_MACHINE_DIR/bin cp -r $MACHINE_DIR/ui $TARGET_MACHINE_DIR $MACHINE_DIR/node_modules/.bin/copy-node-modules $MACHINE_DIR $TARGET_MACHINE_DIR -node $MACHINE_DIR/deploy/remove-modules.js $TARGET_MACHINE_DIR/node_modules --rem-native # Fonts setup mkdir -p $TARGET_MACHINE_DIR/ui/css/fonts diff --git a/deploy/codebase/lamassu-machine-manager.js b/deploy/codebase/lamassu-machine-manager.js index dccc6f350..fb1eef426 100644 --- a/deploy/codebase/lamassu-machine-manager.js +++ b/deploy/codebase/lamassu-machine-manager.js @@ -232,7 +232,6 @@ const upgrade = () => { async.apply(command, `tar zxf ${basePath}/package/subpackage.tgz -C ${basePath}/package/`), async.apply(command, `rm -rf ${applicationParentFolder}/lamassu-machine/node_modules/`), async.apply(command, `cp -PR ${basePath}/package/subpackage/lamassu-machine ${applicationParentFolder}`), - async.apply(command, `cp -PR ${basePath}/package/subpackage/hardware/${hardwareCode}/node_modules ${applicationParentFolder}/lamassu-machine/`), async.apply(command, `mv ${applicationParentFolder}/lamassu-machine/verify/verify.${arch} ${applicationParentFolder}/lamassu-machine/verify/verify`), async.apply(command, `mv ${applicationParentFolder}/lamassu-machine/camera-streamer/camera-streamer.${arch} ${applicationParentFolder}/lamassu-machine/camera-streamer/camera-streamer`), async.apply(installDeviceConfig), diff --git a/deploy/remove-modules.js b/deploy/remove-modules.js deleted file mode 100755 index 85cfecd8d..000000000 --- a/deploy/remove-modules.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs') -const path = require('path') -var rimraf = require("rimraf"); - -const base = process.argv[2] -const mode = process.argv[3] - -const isNative = m => { - const isNative = fs.existsSync(path.resolve(base, m, 'build', 'Release')) - - // TODO this is awfully manual right now. - const mappedNative = m === 'keccak' || m === '@serialport' || m === '@lamassu' - - if (mode === '--rem-native') - return isNative || mappedNative - return ! (isNative || mappedNative) -} - -fs.readdirSync(base) - .filter(isNative) - .forEach(it => rimraf.sync(path.resolve(path.join(base, it)))) diff --git a/package.json b/package.json index 1126c1be5..9d2e44ab2 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "benchmark": "2.1.4", "copy-node-modules": "1.1.1", "postcss-cli": "6.1.1", - "rimraf": "2.6.3", "sass": "^1.58.3", "standard": "12.0.1" },