Commit 40f4cd38 authored by jinkaiqiang's avatar jinkaiqiang

脚本修改,支持java maven缓存

parent 4a4bbe39
...@@ -54,6 +54,18 @@ if [ -z "$cmd" ]; then ...@@ -54,6 +54,18 @@ if [ -z "$cmd" ]; then
elif [ "$cmd" == "build" ]; then elif [ "$cmd" == "build" ]; then
echo "build..." echo "build..."
build_docker_image build_docker_image
elif [ "$cmd" == "build_java" ]; then
echo "build java..."
# 利用maven镜像打包程序
echo "清理compile目录"
rm -rf /compile/* && rm -rf /compile/.*
echo "复制文件到打包目录/compile"
cp -rf . /compile
echo "开始打包"
docker run -i --rm --name maven_build -v /compile:/usr/src/app -v /huansi/maven/repository:/usr/share/maven/ref -w /usr/src/app 47.110.145.204:8084/huansi/maven:3-jdk-$JDK_VERSION mvn clean package || exit 1
echo "复制打包文件到当前目录下"
cp -rf /compile/target .
build_docker_image
elif [ "$cmd" == "push" ]; then elif [ "$cmd" == "push" ]; then
echo "push..." echo "push..."
foramt_image_version foramt_image_version
...@@ -66,4 +78,4 @@ elif [ "$cmd" == "push_ali" ]; then ...@@ -66,4 +78,4 @@ elif [ "$cmd" == "push_ali" ]; then
else else
echo "无效命令:$cmd" echo "无效命令:$cmd"
exit 1 exit 1
fi fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment