Skip to content

Instantly share code, notes, and snippets.

@garbas
Forked from jone/get_free_port.py
Last active December 12, 2015 08:09
Show Gist options
  • Save garbas/4742213 to your computer and use it in GitHub Desktop.
Save garbas/4742213 to your computer and use it in GitHub Desktop.
export REMOTE_URL="http://XXXX:[email protected]:80/wd/hub"
export ZSERVER_HOST="0.0.0.0"
DESIRED_CAPABILITIES=$(cat <<EOF | python -
import os
SELENIUM_DRIVER = os.environ.get('SELENIUM_DRIVER')
DESIRED_CAPABILITIES = ''
for item in SELENIUM_DRIVER.split('?', 1)[1].split('&')
DESIRED_CAPABILITIES += ','
item = item.replace('=', ':')
item = item.replace('os:', 'platform:')
item = item.replace('browser-version:', 'version:')
DESIRED_CAPABILITIES = DESIRED_CAPABILITIES[1:]
JOB_NAME = os.environ.get('JOB_NAME').replace('jenkins-', '').replace('/SELENIUM_DRIVER=', ' | ')
BULD_NUMBER = os.environ.get('BUILD_NUMBER')
DESIRED_CAPABILITIES += ',name:' + JOB_NAME + ' | #' + BULD_NUMBER
print DESIRED_CAPABILITIES
EOF)
export DESIRED_CAPABILITIES
BROWSER=$(echo $SELENIUM_DRIVER | perl -pe 's|.*browser=(.*?)&.*|\1|')
export BROWSER
$PYTHON27 bootstrap.py
bin/buildout
bin/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment