feat: 编译和上传脚本

This commit is contained in:
caiyuchao
2025-08-18 18:44:12 +08:00
parent 35b5f1afac
commit 04881a7f67
4 changed files with 49 additions and 4 deletions

3
build-backend.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker exec build-image-dev-env-1 /workspace/projects/agt-build/build.sh backend

3
build-frontend.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker exec build-image-dev-env-1 /workspace/projects/agt-build/build.sh frontend

View File

@@ -1,5 +1,6 @@
#!/bin/sh
base_dir=/workspace/projects
[ -z "$2"] && branch='main' || branch=$2
# 使用说明,用来提示输入参数
@@ -9,18 +10,18 @@ usage() {
}
backend(){
cd ../agt-cloud
cd ${base_dir}/agt-cloud
git pull
mvn clean package -Dmaven.test.skip=true
cd ../agt-build
cd ${base_dir}/agt-build
}
# 启动程序模块(必须)
frontend(){
cd ../agt-web
cd ${base_dir}/agt-web
git pull
pnpm build:antd
cd ../agt-build
cd ${base_dir}/agt-build
}

38
cpto50.sh Normal file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
latest_jar_file=./projects/agt-cloud/agt-server/target/agt-server.jar
latest_dist_file=./projects/agt-web/apps/web-antd/dist.zip
server_ip_50=192.168.9.50
debs_rel_dir=/opt/agt/
passwd=admin123
if [ -n "${latest_jar_file}" ]; then
expect <<EOF
set timeout -1
spawn rsync -avz ${latest_jar_file} manager@${server_ip_50}:${debs_rel_dir}
expect {
"yes/no" {
send "yes\n"
exp_continue
}
"password:" { send "$passwd\n" }
}
expect eof
EOF
fi
if [ -n "${latest_dist_file}" ]; then
expect <<EOF
set timeout -1
spawn rsync -avz ${latest_dist_file} manager@${server_ip_50}:${debs_rel_dir}
expect {
"yes/no" {
send "yes\n"
exp_continue
}
"password:" { send "$passwd\n" }
}
expect eof
EOF
fi