Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Docker development environment #418

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 2 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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: []
}
}
Expand Down
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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", 768]
v.customize ["modifyvm", :id, "--memory", 1024]
end
end
32 changes: 8 additions & 24 deletions devbox/provisioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +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
apt-get install -y phantomjs
docker-compose run grunt npm install
docker-compose run grunt bower install
52 changes: 0 additions & 52 deletions devbox/selenium.init.sh

This file was deleted.

14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"grunt-prompt": "^1.3.0",
"grunt-sync-pkg": "^0.1.2",
"grunt-todo": "~0.4.0",
"intern": "^2.0.1",
"intern": "^3.0.0",
"jshint-stylish": "^0.2.0",
"lolex": "^1.2.0",
"sinon": "^1.10.3",
Expand Down
11 changes: 2 additions & 9 deletions tests/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,9 @@ define({
// Name of the tunnel class to use for WebDriver tests
tunnel: 'SauceLabsTunnel',

// The desired AMD loader to use when running unit tests (client.html/client.js). Omit to use the default Dojo
// loader
useLoader: {
'host-node': 'dojo/dojo',
'host-browser': 'node_modules/dojo/dojo.js'
},

// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader
// can be used here
loader: {
loaderOptions: {
// Packages that should be registered with the loader in each testing environment
packages: [
{ name: 'candy', location: '.' }
Expand All @@ -67,5 +60,5 @@ define({
// A regular expression matching URLs to files that should not be included in code coverage analysis
excludeInstrumentation: /^(?:tests\/|node_modules\/|bower_components\/|libs\.[^.]+\.js)/,

reporters: ['runner', 'lcov']
reporters: ['Runner', {"id":"Lcov","filename":"lcov.info"}]
});
10 changes: 9 additions & 1 deletion tests/intern.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
9 changes: 0 additions & 9 deletions tests/intern.vagrant.js

This file was deleted.