Created
November 14, 2016 15:49
-
-
Save mackensen/c0b53d55667f8975d59fbb7ccaa2c2c3 to your computer and use it in GitHub Desktop.
Mocked up gitlab config for running selenium in a linked container
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
# Custom docker image which exposes 8080 | |
image: lafayette/hoth:5.5 | |
services: | |
- selenium/standalone-chrome:latest | |
before_script: | |
# Use 0.0.0.0 instead of localhost to allow external connections | |
- php -S 0.0.0.0:8080 -t ../ &> /dev/null & | |
job1: | |
script: | |
# Detect the IP and tell behat about it | |
- export BEHAT_IP=`ip addr show eth0 | grep -Po 'inet \K[\d.]+'` | |
- sed -i -e "s/localhost/$BEHAT_IP/" behat.yml | |
- vendor/bin/behat --format progress |
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
default: | |
autoload: | |
- %paths.base%/features/bootstrap | |
suites: | |
default: | |
contexts: | |
- YourContextHere | |
extensions: | |
Behat\MinkExtension: | |
base_url: 'http://localhost:8080' | |
browser_name: 'chrome' | |
sessions: | |
default: | |
selenium2: | |
wd_host: 'http://selenium__standalone-chrome:4444/wd/hub' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another thank you! This was VERY tricky to figure out! GitLab's magic networking is definitely making things more difficult here. Two additional things I needed to get this working:
ip addr show eth0 | grep -Po 'inet \K[\d.]+'
I usedhostname -I | awk '{print $1}'
becauseiproute2
is not installed on default PHP images.Resulting in the following additions to the script section: