geekai/build/build.sh

29 lines
845 B
Bash
Raw Normal View History

#!/bin/bash
version=$1
2023-12-07 15:44:20 +08:00
arch=${2:-amd64}
# build go api program
2023-07-16 09:55:00 +08:00
cd ../api
2023-12-07 15:44:20 +08:00
make clean $arch
# build web app
2023-07-16 09:55:00 +08:00
cd ../web
npm run build
2023-11-27 18:24:52 +08:00
cd ../build
# remove docker image if exists
2024-05-01 07:59:20 +08:00
docker rmi -f registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-api:$version-$arch
# build docker image for Geek-AI API
docker build -t registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-api:$version-$arch -f dockerfile-api-go ../
2024-05-01 07:59:20 +08:00
# build docker image for Geek-AI-web
docker rmi -f registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-web:$version-$arch
docker build -t registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-web:$version-$arch -f dockerfile-vue ../
2023-12-07 15:44:20 +08:00
if [ "$3" = "push" ];then
2024-05-01 07:59:20 +08:00
docker push registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-api:$version-$arch
docker push registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-web:$version-$arch
2023-11-27 18:24:52 +08:00
fi