Skip to content

Instantly share code, notes, and snippets.

@shs96c
Last active January 24, 2019 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shs96c/0dd44559a2d0e7015bb7ec01a3926405 to your computer and use it in GitHub Desktop.
Save shs96c/0dd44559a2d0e7015bb7ec01a3926405 to your computer and use it in GitHub Desktop.
Build and start Grid TNG
#!/bin/bash
SE_JAR=buck-out/gen/java/server/src/org/openqa/selenium/grid/selenium.jar
SESSIONS=$(tput setaf 1)
DISTRIBUTOR=$(tput setaf 2)
ROUTER=$(tput setaf 3)
PLAIN=$(tput sgr0)
ps auxw | grep selenium.jar | grep -v grep | awk '{print $2}' | xargs kill
./buckw build grid-tng || exit
(java -jar $SE_JAR sessions 2>&1 | sed "s/.*/sessions - $SESSIONS&$PLAIN/") &
sleep 1
(java -jar $SE_JAR distributor 2>&1 | sed "s/.*/distributor - $DISTRIBUTOR&$PLAIN/") &
sleep 1
(java -jar $SE_JAR router --sessions http://localhost:5556 --distributor http://localhost:5553 2>&1 | sed "s/.*/router - $ROUTER&$PLAIN/") &
sleep 1
(java -jar $SE_JAR node --sessions http://localhost:5556 --distributor http://localhost:5553 --detect-drivers 2>&1 | sed "s/.*/node - &/") &
sleep 4
echo Ready
@shs96c
Copy link
Author

shs96c commented Jan 24, 2019

Output from the session map will be red, distributor will be green, router a hideous brown, and the node will be the default colour of your terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment