SPS
SPS

Reputation: 1

Ant automation from windows machine to linux

I am running ant script on my Windows machine. From Windows I login in to a Linux server and run few basic commands.

Is there a way to make this automated using ant script or any scripting methods?

Upvotes: 0

Views: 61

Answers (1)

Oron Golan
Oron Golan

Reputation: 371

Yes.

In the example below i install application that the installer is Multiplatform and created on Windows machine and i run the commands on Linux machine (after copied to the linux machine) .

I suggest that you will use plink.exe, pscp.exe.

echo 'Coping installation files' %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 '* Running Installation ' %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

Upvotes: 1

Related Questions