test build

This commit is contained in:
sijinhui 2024-05-11 17:58:11 +08:00
parent 0a52fadbe3
commit 5b2a9ad3ba

View File

@ -1,37 +1,30 @@
#!/bin/bash #!/bin/bash
set -e set -e
# 加速 ## 加速
yarn config set registry 'https://registry.npmmirror.com/' #yarn config set registry 'https://registry.npmmirror.com/'
yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp" #yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips" #yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
# 官方 ## 官方
#yarn config delete registry ##yarn config delete registry
#yarn config delete sharp_binary_host ##yarn config delete sharp_binary_host
#yarn config delete sharp_libvips_binary_host ##yarn config delete sharp_libvips_binary_host
yarn cache clean
yarn install
#if command -v cnpm &> /dev/null
#then
# echo "cnpm 已安装"
#else
# npm i cnpm
#fi
# #
#cnpm i #yarn cache clean
yarn run build #yarn install
#
mkdir -p "./node_modules/tiktoken" #yarn run build
export OUT_DIR="out" #
#mkdir -p "./node_modules/tiktoken"
mkdir -p ${OUT_DIR} #export OUT_DIR="out"
#
rsync -az --delete ./.next/standalone/ ${OUT_DIR} #mkdir -p ${OUT_DIR}
rsync -az --delete ./public/ ${OUT_DIR}/public #
rsync -az --delete ./.next/static/ ${OUT_DIR}/.next/static #rsync -az --delete ./.next/standalone/ ${OUT_DIR}
rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server #rsync -az --delete ./public/ ${OUT_DIR}/public
rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server #rsync -az --delete ./.next/static/ ${OUT_DIR}/.next/static
rsync -az --delete "./node_modules/tiktoken/" ${OUT_DIR}/node_modules/tiktoken #rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server
#rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server
#rsync -az --delete "./node_modules/tiktoken/" ${OUT_DIR}/node_modules/tiktoken
docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns