【问题标题】:Ant automation from windows machine to linux从 windows 机器到 linux 的 Ant 自动化
【发布时间】:2019-01-07 23:09:46
【问题描述】:

我正在我的 Windows 机器上运行 ant 脚本。我从 Windows 登录到 Linux 服务器并运行一些基本命令。

有没有办法使用 ant 脚本或任何脚本方法来实现自动化?

【问题讨论】:

  • 您是否尝试过查看 Ant 的 sshexecsshsession 任务?

标签: linux windows shell docker ant


【解决方案1】:

是的。

在下面的示例中,我安装了安装程序是 Multiplatform 并在 Windows 机器上创建的应用程序,我在 Linux 机器上运行命令(复制到 linux 机器后)。

我建议你使用plink.exe、pscp.exe。

echo '处理安装文件' %Jenkins_tools%\pscp.exe -pw "%Install_path%\%installation%unix%newversion%.sh" root@%server_ip%:/opt/

%Jenkins_tools%\pscp.exe -pw "C:\Jenkins\deployment\responsefiles\%installation%\response.varfile" root@%server_ip%:/opt/

echo '* 运行安装' %Jenkins_tools%\plink.exe -ssh root@%server_ip% -P 22 -pw chmod +x /opt/%installation%

%Jenkins_tools%\plink.exe -ssh root@%server_ip% -P 22 -pw /opt/%installation%*.sh -varfile /opt/response.varfile -q

【讨论】:

    猜你喜欢
    • 2010-09-22
    • 2010-11-16
    • 2011-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-26
    • 1970-01-01
    相关资源
    最近更新 更多