fix(sh): build

This commit is contained in:
zhangheng
2026-03-27 20:01:31 +08:00
parent 2429e3ce74
commit 318c260ff2
2 changed files with 34 additions and 6 deletions

View File

@@ -71,23 +71,23 @@ pnpm run $BUILD_FLAG
if [[ $? != 0 ]]; then echo -e "${RED}build error${NC}"; exit 100; fi
# Docker构建和推送
MAIN_NAME=digitalspace_labelmain
MAIN_NAME=web_digitalspace_labelmain
DOCKER_FILE=$SHELL_FOLDER/Dockerfile
if [[ $OUTPUT_TYPE == export ]]; then
DOCKER_FILE=$SHELL_FOLDER/docker/nginx.dockerfile
MAIN_NAME=digitalspace_labelmain_static
MAIN_NAME=web_digitalspace_labelmain_static
elif [[ $OUTPUT_TYPE == standalone ]]; then
DOCKER_FILE=$SHELL_FOLDER/docker/node.dockerfile
MAIN_NAME=digitalspace_labelmain_ssr
MAIN_NAME=web_digitalspace_labelmain_ssr
fi
echo -e "${GREEN}Building docker image...${NC}"
sudo docker build -f $DOCKER_FILE -t $MAIN_NAME $SHELL_FOLDER
docker build -f $DOCKER_FILE -t $MAIN_NAME $SHELL_FOLDER
if [[ $? != 0 ]]; then echo -e "${RED}build docker with error${NC}"; exit 100; fi
echo -e "${GREEN}Tagging and pushing docker image...${NC}"
sudo docker tag $MAIN_NAME harbor.cowarobot.cn/gopro/$MAIN_NAME:$FLAG_PROD
# docker push harbor.cowarobot.cn/gopro/$MAIN_NAME:$FLAG_PROD
docker tag $MAIN_NAME harbor.cowarobot.cn/gopro/$MAIN_NAME:$FLAG_PROD
docker push harbor.cowarobot.cn/gopro/$MAIN_NAME:$FLAG_PROD
echo -e "${GREEN}Build completed successfully${NC}"