jar-quick-delivery.bat 933 B

1234567891011121314
  1. :: 先打包
  2. :: del /S /Q target\*
  3. :: mvn clean package -U -DskipTests --color auto
  4. :: RUN mvn clean package -U -DskipTests --color auto -f pom.jar.xml
  5. :: RUN mvn clean package -U -DskipTests -X -e --color auto -f pom.jar.xml
  6. :: 使用 ssh 复制本地 jar 包到远程服务器,并在远程服务器中打包镜像和发布。
  7. :: 在 %UserProfile%\.ssh\config 文件中配置 ssh 请求(ssh 要用完整的文件路径进行引用)
  8. C:\Windows\System32\OpenSSH\ssh.exe srv100 "cd /root/compose-files/park/business-webapi && rm -f target/*" || echo "删除已存在 jar 文件失败!"
  9. C:\Windows\System32\OpenSSH\scp.exe target\business-webapi-1.0.0.jar srv100:/root/compose-files/park/business-webapi/target/ || echo "复制 jar 文件到远程服务器失败!"
  10. C:\Windows\System32\OpenSSH\ssh.exe srv100 "cd /root/compose-files/park/business-webapi && ./jar-deploy.sh" || echo "发布到服务容器失败!"
  11. ::
  12. ::
  13. ::