bat换jdk

highway
zhaoxiaolin 1 year ago
parent 59a3fcd4ed
commit 2aa1ad4f2e

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -0,0 +1,41 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set jarName=op-modules-job.jar
set profile=dev
set imageURI=192.168.202.36:30002/op-lanju/op-job
rem echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
rem echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
rem echo 如当前小时小于10将空格替换为0
set T=%T: =0%
rem echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo jar包名称:%jarName%
echo 启动环境:%profile%
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------mvn package...--------------------------------
::call mvn clean package -Dmaven.test.skip=true
cd .\target
SET df=Dockerfile
if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------创建Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile
dir
echo --------------------------------docker login...-------------------------------
docker login 192.168.202.36:30002 -u deploy -p Deploy@2023
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile

@ -448,8 +448,14 @@ public class ProOrderServiceImpl implements IProOrderService {
public String syncImportFunc(List<ProOrder> newOrders){
String failOrder = "";
for (ProOrder proOrder:newOrders) {
proOrder.setProdType("white");//只有白坯有导入
failOrder += syncFunc(proOrder)+",";
//prodType->@Excel(name = "产品类型", readConverterExp = "white=白坯,prod=成品")
proOrder.setCreateBy(SecurityUtils.getUsername());
proOrder.setSyncUser("import");
proOrder.setPlanFactoryCode(proOrder.getFactoryCode());
String msg = syncFunc(proOrder);
if(StringUtils.isNotBlank(msg)){
failOrder += msg+",";
}
}
return failOrder;
}
@ -987,7 +993,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 循环遍历校验数据是否为空
for (ProOrder proOrder : orderList) {
// 计划工厂
if (proOrder.getPlanFactoryCode().isEmpty() || proOrder.getPlanFactoryCode() == null) {
if (proOrder.getFactoryCode().isEmpty() || proOrder.getFactoryCode() == null) {
return error(500, "计划工厂信息不能为空!信息导入失败!");
}
// 订单号
@ -1026,6 +1032,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if (proOrder.getPlanComplete() == null || StringUtils.isNull(proOrder.getPlanComplete())) {
return error(500, "计划完成日期不能为空!信息导入失败!");
}
}
return success();
}

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile

@ -0,0 +1,41 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set jarName=op-modules-system.jar
set profile=dev
set imageURI=192.168.202.36:30002/op-lanju/op-system
rem echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
rem echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
rem echo 如当前小时小于10将空格替换为0
set T=%T: =0%
rem echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo jar包名称:%jarName%
echo 启动环境:%profile%
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------mvn package...--------------------------------
::call mvn clean package -Dmaven.test.skip=true
cd .\target
SET df=Dockerfile
if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------创建Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile
dir
echo --------------------------------docker login...-------------------------------
docker login 192.168.202.36:30002 -u deploy -p Deploy@2023
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

Loading…
Cancel
Save