2023-06-23 07:08:16 +08:00
|
|
|
#!/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
|
2023-06-23 07:08:16 +08:00
|
|
|
|
|
|
|
# build web app
|
2023-07-16 09:55:00 +08:00
|
|
|
cd ../web
|
2023-06-23 07:08:16 +08:00
|
|
|
npm run build
|
|
|
|
|
2023-11-27 18:24:52 +08:00
|
|
|
cd ../build
|
2023-06-23 07:08:16 +08:00
|
|
|
|
|
|
|
# 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 ../
|
2023-06-23 07:08:16 +08:00
|
|
|
|
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-06-23 07:08:16 +08:00
|
|
|
|
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
|