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
#!/bin/bash | |
# Following the guide found at this page | |
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html | |
echo "\r\nUpdating system ...\r\n" | |
sudo apt-get update | |
# Create folder to place selenium in |
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
docker_env = os.environ.get('DOCKER_ENV') # grab the docker env that the tests will run in docker [local] | |
stg_env = os.environ.get('STG_ENV') | |
root_vagrant_local = "http://localhost:9180/" | |
# Notice: Docker | |
# Whatever LIVE is, if the env is docker + local run to vagrant URL | |
if environment == "docker" and docker_env == "local" : | |
root = root_vagrant_local | |
# Run Docker Grid on deadpool |
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
environment: | |
# only one of the two must be active | |
# - DOCKER_ENV=local # will hit vagrant box at http://localhost:9180/ | |
- STG_ENV=deadpool # [deadpool, ironman etc] |
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
docker-machine create \ | |
--driver amazonec2 \ | |
--amazonec2-access-key blablabla | |
--amazonec2-secret-key blublublu \ | |
--amazonec2-vpc-id vpc-theid \ | |
--amazonec2-zone d \ | |
--amazonec2-subnet-id subnet-theid \ | |
--amazonec2-instance-type m3.medium \ | |
awsgrid |
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
elif environment == "docker": | |
# Docker Hub setup: hub_ip="http://172.17.0.3", hub_port=4444 | |
def setUp(self, hub_ip="http://172.17.0.3", hub_port=4444): | |
print "--Fixtures_docker in config.py trying to run on--: %s:%s"%(hub_ip, hub_port) | |
if platform.system() == 'Linux': | |
from pyvirtualdisplay import Display | |
self.display = Display(visible=0, size=(1024, 768)) | |
self.display.start() |
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
sudo apt-add-repository ppa:brightbox/ruby-ng && \ | |
sudo apt-get update -y && \ | |
sudo apt-get -y install ruby2.0 ruby-switch && \ | |
sudo ruby-switch --set ruby2.0 && \ | |
sudo apt-get install gem -y && \ | |
sudo install libgemplugin-ruby&& \ | |
sudo gem install json scout_realtime |
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
# Notice: to run it, create a cronjob with the line below | |
# */1 * * * * root sh /path/to/file/kill_stuck_firefox.sh | |
#!/bin/bash | |
# This script will kill process which running more than 10 minutes | |
# egrep: the selected process; grep: hours | |
PIDS="`ps eaxo etime,pid,comm | egrep "firefox" | grep " [1-5][0-9]:" | awk '{print $2}'`" | |
# Kill the process | |
echo "Killing firefox processes running more than 10 minutes..." |
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
IDS=$(docker ps -q) | |
for ID in $IDS | |
do | |
echo $(docker inspect --format='{{.Name}}' $ID) " --> "$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ID) | |
done |
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
# start the vm | |
subprocess.call(["C:\Program Files\Oracle\VirtualBox\VBoxManage.exe", "startvm", "Win7-IE8"]) | |
time.sleep(50) | |
# stop a vm | |
# -set inside the VM from the 'control panel->power options' the os to shutdown when the power button is pressed- | |
subprocess.call(["C:\Program Files\Oracle\VirtualBox\VBoxManage.exe", | |
"controlvm", | |
"WIN7IE8", | |
"acpipowerbutton"]) |
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
class Fixtures_docker(unittest.TestCase): | |
def setUp(self, hub_ip="http://HUB_TP", hub_port=4444): | |
print "--Fixtures_docker in config.py trying to run on--: %s:%s"%(hub_ip, hub_port) | |
if platform.system() == 'Linux': | |
from pyvirtualdisplay import Display | |
self.display = Display(visible=0, size=(1024, 768)) | |
self.display.start() |