jenkinsci/jclouds-plugin — pull request #71 by jackzelenkin (2014-07-30 15:47:51+00:00)
Title: Add possibility to start pre-configured auto-login Windows slaves in "hybrid ssh-jnlp mode"

These changes add possibility to start pre-configured auto-login Windows slaves in "hybrid ssh-jnlp mode", which in its turn allows to use this Windows slaves for testing of GUI applications (everything will be started in the same session and visible if the need will arise).

By "hybrid ssh-jnlp mode" following is meant:
- slave.jar and agent-launcher.bat are copied to Windows slave over ssh.
- special autostart script triggers agent-launcher.bat as soon as it appears and launches slave.jar in jnlp mode.

To be preconfigured Windows image/snapshot needs:
- auto-login turned on.
- cygwin installer + ssh configured and started.
- /cygdrive/c/start folder created.
- special autostart script of roughly following content:
```dos
"hybrid SSH-JNLP mode"set WAIT_TIMEOUT=180
set /a "COUNTER=0"

:WHILE_FILE_NOT_EXISTS
if not exist "C:\start\agent-launcher.bat" (
REM If you are here, then file is missing.
if %COUNTER% gtr %WAIT_TIMEOUT% (
echo "agent-launcher.bat file didn't appear withing %WAIT_TIMEOUT% seconds."
exit /B 1
)
REM Sleep for 5 seconds
echo "%COUNTER% seconds had passed, but launcher script wasn't copied yet. Will check in 5 seconods..."
timeout /t 5 /nobreak > NUL
set /a "COUNTER+=5" REM Для более старых версий Windows (<= Windows Vista), необходимо использовать не timeout а костыль с пингом: ping -n 5 127.0.0.1 > NUL
goto :WHILE_FILE_NOT_EXISTS
)

echo "Launcher script finally appeared, launching it..."
cd "C:\start"
start agent-launcher.bat
```