forked from giorgiosironi/phpunit-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up before_script.sh so that it was possible to reuse it for V…
…agrant
- Loading branch information
Showing
13 changed files
with
114 additions
and
54 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BEFORE_SCRIPT_DIR=$(dirname $0) | ||
|
||
source $BEFORE_SCRIPT_DIR/common_env.sh | ||
source $BEFORE_SCRIPT_DIR/travis_env.sh | ||
|
||
source $BEFORE_SCRIPT_DIR/setup.sh | ||
|
||
source $BEFORE_SCRIPT_DIR/start.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
SELENIUM_HUB_URL='http://127.0.0.1:4444' | ||
SELENIUM_JAR=/usr/share/selenium/selenium-server-standalone.jar | ||
SELENIUM_DOWNLOAD_URL=http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.1.jar | ||
PHP_VERSION=$(php -v) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[program:selenium] | ||
command=xvfb-run java -Dwebdriver.firefox.bin=/usr/bin/firefox -jar /usr/share/selenium/selenium-server-standalone.jar | ||
autostart=false ; selenium | ||
|
||
[program:python-webserver] | ||
command=python -m SimpleHTTPServer 8080 | ||
directory=. ; python-webserver | ||
autostart=false ; python-webserver | ||
|
||
[program:php-webserver] | ||
command=php -S localhost:8080 | ||
directory=. ; php-webserver | ||
autostart=false ; php-webserver |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -f "/usr/local/bin/composer" ]; then | ||
echo "Installing Composer" | ||
php -r "readfile('https://getcomposer.org/installer');" | sudo php -d apc.enable_cli=0 -- --install-dir=/usr/local/bin --filename=composer | ||
else | ||
echo "Updating Composer" | ||
sudo /usr/local/bin/composer self-update | ||
fi | ||
|
||
if [ ! -d vendor ] || [ ! -f vendor/autoload.php ]; then | ||
echo "Installing dependencies" | ||
composer install --dev | ||
fi | ||
|
||
echo "Installing supervisord" | ||
sudo apt-get install supervisor -y --no-install-recommends | ||
sudo cp ./.ci/phpunit-environment.conf /etc/supervisor/conf.d/ | ||
sudo sed -i "s/^directory=.*webserver$/directory=${ESCAPED_BUILD_DIR}\\/selenium-1-tests/" /etc/supervisor/conf.d/phpunit-environment.conf | ||
sudo sed -i "s/^autostart=.*selenium$/autostart=true/" /etc/supervisor/conf.d/phpunit-environment.conf | ||
|
||
if $(echo "$PHP_VERSION" | grep --quiet 'PHP 5.4'); then | ||
sudo sed -i "s/^autostart=.*php-webserver$/autostart=true/" /etc/supervisor/conf.d/phpunit-environment.conf | ||
else | ||
sudo sed -i "s/^autostart=.*python-webserver$/autostart=true/" /etc/supervisor/conf.d/phpunit-environment.conf | ||
fi | ||
|
||
echo "Installing Firefox" | ||
sudo apt-get install firefox -y --no-install-recommends | ||
|
||
if [ ! -f "$SELENIUM_JAR" ]; then | ||
echo "Downloading Selenium" | ||
sudo mkdir -p $(dirname "$SELENIUM_JAR") | ||
sudo wget -nv -O "$SELENIUM_JAR" "$SELENIUM_DOWNLOAD_URL" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
sudo supervisorctl reload | ||
|
||
wget --retry-connrefused --tries=60 --waitretry=1 --output-file=/dev/null "$SELENIUM_HUB_URL/wd/hub/status" -O /dev/null | ||
if [ ! $? -eq 0 ]; then | ||
echo "Selenium Server not started" | ||
else | ||
echo "Finished setup" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
ESCAPED_BUILD_DIR=$(echo "$TRAVIS_BUILD_DIR" | sed 's/\//\\\//g') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
ESCAPED_BUILD_DIR="\/vagrant" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
sed -i "/mirror:\\/\\//d" /etc/apt/sources.list | ||
sed -i "1ideb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse" /etc/apt/sources.list | ||
sed -i "1ideb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse" /etc/apt/sources.list | ||
sed -i "1ideb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse" /etc/apt/sources.list | ||
sed -i "1ideb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse" /etc/apt/sources.list | ||
|
||
apt-get update | ||
|
||
# installing xvfb, java and php | ||
apt-get install xvfb openjdk-7-jre-headless php5-cli php5-curl php5-xdebug -y --no-install-recommends |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ firefox/ | |
/.project | ||
/.buildpath | ||
/.settings | ||
/.vagrant/ |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
$setupEnvironment = <<-SCRIPT | ||
cd /vagrant | ||
source ./.ci/vagrant_pre_setup.sh | ||
source ./.ci/common_env.sh | ||
source ./.ci/vagrant_env.sh | ||
source ./.ci/setup.sh | ||
source ./.ci/start.sh | ||
SCRIPT | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
config.vm.box = "hashicorp/precise32" | ||
|
||
config.vm.provision "shell", inline: $setupEnvironment | ||
end |
This file was deleted.
Oops, something went wrong.