21 lines
711 B
Bash
21 lines
711 B
Bash
#!/bin/bash
|
|
|
|
# 检查是否提供了版本号
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <version> [xjar_password]"
|
|
echo "Example: $0 1.0.0 mysecretpassword"
|
|
exit 1
|
|
fi
|
|
|
|
VERSION=$1
|
|
XJAR_PASSWORD=${2:-io.xjar} # 使用第二个参数,如果未提供则默认为 "io.xjar"
|
|
|
|
# 使用 Maven 编译和打包项目
|
|
./mvnw -T 4C -U compile package -Pprod -DskipTests -s ./.coding/settings.xml -Dxjar.password=$XJAR_PASSWORD
|
|
|
|
# 构建 Docker 镜像
|
|
docker build -t registry.cn-hangzhou.aliyuncs.com/m809745357/erp-turbo:$VERSION -f docker/Dockerfile --build-arg ACTIVE=dev --build-arg MODULE=erp-turbo-svc .
|
|
|
|
# 推送 Docker 镜像到仓库
|
|
docker push registry.cn-hangzhou.aliyuncs.com/m809745357/erp-turbo:$VERSION
|