You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.5 KiB
80 lines
2.5 KiB
#!/bin/bash
|
|
|
|
#
|
|
# wget_and_unzip 解压后的文件名 url
|
|
#
|
|
function wget_and_unzip() {
|
|
# 下载压缩包,解压,并删除压缩包
|
|
# cd $PACKET_DIR/
|
|
mkdir -p $PROJECT_PATH/.cache
|
|
cd $PROJECT_PATH/.cache
|
|
# ftp://zftpuser:zftpzwsd@192.168.1.2/zwsd/manufacturer_mycroft/hotworld/xiaomaoxiaomao/xiaomaoxiaomao_module_20220519.tar.gz
|
|
wget -c $2
|
|
tar -xvf $(basename $2)
|
|
mv $PROJECT_PATH/.cache/$1 $PACKET_DIR/
|
|
}
|
|
|
|
function wget_and_cpy() {
|
|
# 下载压缩包,解压,并删除压缩包
|
|
# cd $PACKET_DIR/
|
|
mkdir -p $PROJECT_PATH/.cache
|
|
cd $PROJECT_PATH/.cache
|
|
wget -c $1
|
|
cp $PROJECT_PATH/.cache/$(basename $1) $PACKET_DIR/
|
|
}
|
|
|
|
set -e
|
|
set -x
|
|
export PROJECT_PATH=$(pwd)
|
|
source ${PROJECT_PATH}/build/buildenv
|
|
|
|
#打包目录
|
|
PACKET_DIR=$PROJECT_PATH/out/app
|
|
|
|
# 删除打包目录,重新打包
|
|
rm -rf ${PACKET_DIR}
|
|
mkdir ${PACKET_DIR}
|
|
########################################################################################
|
|
################################根据需要修改下面的内容即可##################################
|
|
########################################################################################
|
|
|
|
#1. 编译
|
|
cd $PROJECT_PATH/build
|
|
# ./build.sh && make -j8 && make install
|
|
|
|
#2.打包APP
|
|
cp $PROJECT_PATH/build/app/*.out $PACKET_DIR/
|
|
|
|
#3.3 打包webapp
|
|
cp -rf $PROJECT_PATH/webapp $PACKET_DIR/
|
|
|
|
#4 拷贝配置文件
|
|
cd $PROJECT_PATH/env/ && cp --path -rf ./* $PACKET_DIR/
|
|
|
|
####################################################################
|
|
########################打包自定义的东西##############################
|
|
####################################################################
|
|
# 下载唤醒词模型
|
|
wget_and_unzip xiaomaoxiaomao ftp://zftpuser:zftpzwsd@192.168.1.2/zwsd/manufacturer_mycroft/hotworld/xiaomaoxiaomao/xiaomaoxiaomao_module_20220519.tar.gz
|
|
# 下载唤醒词引擎
|
|
if [ "$BUILDFOR" == "rk3328" ]; then
|
|
wget_and_unzip precise 192.168.1.2:8021/manufacturer_mycroft/mycroft-precise-release/precise-all_0.3.0_aarch64.tar.gz
|
|
fi
|
|
# 下载唤醒词语音
|
|
wget_and_cpy 192.168.1.2:8021/manufacturer_mycroft/hotworld/xiaomaoxiaomao/test_xiaomaoxiaomao.wav
|
|
|
|
|
|
|
|
|
|
####################################################################
|
|
####################################################################
|
|
|
|
#5 打包
|
|
cur_date="$(date +%Y%m%d)"
|
|
|
|
cd $PACKET_DIR/../
|
|
tar -czvf ${PACKET_DIR}_${cur_date}.tar.gz app
|
|
cp ${PACKET_DIR}_${cur_date}.tar.gz ${PACKET_DIR}.tar.gz
|
|
echo "Brief:"
|
|
echo "generate ${PACKET_DIR}_${cur_date}.tar.gz..................."
|
|
echo "generate ${PACKET_DIR}.tar.gz..................."
|