Skip to content

Instantly share code, notes, and snippets.

@nafg
Created January 17, 2019 22:01
Show Gist options
  • Save nafg/c03cee82f7916da2c5a97a0b4108e975 to your computer and use it in GitHub Desktop.
Save nafg/c03cee82f7916da2c5a97a0b4108e975 to your computer and use it in GitHub Desktop.
Run postgres, selenium with headless chrome, app, and selenium tests, in 4 panes using tmux
version: "3.2"
services:
selenium:
image: selenium/standalone-chrome
ports:
- "4444:4444"
#!/usr/bin/env fish
set -x DB_PORT 54322
set -x APP_HOST (hostname -I | cut -f1 -d' ')
set -x SELENIUM_URL 'http://localhost:4444/wd/hub'
set -x pgdir (mktemp -d)
tmux new -d "docker run --rm -p $DB_PORT:5432 -v $pgdir:/var/lib/postgresql/data -e POSTGRES_DB=XXX -e POSTGRES_USER=YYY -e POSTGRES_PASSWORD=ZZZ postgres:9.6"
while not pg_isready -h localhost -p $DB_PORT
echo Waiting for postgres...
sleep 5
end
tmux split -h "docker-compose -f docker-compose.selenium.yml up selenium"
tmux split -f -p 80 "sbt ~app/reStart"
tmux split -h "jenv shell 1.8; sbt -Dconfig.file=app_common/src/main/resources/reference.conf 'project selenium_tests' ~test"
tmux attach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment