Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/candy-chat/candy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Langfeld <ben@langfeld.me>2015-08-31 21:36:30 +0300
committerBen Langfeld <ben@langfeld.me>2015-09-03 23:49:55 +0300
commit4c9ae9c4604b009b6e8e0493ae0bd682a7f709d2 (patch)
treec0b9c3352ec8712c15629db89208ffebcccd2a16
parent53c8d31ad2e0e86439e3f4fdac933a892b90def7 (diff)
Replace Vagrant with Dockerfeature/docker-dev
Selenium w/ phantomjs can't cope with https://github.com/theintern/intern-examples/pull/25#issuecomment-136440975. This docker image gives us headless Chrome, and switching to Docker gives us a more modern dev environment anyway.
-rw-r--r--.editorconfig4
-rw-r--r--Gruntfile.js6
-rw-r--r--Vagrantfile6
-rw-r--r--devbox/provisioning.sh37
-rw-r--r--devbox/selenium.init.sh52
-rw-r--r--docker-compose.yml14
-rw-r--r--tests/intern.local.js10
-rw-r--r--tests/intern.vagrant.js9
8 files changed, 40 insertions, 98 deletions
diff --git a/.editorconfig b/.editorconfig
index f02c9f2..7fe9349 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,3 +9,7 @@ indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
+
+[docker-compose.yml]
+indent_style = space
+indent_size = 2
diff --git a/Gruntfile.js b/Gruntfile.js
index d8a253e..4d4befc 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,7 +1,5 @@
'use strict';
-var localInternConfig = process.env.CANDY_VAGRANT === 'false' ? 'tests/intern.local' : 'tests/intern.vagrant';
-
module.exports = function(grunt) {
// Project configuration.
@@ -160,14 +158,14 @@ module.exports = function(grunt) {
unit: {
options: {
runType: 'runner',
- config: localInternConfig,
+ config: 'tests/intern.local',
functionalSuites: []
}
},
functional: {
options: {
runType: 'runner',
- config: localInternConfig,
+ config: 'tests/intern.local',
suites: []
}
}
diff --git a/Vagrantfile b/Vagrantfile
index 996df52..3d59fbf 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -5,18 +5,18 @@
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- config.vm.box = "ubuntu/trusty64"
+ config.vm.box = "spartan/docker"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 5280, host: 5280
- config.vm.network :forwarded_port, guest: 4444, host: 4444
config.vm.network :private_network, ip: '192.168.88.4'
config.vm.provision :shell, :path => "devbox/provisioning.sh"
+ #config.vm.provision :shell, inline: "docker-compose run grunt npm install && docker-compose run grunt bower install"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
config.vm.provider "virtualbox" do |v|
v.name = "candy"
- v.customize ["modifyvm", :id, "--memory", 2048]
+ v.customize ["modifyvm", :id, "--memory", 1024]
end
end
diff --git a/devbox/provisioning.sh b/devbox/provisioning.sh
index 9636cf2..95c9503 100644
--- a/devbox/provisioning.sh
+++ b/devbox/provisioning.sh
@@ -34,34 +34,13 @@ cp /vagrant/devbox/nginx-default.conf /etc/nginx/sites-available/default
sed --in-place 's|{{ROOT_DIR}}|/vagrant|g' /etc/nginx/sites-available/default/nginx-default.conf
/etc/init.d/nginx restart
-#
-# Candy development dependencies
-#
-sudo add-apt-repository ppa:chris-lea/node.js
-sudo apt-get update
-sudo apt-get install -y nodejs git
-npm install -g grunt-cli
-npm install -g bower
+# Set it up to cd to /vagrant on login.
+profile='/home/vagrant/.profile';
+if [ "$(tail -n 1 $profile)" != 'cd /vagrant' ]; then
+ echo 'cd /vagrant' >> $profile;
+fi
-cd /vagrant
-su -u vagrant npm install
-su -u vagrant bower install
+cd /vagrant;
-#
-# Selenium & PhantomJS for testing
-#
-apt-get install -y openjdk-7-jre
-mkdir /usr/lib/selenium/
-wget --no-verbose --output-document=/usr/lib/selenium/selenium-server-standalone-2.42.2.jar -- http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
-mkdir -p /var/log/selenium/
-chmod a+w /var/log/selenium/
-cp /vagrant/devbox/selenium.init.sh /etc/init.d/selenium
-chmod 755 /etc/init.d/selenium
-/etc/init.d/selenium start
-update-rc.d selenium defaults
-sudo apt-get install build-essential g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev python libx11-dev libxext-dev
-git clone git://github.com/ariya/phantomjs.git
-cd phantomjs
-git checkout 2.0
-./build.sh --confirm
-sudo cp bin/* /usr/local/bin
+docker-compose run grunt npm install
+docker-compose run grunt bower install
diff --git a/devbox/selenium.init.sh b/devbox/selenium.init.sh
deleted file mode 100644
index e9841ca..0000000
--- a/devbox/selenium.init.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-case "${1:-''}" in
- 'start')
- if test -f /tmp/selenium.pid
- then
- echo "Selenium is already running."
- else
- java -jar /usr/lib/selenium/selenium-server-standalone-2.42.2.jar -port 4444 > /var/log/selenium/selenium-output.log 2> /var/log/selenium/selenium-error.log & echo $! > /tmp/selenium.pid
- echo "Starting Selenium..."
-
- error=$?
- if test $error -gt 0
- then
- echo "${bon}Error $error! Couldn't start Selenium!${boff}"
- fi
- fi
- ;;
- 'stop')
- if test -f /tmp/selenium.pid
- then
- echo "Stopping Selenium..."
- PID=`cat /tmp/selenium.pid`
- kill -3 $PID
- if kill -9 $PID ;
- then
- sleep 2
- test -f /tmp/selenium.pid && rm -f /tmp/selenium.pid
- else
- echo "Selenium could not be stopped..."
- fi
- else
- echo "Selenium is not running."
- fi
- ;;
- 'restart')
- if test -f /tmp/selenium.pid
- then
- kill -HUP `cat /tmp/selenium.pid`
- test -f /tmp/selenium.pid && rm -f /tmp/selenium.pid
- sleep 1
- java -jar /usr/lib/selenium/selenium-server-standalone-2.42.2.jar -port 4444 > /var/log/selenium/selenium-output.log 2> /var/log/selenium/selenium-error.log & echo $! > /tmp/selenium.pid
- echo "Reload Selenium..."
- else
- echo "Selenium isn't running..."
- fi
- ;;
- *) # no parameter specified
- echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
- exit 1
- ;;
-esac
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..e7d63ad
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,14 @@
+selenium:
+ image: selenium/standalone-chrome:2.47.1
+ expose:
+ - 4444
+
+grunt:
+ image: digitallyseamless/nodejs-bower-grunt
+ expose:
+ - 9000
+ links:
+ - selenium
+ volumes:
+ - /vagrant:/data
+ command: grunt watch
diff --git a/tests/intern.local.js b/tests/intern.local.js
index 3ca4ac4..9ce4079 100644
--- a/tests/intern.local.js
+++ b/tests/intern.local.js
@@ -5,7 +5,15 @@ define([
], function (intern) {
intern.tunnel = 'NullTunnel';
- intern.environments = [ { browserName: 'phantomjs' } ];
+ intern.environments = [ { browserName: 'chrome', version: '43', platform: [ 'Linux' ] } ];
+
+ intern.tunnelOptions = {
+ hostname: 'selenium',
+ port: '4444',
+ verbose: true
+ };
+
+ intern.proxyUrl = 'http://grunt:9000/';
return intern;
});
diff --git a/tests/intern.vagrant.js b/tests/intern.vagrant.js
deleted file mode 100644
index eb4b1cf..0000000
--- a/tests/intern.vagrant.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*global define */
-
-define([
- './intern.local'
-], function (intern) {
- intern.proxyUrl = 'http://192.168.88.1:9000/';
-
- return intern;
-});