Last active
February 16, 2016 14:51
-
-
Save Komosa/1c56d89fc8e8bb7d0b52 to your computer and use it in GitHub Desktop.
"Remote" execution of commands on windows with ssh-over-cygwin access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:loop | |
if exist remote.done ( | |
timeout 2 | |
goto loop | |
) | |
call remote.recipe.bat | |
goto loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THIS FILE SHOULD EXIST ON CLEAN CHECKOUT | |
Prevent windows script from start without supervisor | |
After clean checkout when `remote.done' file is not present | |
and windows script will be started first (as is supposed to be) | |
then gradle will be run without control. | |
Creting such file will prevent this behaviour. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call gradlew.bat :make 1>remote.out 2>remote.err | |
if errorlevel 1 ( | |
echo Failure > remote.done | |
) else ( | |
echo Success > remote.done | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm remote.{err,out,done} 2>/dev/null | |
tail -F -n100 remote.out & | |
tailpid=$! | |
while [ ! -f remote.done ] | |
do | |
sleep 1 | |
done | |
kill $tailpid | |
echo "Done, status:" | |
cat remote.done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment