发版命令

yangwl
ShiChangzhou 1 year ago
parent 13dd814849
commit d18c5d85e6

@ -1,3 +1,3 @@
FROM nginx:1.20-alpine FROM 192.168.202.36:30002/library/nginx:1.20-alpine
COPY default.conf /etc/nginx/conf.d/default.conf COPY default.conf /etc/nginx/conf.d/default.conf
ADD dist /usr/share/nginx/html ADD dist /usr/share/nginx/html

@ -0,0 +1,27 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set imageURI=192.168.202.36:30002/op-lanju/op-ui
::echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
::echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
::echo 如当前小时小于10将空格替换为0
set T=%T: =0%
::echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------执行打包--------------------------------
call npm run build:prod
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
::docker pull 192.168.3.157:8001/library/nginx:1.20-alpine
Loading…
Cancel
Save