From 9814a93c0ab38266d7818fd6bbaed0af3d97fc9d Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Mon, 30 Dec 2024 16:58:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90cicd=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 20 ++++++++++---------- build.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 10 deletions(-) create mode 100755 build.sh diff --git a/babel.config.js b/babel.config.js index 1e1495d..4b4cf3e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,10 +1,10 @@ -module.exports = { - presets: ['@vue/babel-preset-jsx'], - plugins: [ - [ - 'component', - { libraryName: 'element-ui', styleLibraryName: 'theme-chalk' } - ], - '@babel/plugin-proposal-optional-chaining' - ] -} +module.exports = { + presets: ['@vue/babel-preset-jsx'], + plugins: [ + [ + 'component', + { libraryName: 'element-ui', styleLibraryName: 'theme-chalk' } + ], + '@babel/plugin-proposal-optional-chaining' + ] +} diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..adcd196 --- /dev/null +++ b/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Usage: +# sh build.sh RELEASE_SERVER ARCH + +# 发布服务器地址,eg,172.30.40.249 +RELEASE_SERVER=$1 +# amd64 +ARCH=$2 +# 80 +OS_VERSION=$3 +# 1.0.3 +VERSION=$4 + +# 发布文件夹: /var/www/html/mpms/UI/amd64/80/ +RELEASE_DIR=/var/www/html/mpms/UI/$ARCH/$OS_VERSION +RELEASE_SERVER_PWD=root + +SSH_OPTIONS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + + +echo "链接依赖目录到项目: /home/rocky/node_modules -> $(pwd)/node_modules" +ln -sf /home/rocky/node_modules $(pwd)/node_modules +echo "开始打包" +npm run electron:deb +sshpass -p $RELEASE_SERVER_PWD ssh $SSH_OPTIONS root@$RELEASE_SERVER "rm -rf $RELEASE_DIR/*.deb" +sshpass -p $RELEASE_SERVER_PWD scp $SSH_OPTIONS dist_electron/mini*.deb root@$RELEASE_SERVER:$RELEASE_DIR/ \ No newline at end of file -- Gitee