Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start_background_process: Use sftp instead of scp for Windows VM
scp is used in the start_background_process() method to transfer the script file to the host before executing it. On Windows 11, OpenSSH doesn't support the scp legacy protocol which is the only one supported by scp running on AlmaLinux 8, the distro behind our Jenkins server. Since AlmaLinux 8 and all of our Windows images support sftp, this patch makes use of the sftp() function instead of the scp() one to transfer the script file for VMs running any Windows version. The destination path is also tweaked a bit and the file is sent to the Windows Temp folder of the root user instead of /tmp. Since the script is executed in the git-bash context of the root user, it will be located as expected in /tmp, which is mapped on the Windows user Temp folder. With this patch also comes a sftp_put() helper function taking source and destination files as parameters like the scp() function does. Signed-off-by: Thierry Escande <[email protected]>
- Loading branch information