echo "镜像制作..."

##版本号，根据产品定义的大版本号修改
version=1.2


time=$(date "+%d%H%M%S")

echo "开始制作镜像 ydl-admin:$version.$time"

docker rmi --force `docker images | grep ydl-admin | awk '{print $3}'`

mvn clean package install -Dmaven.test.skip=true

cd ydl-admin/
docker build --platform linux/amd64 -t ydl-admin:1.0-SNAPSHOT .

docker tag ydl-admin:1.0-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/ydl-yiliao/ydl-admin:$version.$time
docker push registry.cn-hangzhou.aliyuncs.com/ydl-yiliao/ydl-admin:$version.$time

echo "镜像制作结束 ydl-admin:$version.$time"